Closed Bug 1630788 Opened 1 year ago Closed 1 year ago

Initialize FunctionHasExtraBodyVarScope for lazy BaseScripts

Categories

(Core :: JavaScript Engine, task, P1)

task

Tracking

()

RESOLVED FIXED
mozilla77
Tracking Status
firefox77 --- fixed

People

(Reporter: tcampbell, Assigned: tcampbell)

References

Details

Attachments

(1 file)

Currently the FunctionHasExtraBodyVarScope flag is only set for non-lazy scripts due to it accessing binding information. Since we only care about if there are var bindings or not, and this info is available in a syntax parse, we should support this flag for lazy BaseScripts too.

Move the initialization of this flag to finishFunctionScopes so that it is
set for both lazy and non-lazy compilations. We add a VarScopeHasBindings
helper to mirror the logic of newVarScopeData without allocating. We use
the ImmutableFlag to enable consistent initialization for lazy and non-lazy
scripts.

Note that the previous hasExtraBodyVarScope helper is only used for
bytecode emission which occurs after the FunctionHasExtraBodyVarScope flag is
properly initialized.

Pushed by tcampbell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/983377c0fc28
Init FunctionHasExtraBodyVarScope during lazy parse. r=arai
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla77
You need to log in before you can comment on or make changes to this bug.