Closed Bug 1655052 Opened 4 years ago Closed 4 years ago

Remove AbstractScopePtrIter

Categories

(Core :: JavaScript Engine, task, P2)

task

Tracking

()

RESOLVED FIXED
86 Branch
Tracking Status
firefox86 --- fixed

People

(Reporter: tcampbell, Assigned: tcampbell)

References

(Blocks 1 open bug)

Details

Attachments

(6 files)

This was a transition step to getting the parser gc-free. We instead should snapshot what external information we need in ScopeContext.

In particular, the remaining uses are:

  • BytecodeEmitter::emitThisEnvironmentCallee
    • This is only used by derived constructors
    • We should be able to just record the hop count
  • LexicalScope::nextFrameSlot
  • This is only needed for concrete js::Scope, outside of asserts.

The other upside of this is removing the isArrow field from ScopeCreationData.

Blocks: 1653248
Severity: -- → N/A
Blocks: stencil-backlog
No longer blocks: 1544117

The emitThisEnvironmentCallee helper is used when handling certain 'super'
operations. If the current scope is an eval or arrow, we instead use the
callee of the enclosing environment chain. When this is a case, the Parser
must already have marked the appropriate 'this' as closed-over and we can
simply assert that the scope has an environment.

To avoid walking the enclosing scope chain while parsing, compute the number
of hops between enclosing scope and the effective callee's scope. This is
used if there are 'super' references within an arrow or eval script.

Depends on D100814

Depends on D100815

Instead of traversing the scope chain several times, combine some of the
traversals to simplify code. Certain behaviours use the debugger-eval
effective scope, while others ignore it. This patch does not change any of
the current semantics.

Depends on D100814

Instead of generating bogus values inspecting the scope chain when the script
will provide a this-environment, we leave at default based on if the
InheritThis flag is passed. This is used for arrow-function and evals (as the
spec requires).

Depends on D100847

Attachment #9195474 - Attachment description: Bug 1655052 - Track enclosingCalleeHops in ScopeContext → Bug 1655052 - Add ScopeContext::enclosingThisEnvironmentHops
Attachment #9195473 - Attachment description: Bug 1655052 - Simplify BytecodeEmitter::emitThisEnvironmentCallee → Bug 1655052 - Simplify BytecodeEmitter::emitThisEnvironmentCallee. r?arai!
Attachment #9195535 - Attachment description: Bug 1655052 - Refactor js::frontend::ScopeContext → Bug 1655052 - Refactor js::frontend::ScopeContext. r?arai!
Attachment #9195536 - Attachment description: Bug 1655052 - ScopeContext now only checks this-env when it will be used → Bug 1655052 - ScopeContext now only checks this-env when it will be used. r?arai!
Attachment #9195474 - Attachment description: Bug 1655052 - Add ScopeContext::enclosingThisEnvironmentHops → Bug 1655052 - Add ScopeContext::enclosingThisEnvironmentHops. r?arai!
Attachment #9195475 - Attachment description: Bug 1655052 - Remove AbstractScopePtrIter → Bug 1655052 - Remove AbstractScopePtrIter. r?arai!
Attachment #9195476 - Attachment description: Bug 1655052 - Remove AbstractScopePtr::nextFrameSlot → Bug 1655052 - Remove AbstractScopePtr::nextFrameSlot. r?arai!
Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/374aebc92cc2 Simplify BytecodeEmitter::emitThisEnvironmentCallee. r=arai https://hg.mozilla.org/integration/autoland/rev/c3dcadf05381 Refactor js::frontend::ScopeContext. r=arai https://hg.mozilla.org/integration/autoland/rev/fd6f6cc20a90 ScopeContext now only checks this-env when it will be used. r=arai https://hg.mozilla.org/integration/autoland/rev/fad29724ccd6 Add ScopeContext::enclosingThisEnvironmentHops. r=arai https://hg.mozilla.org/integration/autoland/rev/b539cd841c63 Remove AbstractScopePtrIter. r=arai https://hg.mozilla.org/integration/autoland/rev/0a841c531e0d Remove AbstractScopePtr::nextFrameSlot. r=arai
Backout by smolnar@mozilla.com: https://hg.mozilla.org/mozilla-central/rev/855ec176a3c2 Backed out 6 changesets for xpcshell failures at test_protocol_children.js. CLOSED TREE

Updated patches, added tests and requested re-review.

Flags: needinfo?(tcampbell)
Pushed by tcampbell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d6d38173b994 Simplify BytecodeEmitter::emitThisEnvironmentCallee. r=arai https://hg.mozilla.org/integration/autoland/rev/dca3555f3a33 Refactor js::frontend::ScopeContext. r=arai https://hg.mozilla.org/integration/autoland/rev/154dd55151c3 ScopeContext now only checks this-env when it will be used. r=arai https://hg.mozilla.org/integration/autoland/rev/b39d8a74ce2d Add ScopeContext::enclosingThisEnvironmentHops. r=arai https://hg.mozilla.org/integration/autoland/rev/ee4580ef371c Remove AbstractScopePtrIter. r=arai https://hg.mozilla.org/integration/autoland/rev/eb94385e9c80 Remove AbstractScopePtr::nextFrameSlot. r=arai
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: