Closed Bug 1592356 Opened 5 years ago Closed 5 years ago

Remove LazyScript::hasNonSyntacticScope

Categories

(Core :: JavaScript Engine, task, P2)

task

Tracking

()

RESOLVED FIXED
mozilla73
Tracking Status
firefox73 --- fixed

People

(Reporter: tcampbell, Assigned: tcampbell)

References

Details

Attachments

(1 file)

Currently the definition of hasNonSyntacticScope differs between LazyScript and JSScript. We have already moved the HasNonSyntacticScope flag to BaseScript so this is a bit of a foot-gun (see: Bug 1591921).

Instead, the frontend should properly compute the non-syntactic flag while creating the LazyScript and should use the HasNonSyntacticScope flag to hold result.

Once this is done, the js::CanReuseScriptForClone function should be updated to use baseScript().

Update js::CanReuseScriptForClone to use baseScript() to determine if
non-syntactic. The HasNonSyntacticScope is not computed for lazy scripts so
fall back to checking the scope. Technically this is a fraction slower when
cloning a script with a syntactic global into a function with a non-syntactic
global, but in that case we are just about to clone the entire script
anyways. In practice this rarely comes up.

Assignee: nobody → tcampbell
Status: NEW → ASSIGNED
Pushed by tcampbell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/709cb0205720 Remove LazyScript::hasNonSyntacticScope. r=jandem
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla73
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: