Move JSScript/LazyScript finalization/tracing to js::BaseScript
Categories
(Core :: JavaScript Engine, task, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox73 | --- | fixed |
People
(Reporter: tcampbell, Assigned: tcampbell)
References
Details
Attachments
(4 files)
The trace/finalize logic should be moved to the BaseScript to prepare for unifying the GC arena.
Care must be taken with side-table data used for JSScripts. We can add a BaseScript::hasBytecode() method that looks for the presence of sharedData_ to determine if side-tables needed to be traced or updated. These side-tables are only used for successfully compiled scripts, so checking for bytecode is a reasonable mechanism.
The script->lazy and lazy->script tracing is not moved to BaseScript because those fields will be removed shortly.
| Assignee | ||
Comment 1•6 years ago
|
||
Associated tables like DebuggerScripts still need access to bytecode, so make
sure we finalize the script's actual fields last.
Updated•6 years ago
|
| Assignee | ||
Comment 2•6 years ago
|
||
The trace logic is already part of BaseScript so move the finalization logic.
Use a down-cast to JSScript now since only JSScripts have bytecode and
JitScripts. This lets us avoid rewriting a lot of helper methods just yet.
Depends on D58300
| Assignee | ||
Comment 3•6 years ago
|
||
Move the code from JSScript to BaseScript and rename freeScriptData to
freeSharedData.
Depends on D58301
| Assignee | ||
Comment 4•6 years ago
|
||
A number of side-tables exist that are keyed by JSScript pointers. This patch
moves the tracing and finalization of these from JSScript to BaseScript to
support combining LazyScript/JSScript GC arena. This patch eliminates the
LazyScript and JSScript finalize method specializations.
A BaseScript::hasBytecode() method is added to determine if a BaseScript was
a JSScript that was successfully compiled with bytecode. Only these scripts
may be used as keys in side-tables so we check this in finalize methods. A
down-cast to JSScript is used once again to avoid rewriting all the accessor
methods yet.
Depends on D58303
Updated•6 years ago
|
Comment 6•6 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/7b0110552618
https://hg.mozilla.org/mozilla-central/rev/96d2a50a56a6
https://hg.mozilla.org/mozilla-central/rev/33ae0330cbe4
https://hg.mozilla.org/mozilla-central/rev/710e512a7352
Description
•