Closed Bug 1591747 Opened 5 years ago Closed 5 years ago

Combine JSFunction lazy_ / script_ fields

Categories

(Core :: JavaScript Engine, task, P1)

task

Tracking

()

RESOLVED FIXED
mozilla72
Tracking Status
firefox72 --- fixed

People

(Reporter: tcampbell, Assigned: tcampbell)

References

Details

Attachments

(3 files)

Use js::BaseScript* as a common field for LazyScript and JSScript in JSFunction. This is a precursor to merging the two types.

The union handles barriers manually and there is a bit of trickiness to preserve here. Remove unecessary accessors like JSFunction::setScript() so there is less barrier code to reason about.

Instead, use JSFunction::maybeCanonicalFunction() which better documents
why the script should already exist.

The LazyScript -> JSScript link is already set during
JSScript::fullyInitFromEmitter.

Depends on D50718

Store js::BaseScript* to unify both the script_ and lazy_ fields of
JSFunction. Remove the mutableScript() and setScript() accessors and
make manual barriers more consistent.

Depends on D50719

Pushed by tcampbell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/93cc053b18b9 Remove JSFunction::existingScriptNonDelazifying() r=jandem https://hg.mozilla.org/integration/autoland/rev/a9d765100908 Remove redundant initScript call in DelazifyCanonicalScriptedFunction r=jandem https://hg.mozilla.org/integration/autoland/rev/e53af14c6089 Unify JSFunction script_/lazy_ fields r=jandem
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: