From fd2dc3acb62f1e19a306031536a99a08b5234347 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bargull?= Date: Mon, 12 Sep 2022 12:39:44 +0000 Subject: [PATCH] Bug 1781205: Move Await of AsyncGeneratorYield. r=arai Spec PR: https://github.com/tc39/ecma262/pull/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 --- js/src/frontend/BytecodeEmitter.cpp | 5 ----- js/src/tests/jstests.list | 4 ---- 2 files changed, 9 deletions(-) diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitter.cpp index b680cc3779cd63..a28931039a1717 100644 --- a/js/src/frontend/BytecodeEmitter.cpp +++ b/js/src/frontend/BytecodeEmitter.cpp @@ -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()) { @@ -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 diff --git a/js/src/tests/jstests.list b/js/src/tests/jstests.list index 3a26fc2ad7d3ff..baeadf40e47646 100644 --- a/js/src/tests/jstests.list +++ b/js/src/tests/jstests.list @@ -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