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

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

Issue 2936813002: Move closing of generators upon final return to the generator-resume builtin. (Closed)
Patch Set: Add TODO 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
« no previous file with comments | « src/builtins/builtins-generator-gen.cc ('k') | src/parsing/rewriter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-generator.cc
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc
index a011ead6433489d02aa8a8e5e3ec93655ba64c01..706d17b65e059890c93344785ccbb6a1612cf9ea 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -2249,8 +2249,13 @@ 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.
+
+ // TODO(jarin,caitp) Move the async generator closing to the resume
+ // builtin.
RegisterAllocationScope register_scope(this);
Register result = register_allocator()->NewRegister();
builder()
« no previous file with comments | « src/builtins/builtins-generator-gen.cc ('k') | src/parsing/rewriter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698