Split CompilationInfo into input, state, and output
Categories
(Core :: JavaScript Engine, task, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox82 | --- | fixed |
People
(Reporter: arai, Assigned: arai)
References
Details
Attachments
(14 files)
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 | |
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 |
To use CompilationInfo (or part of it) as a top level struct of Stencil,
(updated)
it needs to be split into the following 4 structs:
- input
const JS::ReadOnlyCompileOptions& options
JS::Rooted<BaseScript*> lazy
JS::Rooted<ScriptSourceHolder> source_
JS::Rooted<Scope*> enclosingScope
- state
AutoKeepAtoms keepAtoms
Directives directives
ScopeContext scopeContext
FunctionBox* traceListHead
(will be removed after parser atom)UsedNameTracker usedNames
LifoAllocScope& allocScope
- stencil output
Vector<RegExpCreationData> regExpData
Vector<BigIntCreationData> bigIntData
JS::RootedVector<ScriptStencil> funcData
JS::Rooted<ScriptStencil> topLevel
JS::RootedVector<ScopeCreationData> scopeCreationData
JS::Rooted<StencilModuleMetadata> moduleMetadata
HashMap<FunctionIndex, RefPtr<const JS::WasmModule>> asmJS
ParserAtomsTable parserAtoms
- GC output
JS::Rooted<JSScript*> script
JS::Rooted<ModuleObject*> module
JS::RootedVector<JSFunction*> functions
JS::RootedVector<js::Scope*> scopes
JS::Rooted<ScriptSourceObject*> sourceObject
Updated•4 years ago
|
Assignee | ||
Comment 1•4 years ago
•
|
||
things necessary to instantiate stencil also includes input.
input -> [parser+bytecode compiler, using state] -> input+stencil -> [instantiate] -> GC output
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 2•4 years ago
|
||
This patch just adds 4 structs to categolize CompilationInfo fields.
Later patches will simplify methods and consumers.
Depends on D88204
Updated•4 years ago
|
Assignee | ||
Comment 3•4 years ago
|
||
Depends on D88205
Assignee | ||
Comment 4•4 years ago
|
||
CompilationGCOutput will be moved out of CompilationInfo in later patch.
Depends on D88206
Assignee | ||
Comment 5•4 years ago
|
||
So that we don't need forward declaration.
Depends on D88207
Assignee | ||
Comment 6•4 years ago
|
||
CompilationGCOutput should have different lifetime than input + stencil.
CompilationGCOutput can even be allocated in different thread than the
compilation (off-thread compilation will instantiate stencil in main thread).
Depends on D88208
Assignee | ||
Comment 7•4 years ago
|
||
Depends on D88209
Assignee | ||
Comment 8•4 years ago
|
||
Depends on D88210
Assignee | ||
Comment 9•4 years ago
|
||
Depends on D88211
Assignee | ||
Comment 10•4 years ago
|
||
Depends on D88212
Assignee | ||
Comment 11•4 years ago
|
||
The output of the compilation is input + stencil, and CompilationState is
purely the internal data.
Depends on D88213
Assignee | ||
Comment 12•4 years ago
|
||
Depends on D88214
Assignee | ||
Comment 13•4 years ago
|
||
CompilationState is used from both Parser and BytecodeEmitter,
so SourceAwareCompiler should have it, and hide CompilationState from the API
consumers (except the place that directly calls Parser).
Depends on D88215
Assignee | ||
Comment 14•4 years ago
|
||
Now we have the following 5 public methods, and the consumer should call one of them, depending on the target:
- initForGlobal
- initForStandaloneFunction
- initForEval
- initForModule
- initFromLazy
Depends on D88216
Assignee | ||
Comment 15•4 years ago
|
||
Depends on D88217
Comment 16•4 years ago
|
||
Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/3a159e26e470 Part 1: Create CompilationInput, CompilationState, CompilationStencil, and CompilationGCOutput. r=tcampbell https://hg.mozilla.org/integration/autoland/rev/3cbce137e341 Part 2: Move CompilationInfo methods to CompilationInput. r=tcampbell https://hg.mozilla.org/integration/autoland/rev/a025f184d951 Part 3: Use CompilationStencil and CompilationGCOutput in ScriptStencilIterable. r=tcampbell https://hg.mozilla.org/integration/autoland/rev/bcdf0ed050f1 Part 4: Reorder ScriptStencilIterable definition. r=tcampbell https://hg.mozilla.org/integration/autoland/rev/7b8ef9e9e834 Part 5: Move CompilationGCOutput out from CompilationInfo. r=tcampbell https://hg.mozilla.org/integration/autoland/rev/73282eb9b64e Part 6: Use CompilationStencil in ScopeCreationData::create. r=tcampbell https://hg.mozilla.org/integration/autoland/rev/2c60395051a8 Part 7: Use CompilationStencil in BigIntLiteral. r=tcampbell https://hg.mozilla.org/integration/autoland/rev/6c0fb1bf5570 Part 8: Use CompilationStencil in RegExpLiteral. r=tcampbell https://hg.mozilla.org/integration/autoland/rev/1413c434a062 Part 9: Use CompilationState in ParseContext. r=tcampbell https://hg.mozilla.org/integration/autoland/rev/f3fc160379a0 Part 10: Move CompilationState out of CompilationInfo. r=tcampbell https://hg.mozilla.org/integration/autoland/rev/69e5bd11d0ed Part 11: Move dump to CompilationStencil. r=tcampbell https://hg.mozilla.org/integration/autoland/rev/cb97934e3192 Part 12: Move CompilationState into SourceAwareCompiler. r=tcampbell https://hg.mozilla.org/integration/autoland/rev/0a42010bbfee Part 13: Make CompilationInfo::init* explicit about the target. r=tcampbell https://hg.mozilla.org/integration/autoland/rev/0ae2362c2288 Part 14: Make CompilationInput::setSource private. r=tcampbell
Comment 17•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/3a159e26e470
https://hg.mozilla.org/mozilla-central/rev/3cbce137e341
https://hg.mozilla.org/mozilla-central/rev/a025f184d951
https://hg.mozilla.org/mozilla-central/rev/bcdf0ed050f1
https://hg.mozilla.org/mozilla-central/rev/7b8ef9e9e834
https://hg.mozilla.org/mozilla-central/rev/73282eb9b64e
https://hg.mozilla.org/mozilla-central/rev/2c60395051a8
https://hg.mozilla.org/mozilla-central/rev/6c0fb1bf5570
https://hg.mozilla.org/mozilla-central/rev/1413c434a062
https://hg.mozilla.org/mozilla-central/rev/f3fc160379a0
https://hg.mozilla.org/mozilla-central/rev/69e5bd11d0ed
https://hg.mozilla.org/mozilla-central/rev/cb97934e3192
https://hg.mozilla.org/mozilla-central/rev/0a42010bbfee
https://hg.mozilla.org/mozilla-central/rev/0ae2362c2288
Description
•