Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(256)

Unified Diff: src/interpreter/bytecode-generator.cc

Issue 2936813002: Move closing of generators upon final return to the generator-resume builtin. (Closed)
Patch Set: Fix comments Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/interpreter/bytecode-generator.cc
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc
index a011ead6433489d02aa8a8e5e3ec93655ba64c01..fa685f62466f0aeee9cb47ffcf0091f01d18ec20 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -2249,8 +2249,10 @@ void BytecodeGenerator::BuildReturn() {
if (info()->literal()->feedback_vector_spec()->HasTypeProfileSlot()) {
builder()->CollectTypeProfile(info()->literal()->return_position());
}
- if (IsGeneratorFunction(info()->literal()->kind())) {
- // Mark the generator as closed if returning from a generator function.
+ if (IsAsyncGeneratorFunction(info()->literal()->kind())) {
+ // Mark the generator as closed if returning from an async generator
+ // function. Note that non-async generators are closed by the
+ // generator-resume builtin.
RegisterAllocationScope register_scope(this);
Register result = register_allocator()->NewRegister();
builder()

Powered by Google App Engine
This is Rietveld 408576698