`FullParseHandler` depends on BaseScript pointer.
Categories
(Core :: JavaScript Engine, enhancement, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox92 | --- | fixed |
People
(Reporter: nbp, Assigned: nbp)
References
(Blocks 1 open bug)
Details
Attachments
(7 files)
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details |
Follow-up of Bug 1718102, we have to replace uses of BaseScript iteration over gc-things to be able to extract the same information from the Stencil directly without having references to any allocated JSFunction
.
Assignee | ||
Comment 1•3 years ago
|
||
In upcoming patches, we are converting the BaseScript::gcThings to a fake
stencil vector of TaggedScriptThingIndex. As we transition progressively, some
kind are not yet represented and therefore not used. To avoid encoding bad
indexes, we create a new OpaqueThing type which is meant to represent all things
we do not yet care about.
Assignee | ||
Comment 2•3 years ago
|
||
When delazifying with a CompileLazyFunction
call, we reused
BaseScript::gcthings to skip over information already provided by the
SyntaxParseHandler
, such as functions and closed-over bindings.
This change adds a stencil-like gcthings span, which is created from the
BaseScript::gcthings() with the intent of later using the same API for mapping
input data from a Stencil without having to allocate GC objects for eager
delazifying functions.
CompilationState::init
is modified to call the convertion from the
BaseScript::gcthings() to the CompilationInput::cachedGcThings_
. The logic of
the FullParseHandler
is updated to work with the gcthings provided by the
CompilationInput
in a similar way, except that atoms contained in the original
vector are internalized under CompilationState::init
instead of being
internalized when visiting each scope under
propagateFreeNamesAndMarkClosedOverBindings
.
Assignee | ||
Comment 3•3 years ago
|
||
When delazifying with a CompileLazyFunction
call, we reused
BaseScript::gcthings to skip over information already provided by the
SyntaxParseHandler
, such as functions and closed-over bindings.
This change adds a stencil-like scriptData and scriptExtra spans, which are
created from the JSFunctions of BaseScript::gcthings() with the intent of later
using the same API for mapping input data from a Stencil without having to
allocate GC objects for eager delazifying functions.
CompilationState::init
is modified to call the convertion from the
BaseScript::gcthings() to the CompilationInput::cacheScriptData_
and
CompilationInput::cacheScriptExtra_
. The logic of the FullParseHandler
is
updated to work with the gcthings provided by the CompilationInput
in a
similar way.
The function skipLazyInnerFunction
now takes its inputs from the
ScriptStencil
and from the ScriptStencilExtra
, thus no longer relying on
BaseScript::gcthings()
nor on a JSFunction*
to extract this information
from. FunctionBox
initialization reflect these changes by taking these 2
inputs as argument as well.
Note that the ScriptStencil
and ScriptStencilExtra
provided by the
CompilationInput
do not reflect the full content of each script, but the bare
minimum used by skipLazyInnerFunction
.
Assignee | ||
Comment 4•3 years ago
|
||
In order to be able to parse from an existing Stencil instead of a BaseScript*,
we have to replace all references to BaseScript* data by abstract data which can
be computed from both, and without the need for allocating GC objects.
This patch is the last change to the FullParseHandler to abstract over a GC
object (BaseScript*) and a Stencil. It removes all references to the
Rooted<BaseScript*> and replaces them by a simple boolean flag which indicate
whether we are reusing data from a pre-parsed function, instead of doing a full
parse which includes resolving bindings and parsing inner functions.
This patch also include a renaming of functions named canSkip*
into reuse*
,
to better highlight why we are doing differently.
Assignee | ||
Comment 5•3 years ago
|
||
The OpaqueThingType placeholder was necessary when making this series of
patches. It is no longer needed anymore.
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 6•3 years ago
|
||
This patch moves data from the CompilationInput to the CompilationState such
that the lifetime of the allocation spans are matching the LifoAlloc scope
maintained by the CompilationState.
A new structure named CompilationSyntaxParseCache is added to hold gcThings,
scriptData and scriptExtra spans which are made to either be allocated or alias
previous Stencil produced by the SyntaxParseHandler.
The FullParseHandler, instead of copying each span, now reference the
CompilationSyntaxParseCache as a constant.
Assignee | ||
Comment 7•3 years ago
|
||
This patch does 2 things:
- It moves the closedOverBindings out of the cachedGCThings_.
- It hides the ScriptIndex extracted from cachedGCThings_.
The cachedGCThings_ used to contain both the TaggedParserAtomIndex and the
ScriptIndex as a TaggedScriptThingIndex. These 2 indexes are referring to data
which are not the same sources. The TaggedParserAtomIndex are indexes in the
parseAtom table, while the ScriptIndex are either newly allocated or reference
to an existing Stencil which is used as input.
Thus, the closedOverBindings_ are moved away of the cachedGCThings_ to highlight
that these are not indexes into an existing Stencil, but references to the
CompilationState.
As the ScriptIndex contained in the cachedGCThings_ are not valid for the
FullParseHandler, the ScriptIndex returned value is now hidden under private
functions, and the function index is used as a replacement. This way, the
ScriptIndex reference should not leak in the FullParseHandler, thus avoiding
confusion.
Comment 9•3 years ago
|
||
Backed out 7 changesets (bug 1719194) for Spidermonkey failure in gecko/js/src/frontend/SyntaxParseHandler. CLOSED TREE
Log:
https://treeherder.mozilla.org/logviewer?job_id=346358176&repo=autoland&lineNumber=753
Push with failures:
https://treeherder.mozilla.org/jobs?repo=autoland&group_state=expanded&revision=d5966f09235371c1a64f205c6d7f132cf5055bea
Backout:
https://hg.mozilla.org/integration/autoland/rev/2a2ca9b3b3958bb66dc130eeac3456ce340fcef1
Comment 10•3 years ago
|
||
Comment 11•3 years ago
|
||
Backed out 7 changesets (bug 1719194) for Build bustages and spidermonekey failures. CLOSED TREE
Log:
https://treeherder.mozilla.org/logviewer?job_id=347155279&repo=autoland&lineNumber=14633
https://treeherder.mozilla.org/logviewer?job_id=347155277&repo=autoland&lineNumber=557
Push with failures:
https://treeherder.mozilla.org/jobs?repo=autoland&group_state=expanded&resultStatus=testfailed%2Cbusted%2Cexception&revision=70103d58923c65b2ed59ef22a17bd73a24047521
Backout:
https://hg.mozilla.org/integration/autoland/rev/4c8a25f41cb6e4db2e1693c136f483f868f77535
Comment 12•3 years ago
|
||
Assignee | ||
Updated•3 years ago
|
Comment 13•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/eef525ed6fc1
https://hg.mozilla.org/mozilla-central/rev/476682f54e5c
https://hg.mozilla.org/mozilla-central/rev/c35855c033f8
https://hg.mozilla.org/mozilla-central/rev/9af4c3626c57
https://hg.mozilla.org/mozilla-central/rev/5111a4144510
https://hg.mozilla.org/mozilla-central/rev/79f43b750dd8
https://hg.mozilla.org/mozilla-central/rev/dc6a883c1090
Description
•