[meta] Cleanup JSFunction/JSScript/LazyScript/Scope initialization sequence
Categories
(Core :: JavaScript Engine, task, P2)
Tracking
()
People
(Reporter: tcampbell, Unassigned)
References
Details
(Keywords: meta)
Attachments
(1 file)
(deleted),
image/png
|
Details |
The sequence of construction and the partial-initialization states of the JSFunction / JSScript / LazyScript / Scope is pretty inconsistent right now, particularly with OOM. We should try to clean this up to support Bug 1529456 and Bug 1544117.
- Define the partial-initialization states (eg. JSFunction without a script; JSScript without SSD)
- Identify the fields (such as LazyScript::enclosingLazyScriptOrScope_) that form cycles and explicitly document them
- More helper methods for patching scripts into tree into the JSFunction namespace
- Add a script tree verification helper
- ??
Reporter | ||
Comment 1•5 years ago
|
||
Reporter | ||
Updated•5 years ago
|
Reporter | ||
Comment 2•4 years ago
|
||
This will largely be addressed by shipping Stencil and replacing script cloning and XDR. The current model used is to do one pass to allocate all JSFunctions
in any order, then a second pass to allocate any BaseScript
and their Scopes
.
Reporter | ||
Comment 3•4 years ago
|
||
This has basically been achieved by the rest of the Stencil work. Removing XDR will be the last element, but the new initialization order is already working in https://searchfox.org/mozilla-central/rev/af5cff556a9482d7aa2267a82f2ccfaf18e797e9/js/src/frontend/Stencil.cpp#546-584
Description
•