Cleanup JSScript::fullyInitFromEmitter

RESOLVED FIXED in Firefox 67

Status

()

enhancement
P2
normal
RESOLVED FIXED
6 months ago
5 months ago

People

(Reporter: tcampbell, Assigned: tcampbell)

Tracking

(Blocks 2 bugs)

unspecified
mozilla67
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox67 fixed)

Details

Attachments

(10 attachments)

47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review

I have a series of patches here to make JSScript::fullyInitFromEmitter more similar to the XDRScript code (with JSScript / PrivateScriptData / SharedScriptData initialized in phases).

As well, we should avoid the initialization code accessing the JSScript during initialization to compute more parts of it. The data for these queries should come from BCE instead.

This removes the redundant set of TreatAsRunOnce which is instead set by
CompileOptions before we start compiling. The IsModule flag is now set
directly similar to IsForEval.

Compute this flag directly from BytecodeEmitter data structures instead
of needing to access the partially initialized script while setting its
own flags.

Depends on D22313

Use an ExitScope similar to to XDRScript for more consistency.

Depends on D22316

When compiling a script with lazy inner functions, we now know the
scopes that those inner functions belong too and need to save this
information on the inner function itself (as enclosingScope). This patch
makes that process more explicit in JSScript initialization so we can
better reason about error / OOM paths.

Depends on D22319

Depends on D22321

Split into one part for JSScript internal initialization of flags and a
second part for linking the JSFunction and JSScript only after the
script is fully initialized.

Depends on D22322

Pushed by tcampbell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3fd4fd359c05
Remove JSScript::initFromModuleContext r=jandem
https://hg.mozilla.org/integration/autoland/rev/1eb22a2970d3
Compute JSScript::FunHasAnyAliasedFormal directly from BCE r=jandem
https://hg.mozilla.org/integration/autoland/rev/a8cbb44ae49b
Compute JSScript::NeedsFunctionEnvironmentObjects directly from BCE r=jandem
https://hg.mozilla.org/integration/autoland/rev/ce7559041ffa
Cleanup JSScript::fullyInitFromEmitter error handling r=jandem
https://hg.mozilla.org/integration/autoland/rev/a826392776b5
JSScript::fullyInitFromEmitter group POD fields r=jandem
https://hg.mozilla.org/integration/autoland/rev/154ce749b8e1
JSScript::fullyInitFromEmitter group flag init r=jandem
https://hg.mozilla.org/integration/autoland/rev/62ba39ca25a2
Split out inner-function scope linking in script compile r=jandem
https://hg.mozilla.org/integration/autoland/rev/e993e4a050b0
Add PrivateScriptData::InitFromEmitter r=jandem
https://hg.mozilla.org/integration/autoland/rev/6da5f14c5005
Add SharedScriptData::InitFromEmitter r=jandem
https://hg.mozilla.org/integration/autoland/rev/ba3dfc81120d
Split JSScript::initFromFunctionBox r=jandem
Blocks: 1533196
Blocks: 1535138
You need to log in before you can comment on or make changes to this bug.