Is the mutability of bindings in strict eval code observable in the language?
brendan at mozilla.org
Tue Oct 19 13:06:05 PDT 2010
On Oct 19, 2010, at 11:30 AM, Mark S. Miller wrote:
> Thanks, that was very clarifying. For the implementations that still use objects, presumably these objects do not inherit from Object.prototype, etc.
> In that case, given that these objects are also not otherwise reachable as you state, then for direct strict eval your analysis is clearly correct.
> Btw, which implementations are these?
I'll let other implementors speak for their engines. SpiderMonkey optimizes away scope objects where it can (my memory says Rhino does something similar), but eval, with, and evaluation of closures that can't be optimized a la Chez Scheme's "display closures" (by copying values of upvars whose initializer or equivalent single assignment dominates the closure expression) reify the scope chain, including block objects induced by let bindings and catch variables.
These internal objects do not leak into "user-land" of course. A post-Firefox-4 work item is to optimize harder and in any event replace objects with more optimized internal structures.
More information about the es5-discuss