Closed Bug 561222 Opened 14 years ago Closed 14 years ago

JM: Improve front-end binding of global variables

Categories

(Core :: JavaScript Engine, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: dvander, Unassigned)

References

Details

We can classify globals in two ways:

 * Declared, meaning the reference can be statically bound to a top-level variable declared with the "var" keyword.
 * Undeclared, meaning a free variable reference that cannot be aliased by an eval() or |with| scope.

Currently, we take advantage of declared globals only in top-level code, via GETGVAR, SETGVAR, and GVARINC/DEC opcodes. Global uses in functions, or undeclared global uses in top-level code, resort to BINDNAME, NAME, SETNAME, GETXPROP, etc. These also get used for anything we don't statically bind, whether they're global or not.

Ideally we want to introduce four new opcodes:
 GETGLOBAL, SETGLOBAL
 GETUGLOBAL, SETUGLOBAL

And remove:
 GETGVAR, SETGVAR
 INCGVAR, GVARINC, DECGVAR, GVARDEC
 (The method JIT can equivalently optimize these unrolled as longer sequences)

For now, we just want to improve front-end binding, and tag the above opcodes in one of three ways:
 * Declared global
 * Undeclared global
 * Unknown

This hint on the opcode initially will just be ignored.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.