Snapshot incoming scope information for Stencil
Categories
(Core :: JavaScript Engine, task, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox78 | --- | fixed |
People
(Reporter: tcampbell, Assigned: tcampbell)
References
Details
Attachments
(7 files, 8 obsolete files)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
Things like FunctionBox::initWithEnclosingScope
read VM Scope
s directly to initialize. We should avoid the parser needing to access the VM for better isolation. It is also useful to document exactly what state is an input to parsing.
Generally this comes up for delazification and evals.
Examples:
SharedContext::computeAllowSyntax
SharedContext::computeThisBinding
SharedContext::computeInWith
BytecodeEmitter::findFieldInitializersForCall
Comment 1•4 years ago
|
||
Comment 2•4 years ago
|
||
Depends on D74907
Comment 3•4 years ago
|
||
Use initWithEnclosingScope instead. This also mirrors standAloneLazyFunction better.
Depends on D74908
Comment 4•4 years ago
|
||
Depends on D74909
Comment 5•4 years ago
|
||
Depends on D74910
Comment 6•4 years ago
|
||
Depends on D74911
Comment 7•4 years ago
|
||
This also reorganizes the ownership of ExternalContext, putting it into CompilationInfo.
A small exception being BinAST delazification, which is a bit weird.
Depends on D74912
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Assignee | ||
Comment 8•4 years ago
|
||
Assignee | ||
Updated•4 years ago
|
Updated•4 years ago
|
Assignee | ||
Comment 11•4 years ago
|
||
I've made a mess of this, but I'm going to include an alternative stack inspired heavily by what is here.
Assignee | ||
Comment 12•4 years ago
|
||
Introduce a FunctionSyntaxKind for FieldInitializer since special rules
(around arguments
) apply. At the same time we can move the flag from the
scope to the BaseScript::ImmutableFlags. This is similar to how derived
constructors are handled and makes the initWithEnclosingScope code closer to
initWithEnclosingContext.
Assignee | ||
Comment 13•4 years ago
|
||
Remove the separate needsThisTDZChecks flag and instead encode this into the
ThisBinding enum. This makes it inheritance less error-prone.
Assignee | ||
Comment 14•4 years ago
|
||
We use the (dynamic) environment chain for setting up context and for
execution, but we do not need for the compilation itself. Instead, the static
scope-chain is used as needed.
Depends on D75421
Assignee | ||
Comment 15•4 years ago
|
||
This does not change behaviour, but prepares for all of this logic to be
moved outside the parser itself.
Depends on D75454
Assignee | ||
Comment 16•4 years ago
|
||
Add FunctionFlags/FunctionSyntaxKind arguments for symmetry with
initWithEnclosingContext. Use the method in more places.
Also cleanup similar allow-syntax computation functions. We add checks for
field-initializers for consistency even though we currently don't use syntax
parsing on them.
Depends on D75455
Assignee | ||
Comment 17•4 years ago
|
||
This is used to compute a new ScopeContext struct that captures information
about the scope/environment chain. This reduces the need for parser to access
the VM directly.
Depends on D75456
Assignee | ||
Comment 18•4 years ago
|
||
The CompilationInfo now shapshots the required information so that the BCE
does not need to read scope chains from the VM. This is used by the unusual
edge cases such as:
class C {}
class D extends C {
field1 = 1;
constructor() {
eval("super()");
}
}
This also cleans up the traversal to stop at any non-arrow non-constructor
function on the chain since they would not have been allowed to make a
super() call and require field info.
Depends on D75457
Comment 19•4 years ago
|
||
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Comment 20•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/decc13d5e097
https://hg.mozilla.org/mozilla-central/rev/4d2ccab906d1
https://hg.mozilla.org/mozilla-central/rev/b4268209648b
https://hg.mozilla.org/mozilla-central/rev/5d4168c00031
https://hg.mozilla.org/mozilla-central/rev/5dd4887b25a7
https://hg.mozilla.org/mozilla-central/rev/a16d2c3fe7e5
https://hg.mozilla.org/mozilla-central/rev/0514a40bd588
Updated•4 years ago
|
Description
•