Open Bug 855852 Opened 12 years ago Updated 2 years ago

IonMonkey: Hoist dispatch instructions with LICM.

Categories

(Core :: JavaScript Engine, defect)

defect

Tracking

()

People

(Reporter: nbp, Unassigned)

References

(Depends on 1 open bug)

Details

Hoisting dispatch instruction out side of loop bodies using LICM should give the opportunity to reduce a huge cost, especially in tight loops. In addition this gives the ability to hoist more things with LICM & GVN after the first pass, as for example an inline function might contain some code which does not depend on a loop variable. Ideally, we should be able to optimize a test case looking like: function 2dImage(x, y) { this.maxIndex = x * y; this.getPixelByIndex = function (i) { … } this.setPixelByIndex = function (i, v) { … } … return this; } function 3dImage(x, y) { this.maxIndex = x * y; this.getPixelByIndex = function (i) { … } this.setPixelByIndex = function (i, v) { … } … return this; } function forEachPixel(f, image) { var max = image.maxIndex; for (var i = 0; i < max; i++) image.setPixelByIndex(i, f(image.getPixelByIndex(i))); } This optimization will consist of duplicating the loop for each kind of image preventing the 3 dispatch related to maxIndex, setPixelByIndex and getPixelByIndex. We need to be able to create basic blocks and clone instructions from one basic block to another as well as cloning the blocks related to it and do the substitution of all the instruction and basic blocks.
Assignee: general → nobody
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.