Skip to content

Commit

Permalink
Bug 1781205: Move Await of AsyncGeneratorYield. r=arai
Browse files Browse the repository at this point in the history
Spec PR: tc39/ecma262#2819

The PR moves the `Await` operation of out `AsyncGeneratorYield` and instead
executes it before calling `AsyncGeneratorYield` from `Yield`.

`BytecodeEmitter::emitYieldStar()` has an inlined implementation of the
`AsyncGeneratorYield` operation. Removing the call to `emitAwaitInInnermostScope()`
is equivalent to removing the `Await` operation in `AsyncGeneratorYield`.

And in `BytecodeEmitter::emitYield()` we only need to remove the comment
explaining why we call `emitAwaitInInnermostScope()`, because executing `Await`
is now part of the normal evaluation of the `Yield` expression and no longer
happens in `AsyncGeneratorYield`.

Differential Revision: https://phabricator.services.mozilla.com/D156933
  • Loading branch information
anba committed Sep 12, 2022
1 parent 213c965 commit fd2dc3a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
5 changes: 0 additions & 5 deletions js/src/frontend/BytecodeEmitter.cpp
Expand Up @@ -6174,7 +6174,6 @@ bool BytecodeEmitter::emitYield(UnaryNode* yieldNode) {
}
}

// 25.5.3.7 AsyncGeneratorYield step 5.
if (sc->asSuspendableContext()->isAsync()) {
MOZ_ASSERT(!needsIteratorResult);
if (!emitAwaitInInnermostScope()) {
Expand Down Expand Up @@ -6720,10 +6719,6 @@ bool BytecodeEmitter::emitYieldStar(ParseNode* iter) {
// [stack] NEXT ITER RESULT
return false;
}
if (!emitAwaitInInnermostScope()) {
// [stack] NEXT ITER RESULT
return false;
}
}
if (!emitGetDotGeneratorInInnermostScope()) {
// [stack] NEXT ITER RESULT GENOBJ
Expand Down
4 changes: 0 additions & 4 deletions js/src/tests/jstests.list
Expand Up @@ -609,10 +609,6 @@ skip script test262/built-ins/AsyncGeneratorPrototype/return/return-state-comple
skip script test262/built-ins/AsyncGeneratorPrototype/return/return-suspendedStart-broken-promise.js
skip script test262/built-ins/AsyncGeneratorPrototype/return/return-suspendedYield-broken-promise-try-catch.js

# https://bugzilla.mozilla.org/show_bug.cgi?id=1781205
skip script test262/language/statements/async-generator/yield-star-return-then-getter-ticks.js
skip script test262/language/statements/async-generator/yield-star-promise-not-unwrapped.js

# https://github.com/tc39/proposal-intl-numberformat-v3/pull/107
skip script test262/intl402/NumberFormat/test-option-useGrouping.js

Expand Down

0 comments on commit fd2dc3a

Please sign in to comment.