Closed Bug 1916260 Opened 1 year ago Closed 1 year ago

Allow [[ReferencedName]] in Reference Records to be a not-yet-resolved property key

Categories

(Core :: JavaScript Engine, task, P2)

task

Tracking

()

RESOLVED FIXED
132 Branch
Tracking Status
firefox132 --- fixed

People

(Reporter: anba, Assigned: anba)

References

(Blocks 1 open bug)

Details

Attachments

(9 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

Implement the changes from https://github.com/tc39/ecma262/pull/3307.

Duplicate of this bug: 1407587

The spec PR reordered when ToPropertyKey is evaluated. For the delete super
case the ToPropertKey evaluation doesn't happen anymore at all. See [1], step 4.

[1] https://tc39.es/ecma262/#sec-delete-operator-runtime-semantics-evaluation

emitObjAndKey is only called from emitElemObjAndKey. Let's merge both methods.

Reduce code duplicate in emitElemObjAndKey. Also aligns with similar code
elsewhere in BytecodeEmitter, search for callers to emitGetThisForSuperBase.

emitElemObjAndKey performs the exact same sequence of steps, so there's no
reason not to call it here.

prepareForObj only updates PropOpEmitter::state_, so there's no good reason
to omit calling it for the super case.

The spec PR reordered the ToPropertyKey call to happen in GetValue resp.
PutValue, which means it has to happen after GetSuperBase.

Tests are included in https://github.com/tc39/test262/pull/4216.

Computed property names are evaluated first in destructuring contexts.

BytecodeEmitter::emitDestructuringLHSRef needs to call NameOpEmitter::prepareForRhs
to emit the necessary steps to resolve environment bindings. To avoid adding a new
skipPrepareForRhs method to NameOpEmitter, instead pass DestructuringLHSRef&
to emitDestructuringLHSRef, where DestructuringLHSRef holds the emitter for the
destructuring left-hand side reference.

There's always only exactly one emitter instantiated, so using mozilla::MaybeOneOf
seems preferable, except that mozilla::MaybeOneOf only allows two possible states.
Add the new class MaybeOneOfMany to use composition to allow having more than two
states.

Tests are in https://github.com/tc39/test262/pull/4216.

Severity: -- → N/A
Priority: -- → P2
Pushed by andre.bargull@gmail.com: https://hg.mozilla.org/integration/autoland/rev/292abbffea7e Part 1: Stop calling ToPropertyKey when deleting super-references. r=spidermonkey-reviewers,jandem https://hg.mozilla.org/integration/autoland/rev/d6d90dea20a9 Part 2: Merge emitElemObjAndKey and emitObjAndKey. r=spidermonkey-reviewers,jandem https://hg.mozilla.org/integration/autoland/rev/d3da96a0aafc Part 3: Remove duplicate code in emitElemObjAndKey. r=spidermonkey-reviewers,jandem https://hg.mozilla.org/integration/autoland/rev/6de1d42ebded Part 4: Call emitElemObjAndKey in emitDeleteElement. r=spidermonkey-reviewers,jandem https://hg.mozilla.org/integration/autoland/rev/e85c796e7639 Part 5: Call prepareForObj when deleting super-property references. r=spidermonkey-reviewers,jandem https://hg.mozilla.org/integration/autoland/rev/c4fbbb9b19cc Part 6: Evaluate SuperBase before ToPropertyKey. r=spidermonkey-reviewers,jandem https://hg.mozilla.org/integration/autoland/rev/8fb9d79cf4a2 Part 7: Remove test exclusions for deleted tests. r=spidermonkey-reviewers,jandem https://hg.mozilla.org/integration/autoland/rev/023672c91d48 Part 8: Evaluate ComputedPropertyName first. r=spidermonkey-reviewers,jandem https://hg.mozilla.org/integration/autoland/rev/5a9e48dab16e Part 9: Resolve binding in destructuring before retrieving destructured element. r=arai

Thanks, looks like it's just missing an #include. I'll take a look.

Flags: needinfo?(andrebargull)
Pushed by andre.bargull@gmail.com: https://hg.mozilla.org/integration/autoland/rev/d20c97df0b86 Part 1: Stop calling ToPropertyKey when deleting super-references. r=spidermonkey-reviewers,jandem https://hg.mozilla.org/integration/autoland/rev/6c64397920b4 Part 2: Merge emitElemObjAndKey and emitObjAndKey. r=spidermonkey-reviewers,jandem https://hg.mozilla.org/integration/autoland/rev/73ef1798d76b Part 3: Remove duplicate code in emitElemObjAndKey. r=spidermonkey-reviewers,jandem https://hg.mozilla.org/integration/autoland/rev/d98e8d9afe8e Part 4: Call emitElemObjAndKey in emitDeleteElement. r=spidermonkey-reviewers,jandem https://hg.mozilla.org/integration/autoland/rev/edc63c19288f Part 5: Call prepareForObj when deleting super-property references. r=spidermonkey-reviewers,jandem https://hg.mozilla.org/integration/autoland/rev/e7e456e896ff Part 6: Evaluate SuperBase before ToPropertyKey. r=spidermonkey-reviewers,jandem https://hg.mozilla.org/integration/autoland/rev/99ff134cb9e0 Part 7: Remove test exclusions for deleted tests. r=spidermonkey-reviewers,jandem https://hg.mozilla.org/integration/autoland/rev/50af3f905683 Part 8: Evaluate ComputedPropertyName first. r=spidermonkey-reviewers,jandem https://hg.mozilla.org/integration/autoland/rev/4c26da6ff326 Part 9: Resolve binding in destructuring before retrieving destructured element. r=arai
Regressions: 1917214
No longer regressions: 1917214
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: