Closed Bug 1788977 Opened 2 years ago Closed 2 years ago

Simplify off-thread stencil APIs

Categories

(Core :: JavaScript Engine, task, P1)

task

Tracking

()

RESOLVED FIXED
106 Branch
Tracking Status
firefox106 --- fixed

People

(Reporter: tcampbell, Assigned: tcampbell)

References

(Blocks 1 open bug)

Details

Attachments

(8 files)

With stencil being a unified format for the various compile/module/decode paths, we don't need to specialize many of the 'Finish*' methods anymore. Cleaning these up lets us simplify a lot of code.

Similarly, the incremental-encoding code can be simplified to make it easier to share code for main-thread and off-thread parsing.

Replace the 'transcodeOnly' flag with an 'execute' flag and remove the unused
Compile function. Also fix parsemark.py compile options to pass cache checks.

Stop using CompileAndStartIncrementalEncoding in the shell and use the
StartIncrementalEncoding method instead. Share the stencil-instantiation code
between the decode and parse paths.

Depends on D156333

The OffThreadCompileToStencil call doesn't use debug metadata so it should not
be requesting deferred metadata initialization.

Depends on D156334

Off-thread parse and decode all generate JS::Stencils so the various
specializations are not needed for methods that collect the results back to
main-thread.

Depends on D156335

We use the same VM functions now for all the variations, so it not longer makes
sense to have distinct testing functions that must be carefully matched. As a
result we can simplify how off-thread jobs are handled in the shell.

Depends on D156336

Use optional parameter for the InstantiationStorage argument to consolidate the
different overloads. This will make it easier to reuse code for main-thread and
off-thread parsing.

Depends on D156337

In all cases we now use JS::StartIncrementalEncoding. Since bytecode encoding is
a somewhat advanced feature, using JS::Stencil types explicitly gives a lot more
flexibility so this convenience function wasn't proving much value.

Depends on D156339

Pushed by tcampbell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/501193602b0e
Add 'execute' flag to jsshell Evaluate function. r=arai
https://hg.mozilla.org/integration/autoland/rev/c17e9ec13b36
Cleanup Evaluate function in jsshell. r=arai
https://hg.mozilla.org/integration/autoland/rev/f0b9b4f00c80
Remove extraneous setDeferDebugMetadata calls in jsshell. r=arai
https://hg.mozilla.org/integration/autoland/rev/c6e2cb6974e5
Consolidate methods for finishing off-thread JS parse/decode. r=arai
https://hg.mozilla.org/integration/autoland/rev/66067684af0a
Consolidate the finishOffThread*Stencil shell functions. r=arai
https://hg.mozilla.org/integration/autoland/rev/df1b8cb586de
Consolidate JS::Instantiate{Global,Module}Stencil function overloads. r=arai
https://hg.mozilla.org/integration/autoland/rev/0c6fbdb9a08c
Share stencil-instantiate code in JSExecutionContext. r=arai
https://hg.mozilla.org/integration/autoland/rev/894c1d7043bb
Remove JS::CompileAndStartIncrementalEncoding. r=arai
Severity: -- → N/A
Priority: -- → P1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: