Closed Bug 556181 Opened 16 years ago Closed 16 years ago

Make math-partial sums not waste time with GETXPROP

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: dmandelin, Unassigned)

References

Details

This is a placeholder bug so I can externalize the need to make sure this gets fixed eventually: SunSpider's math-partial-sums inadvertently mostly uses global variables in its hot loop. There are lots of statements like |a2 += e| where |a2| is a free variable (and is a global at run time). SM implements this more-or-less like this: bindname a2 dup getxprop a2 [[code for expr e]] setname a2 pop This gives pretty bad perf and makes life hard on jits generally. It can probably be fixed as part of a general overhaul of free variables and globals. We should be able to prove that a2 must be a global and emit code more like this: getglobal a2 [[code for expr e]] setglobal a2 pop But this recommendation might not be good. The key point is we have to make sure we get this to run fast one way or another.
See bug 321757 for the genesis of GETXPROP -- it's required that this throw: foo += 42; where foo is not yet defined (by var or by an assignment). /be
Of course the old interpreter's bytecode sequence is suboptimal -- don't let me dissuade you from going much faster in JM. One might hope for a SS fix to declare 9 out of 10 local variables correctly :-P. /be
The tracer turns these into pretty efficient code. JM should be able to use a PIC to a similar effect.
Yes, you are both right that we might be able to fix this up just fine without modifying the bytecode at all. I just needed a reminder to make sure we do fix it up in JM eventually. :-)
This went away with all of JM's changes to globals (bug 561923 and follow-ups).
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.