Make CompilationInput work with Stencils Scope/Script in addition of Scope/BaseScript pointers.
Categories
(Core :: JavaScript Engine, task, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox96 | --- | fixed |
People
(Reporter: nbp, Assigned: nbp)
References
Details
Attachments
(13 files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review |
Bug 1718102 and follow-up made it possible to abstract the nature of the GC object content of CompilationInput, this bug is about abstracting the inner parts to manipulate Scope and Script the same way independently of how they are represented.
To make it possible to create Stencil-based compilation, we should wrap the Scope/BaseScript pointer behind an interface which can also be used to manipulate ScopeStencil and ScriptData content from the Stencil used to provide contextual information.
| Assignee | ||
Comment 1•5 years ago
|
||
In order to make CompilationInput accept Stencil instead of GC objects as
inputs, we have to create structure which are able to abstract over the GC Scope
pointer, the BaseScript pointer, and the manipulation of the the scopes.
This patch adds the structures used in all follow-up patches from Bug 1730881
which are implementing all the accessors necessary to make it possible to later
initialize a CompilationInput with a Stencil.
Stencil references are abstracted using a ScopeStencilRef /
ScriptStencilRef, to capture the CompilationStencil input and the index
which is a reference to an element within the CompilationStencil. These
structures are made to avoid accidental missuse of indexes with the wrong
stencil.
InputScope / InputScript are variants over the pointer to the GC object and
the equivalent Stencil reference. They are used to provide a common interface to
interpret GC / Stencil data.
| Assignee | ||
Comment 2•5 years ago
|
||
This patchs adds an InputName structure. This structure is used to represent
names held by the GC or another Stencil, and isolate these names such that they
are properly interned before being used in the CompilationState of the existing
compilation.
InputName is a variant over a JSAtom* or a NameStencilRef. The NameStencilRef is
a TaggedParserAtomIndex from a CompilationStencil given as context.
A function is added as part of the ParserAtomsTable, such that
TaggedParserAtomIndex from another compilation can be interned as well. For
encoding where the atom is represented by the tag it-self, this is a no-op,
whereas for larger atoms, these have to be registered in the table. Identically,
another function is added to compare an InputName with an internalized name,
which would be necessary to convert ScopeContext::searchInEnclosingScope.
ParserBindingIter are updated to be initialized with a ScopeStencilRef, in a
similar way as already done with Scope*.
BindingIter and ParserBindingIter creation are wrapped behind the local
InputBindingIter function, used to return one or the other based on the input
type. Identically, InputName can be constructed from a scope and its matching
name type. These would be handy to convert ScopeContext methods to
InputScopeIter, while maintaining a single implementation of the binding
traversal, which would dispatch to one variant or the other based on the type of
the scope.
| Assignee | ||
Comment 3•5 years ago
|
||
| Assignee | ||
Comment 4•5 years ago
|
||
| Assignee | ||
Comment 5•5 years ago
|
||
| Assignee | ||
Comment 6•5 years ago
|
||
| Assignee | ||
Comment 7•5 years ago
|
||
| Assignee | ||
Comment 8•5 years ago
|
||
| Assignee | ||
Comment 9•5 years ago
|
||
| Assignee | ||
Comment 10•5 years ago
|
||
| Assignee | ||
Comment 11•5 years ago
|
||
| Assignee | ||
Comment 12•5 years ago
|
||
| Assignee | ||
Comment 13•4 years ago
|
||
This change clone some of the functions used to initialize the
CompilationSyntaxParseCache. These are specialized to copy the minimal set of
information needed for skipping inner functions and for iterating over
closed-over-bindings.
Unforutnately, as opposed to what this structure was initialy designed for, we
are not yet able to reuse the Stencils from the InputScript as ParseAtomIndex of
the InputScript are in the context of the InputScript and not of the
CompilationState which wraps the CompilationSyntaxParseCache. Until we are
capable of reusing the same indexes of a previous compilation, we would have to
duplicate the Stencil structures. Thus, copyScriptInfo and
copyClosedOVerBindings are copied from the original functions and adapted to
work with Stencil inputs.
Comment 14•4 years ago
|
||
Comment 15•4 years ago
|
||
| bugherder | ||
Updated•4 years ago
|
Updated•4 years ago
|
| Assignee | ||
Comment 16•4 years ago
|
||
Ok, so this bug has to remain open as Lando UI made me push a single patch and not the full stack of patches.
Comment 17•4 years ago
|
||
Comment 18•4 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/0c9b8c05685d
https://hg.mozilla.org/mozilla-central/rev/0235ef89cab9
https://hg.mozilla.org/mozilla-central/rev/161a84941ce1
https://hg.mozilla.org/mozilla-central/rev/9d10b14da8b7
https://hg.mozilla.org/mozilla-central/rev/a757662f09f2
https://hg.mozilla.org/mozilla-central/rev/ef3bf6168dc8
https://hg.mozilla.org/mozilla-central/rev/df21b41504c7
https://hg.mozilla.org/mozilla-central/rev/43f36034758d
https://hg.mozilla.org/mozilla-central/rev/47de8a20be39
https://hg.mozilla.org/mozilla-central/rev/479cda0e29bc
https://hg.mozilla.org/mozilla-central/rev/725958cae25f
https://hg.mozilla.org/mozilla-central/rev/e304b65e2e22
| Assignee | ||
Updated•4 years ago
|
Description
•