Closed Bug 406043 Opened 17 years ago Closed 6 years ago

Checks for varobj == scopechain in the compiler are too weak

Categories

(Core :: JavaScript Engine, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: igor, Unassigned)

References

Details

Currently the compiler requires that varobj == scopechain for the top frame when optimizing global variables in script or doing const propagation. The purpose of the checks is to prevent the optimizations when compiling eval inside with/let blocks. This assumes that MaybeSetupFrame would do the proper job when creating the pseudo frame for the compiler. This is indeed the case when SM calls js_CompileScript as a part of eval implementation or for the debugger. But with an embedding calling JS_Compile*Script* API the checks may fail to filter out With/Call/Block objects when those objects are passed directly to API. 

Thus it would be nice to replace the checks with explict filtering based on the scope chain class. It should also allow to skip creation of pseudo-frames for the compiler and simplify the code to finish the refactoring started in bug 404935.
Assignee: igor → general
Assignee: general → nobody
Old bug, no longer valid, therefore closing as INCOMPLETE.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.