Closed Bug 1658631 Opened 4 years ago Closed 4 years ago

Separate compilation to stencil, and instantiation

Categories

(Core :: JavaScript Engine, task, P1)

task

Tracking

()

RESOLVED FIXED
82 Branch
Tracking Status
firefox82 --- fixed

People

(Reporter: arai, Assigned: arai)

References

Details

Attachments

(11 files, 1 obsolete file)

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

Once compilation to stencil stops touching GC things, the only part that touches GC things will be stencil instantiation (and some part that touches input GC things, that can be refactored in separate bug).

We can move the stencil instantiation part out of existing frontend API, so that helper thread can do only the compilation to stencil, and let the main thread instantiate the stencil.

Blocks: 1658971
Depends on: 1661079
Depends on: 1661098
No longer depends on: 1649968
No longer depends on: 1661098
Blocks: 1660940
No longer blocks: stencil, 1658971
Blocks: 1658971
No longer blocks: 1660940

CompileGlobalScriptToStencil returns CompilationStencil in CompilationInfo as the result of compilation,
and the consumer can call InstantiateStencils to instantiate GC objects,
that can be done later and in different thread.

ParseTask generates CompilationInfo, that contains both input and stencil output.
and the main thread grabs it and instantiate it on the main thread, when finishting the compilation.

Depends on D88593

Stop exposing CompilationGCOutput where the consumer doesn't need to instantiate stencil in different step.

Depends on D88595

Compile{Foo} for public API, and Compile{Foo}Impl for internal template functions.

Depends on D88597

Attachment #9172676 - Attachment is obsolete: true
Attachment #9172675 - Attachment description: Bug 1658631 - Part 3: Instantiate stencil in main thread for off-thread script compilation. r?tcampbell! → Bug 1658631 - Part 3: Instantiate stencil in main thread for off-thread script/module compilation. r?tcampbell!
Attachment #9172677 - Attachment description: Bug 1658631 - Part 5: Simplify main-thread API for CompileGlobalScript. r?tcampbell! → Bug 1658631 - Part 4: Simplify main-thread API for CompileGlobalScript. r?tcampbell!
Attachment #9172678 - Attachment description: Bug 1658631 - Part 6: Simplify CompileEvalScript. r?tcampbell! → Bug 1658631 - Part 5: Simplify CompileEvalScript. r?tcampbell!
Attachment #9172679 - Attachment description: Bug 1658631 - Part 7: Rename module functions to align with others. r?tcampbell! → Bug 1658631 - Part 6: Rename module functions to align with others. r?tcampbell!
Attachment #9172680 - Attachment description: Bug 1658631 - Part 8: Remove fixEnclosingEnvironmentAfterRealmMerge. r?tcampbell! → Bug 1658631 - Part 7: Remove fixEnclosingEnvironmentAfterRealmMerge. r?tcampbell!
Attachment #9172681 - Attachment description: Bug 1658631 - Part 9: Move ModuleObject::Freeze into CompilationInfo::instantiateStencils. r?tcampbell! → Bug 1658631 - Part 8: Move ModuleObject::Freeze into CompilationInfo::instantiateStencils. r?tcampbell!
Depends on: 1662374
Attachment #9172675 - Attachment description: Bug 1658631 - Part 3: Instantiate stencil in main thread for off-thread script/module compilation. r?tcampbell! → Bug 1658631 - Part 3: Support instantiating stencil in main thread for off-thread script/module compilation. r?tcampbell!
Attachment #9172677 - Attachment description: Bug 1658631 - Part 4: Simplify main-thread API for CompileGlobalScript. r?tcampbell! → Bug 1658631 - Part 6: Simplify main-thread API for CompileGlobalScript. r?tcampbell!
Attachment #9172678 - Attachment description: Bug 1658631 - Part 5: Simplify CompileEvalScript. r?tcampbell! → Bug 1658631 - Part 7: Simplify CompileEvalScript. r?tcampbell!
Attachment #9172679 - Attachment description: Bug 1658631 - Part 6: Rename module functions to align with others. r?tcampbell! → Bug 1658631 - Part 8: Rename module functions to align with others. r?tcampbell!
Attachment #9172680 - Attachment description: Bug 1658631 - Part 7: Remove fixEnclosingEnvironmentAfterRealmMerge. r?tcampbell! → Bug 1658631 - Part 9: Do not call fixEnclosingEnvironmentAfterRealmMerge if useOffThreadParseGlobal is false. r?tcampbell!
Attachment #9172681 - Attachment description: Bug 1658631 - Part 8: Move ModuleObject::Freeze into CompilationInfo::instantiateStencils. r?tcampbell! → Bug 1658631 - Part 10: Perform ModuleObject::Freeze in CompilationInfo::instantiateStencils if instantiating on main thread. r?tcampbell!
Depends on: 1662583
Attachment #9173361 - Attachment description: Bug 1658631 - Part 4: Make ParseTask.parseGlobal nullable. r?tcampbell! → Bug 1658631 - Part 5: Make ParseTask.parseGlobal nullable. r?tcampbell!
Attachment #9173362 - Attachment description: Bug 1658631 - Part 5: Stop creating parse global if useOffThreadParseGlobal is set to false. r?tcampbell! → Bug 1658631 - Part 6: Stop creating parse global if useOffThreadParseGlobal is set to false. r?tcampbell!
Attachment #9172677 - Attachment description: Bug 1658631 - Part 6: Simplify main-thread API for CompileGlobalScript. r?tcampbell! → Bug 1658631 - Part 7: Simplify main-thread API for CompileGlobalScript. r?tcampbell!
Attachment #9172678 - Attachment description: Bug 1658631 - Part 7: Simplify CompileEvalScript. r?tcampbell! → Bug 1658631 - Part 8: Simplify CompileEvalScript. r?tcampbell!
Attachment #9172679 - Attachment description: Bug 1658631 - Part 8: Rename module functions to align with others. r?tcampbell! → Bug 1658631 - Part 9: Rename module functions to align with others. r?tcampbell!
Attachment #9172680 - Attachment description: Bug 1658631 - Part 9: Do not call fixEnclosingEnvironmentAfterRealmMerge if useOffThreadParseGlobal is false. r?tcampbell! → Bug 1658631 - Part 10: Do not call fixEnclosingEnvironmentAfterRealmMerge if useOffThreadParseGlobal is false. r?tcampbell!
Attachment #9172681 - Attachment description: Bug 1658631 - Part 10: Perform ModuleObject::Freeze in CompilationInfo::instantiateStencils if instantiating on main thread. r?tcampbell! → Bug 1658631 - Part 11: Perform ModuleObject::Freeze in CompilationInfo::instantiateStencils if instantiating on main thread. r?tcampbell!
Pushed by arai_a@mac.com:
https://hg.mozilla.org/integration/autoland/rev/4a8df2bc7713
Part 1: Add frontend::CompileGlobalScriptToStencil and frontend::InstantiateStencils. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/6cb5b3f713dd
Part 2: Add frontend::ParseModuleToStencil. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/99f6e246e715
Part 3: Support instantiating stencil in main thread for off-thread script/module compilation. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/30679d02144c
Part 4: Defer enclosingScope init for modules. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/c2dceacc711d
Part 5: Make ParseTask.parseGlobal nullable. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/6420c7e18983
Part 6: Stop creating parse global if useOffThreadParseGlobal is set to false. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/e1b43ff866ed
Part 7: Simplify main-thread API for CompileGlobalScript. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/d6286e1b523b
Part 8: Simplify CompileEvalScript. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/855bd5d9ef0b
Part 9: Rename module functions to align with others. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/d36b22eff759
Part 10: Do not call fixEnclosingEnvironmentAfterRealmMerge if useOffThreadParseGlobal is false. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/051b96a02b5a
Part 11: Perform ModuleObject::Freeze in CompilationInfo::instantiateStencils if instantiating on main thread. r=tcampbell
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: