Closed Bug 1692317 Opened 4 years ago Closed 4 years ago

Remove GC tracing from CompilationStencil

Categories

(Core :: JavaScript Engine, task, P1)

task

Tracking

()

RESOLVED FIXED
87 Branch
Tracking Status
firefox87 --- fixed

People

(Reporter: tcampbell, Assigned: tcampbell)

References

(Blocks 1 open bug)

Details

Attachments

(7 files, 1 obsolete file)

The CompilationStencil::input still has GC pointers in some cases which is problematic for adding a new API for stencil. This bug tries to untangle that.

Use the UniquePtr overloads everywhere to reduce code duplication.

Depends on D104885

Move the CompilationInput out of CompilationStencil and trace that instead.
For now, the CompilationStencil continues to have a reference to the input so
care must be taken. Note that the compile options were already a reference so
this footgun already existed. Later patches will simplify this.

Depends on D104886

Move these methods to the stencil since we will more ScriptSource in
subsequent patches.

Depends on D104887

The ScriptSource no longer requires GC-tracing so we want it out of the
CompilationInput and on the CompilationStencil.

Depends on D104888

The Parser / BCE should use CompilationState instead of trying to access the
information through the CompilationStencil.

Depends on D104889

Attachment #9202696 - Attachment description: Bug 1692317 - Simplify CompileGlobalScriptToStencil overloads → Bug 1692317 - Simplify CompileGlobalScriptToStencil overloads. r?arai!
Attachment #9202697 - Attachment description: Bug 1692317 - Simplify ParseModuleToStencil overloads → Bug 1692317 - Simplify ParseModuleToStencil overloads. r?arai!
Attachment #9202698 - Attachment description: Bug 1692317 - Move CompilationInput out of CompilationStencil → Bug 1692317 - Move CompilationInput out of CompilationStencil. r?arai!
Attachment #9202699 - Attachment description: Bug 1692317 - Move CompilationInput::initFor* methods to CompilationStencil → Bug 1692317 - Move CompilationInput::initFor* methods to CompilationStencil. r?arai!
Attachment #9202700 - Attachment description: Bug 1692317 - Move CompilationInput::source_ to CompilationStencil → Bug 1692317 - Move CompilationInput::source_ to CompilationStencil. r?arai!
Attachment #9202701 - Attachment description: Bug 1692317 - Remove some uses of CompilationStencil::input → Bug 1692317 - Remove some uses of CompilationStencil::input. r?arai!

This requires feeding in the CompileOptions for both encoding (which checks
options), and decoding (which needs flags like 'mutedErrors' for the
ScriptSource).

Depends on D104890

This requires explicitly passing the 'input' data into the instantiation code
in order to access atom-cache and enclosing-scope-chain.

The CompilationStencil is now entirely decoupled from the GC and no tracing
or references to traced objects are required anymore.

Depends on D104938

Attachment #9202699 - Attachment is obsolete: true
Attachment #9202700 - Attachment description: Bug 1692317 - Move CompilationInput::source_ to CompilationStencil. r?arai! → Bug 1692317 - Add CompilationStencil::source field. r?arai!
Pushed by tcampbell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7a16727c6518 Simplify CompileGlobalScriptToStencil overloads. r=arai https://hg.mozilla.org/integration/autoland/rev/de199d2deec2 Simplify ParseModuleToStencil overloads. r=arai https://hg.mozilla.org/integration/autoland/rev/d83581a3c1a2 Move CompilationInput out of CompilationStencil. r=arai https://hg.mozilla.org/integration/autoland/rev/26455ae13f52 Add CompilationStencil::source field. r=arai https://hg.mozilla.org/integration/autoland/rev/898f133e93a3 Remove some uses of CompilationStencil::input. r=arai https://hg.mozilla.org/integration/autoland/rev/ae1d9fd6425e Remove uses of CompilationStencil::input from Stencil-XDR. r=arai https://hg.mozilla.org/integration/autoland/rev/78014b3ee746 Remove CompilationStencil::input entirely. r=arai
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: