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

Unified Diff: src/builtins.cc

Issue 1884183002: First version of the new generators implementation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 8 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/builtins.cc
diff --git a/src/builtins.cc b/src/builtins.cc
index 760bb8e786b38e4c88809900efded5238c72d60f..9ca0f0f306a0eb394fa7cb8e8346cca6bc61cc65 100644
--- a/src/builtins.cc
+++ b/src/builtins.cc
@@ -2329,7 +2329,8 @@ void Generate_GeneratorPrototypeResume(
Node* receiver = assembler->Parameter(0);
Node* value = assembler->Parameter(1);
Node* context = assembler->Parameter(4);
- Node* zero = assembler->SmiConstant(Smi::FromInt(0));
+ Node* closed = assembler->SmiConstant(
+ Smi::FromInt(JSGeneratorObject::kGeneratorClosed));
// Check if the {receiver} is actually a JSGeneratorObject.
Label if_receiverisincompatible(assembler, Label::kDeferred);
@@ -2345,9 +2346,11 @@ void Generate_GeneratorPrototypeResume(
receiver, JSGeneratorObject::kContinuationOffset);
Label if_receiverisclosed(assembler, Label::kDeferred),
if_receiverisrunning(assembler, Label::kDeferred);
- assembler->GotoIf(assembler->SmiEqual(receiver_continuation, zero),
+ assembler->GotoIf(assembler->SmiEqual(receiver_continuation, closed),
&if_receiverisclosed);
- assembler->GotoIf(assembler->SmiLessThan(receiver_continuation, zero),
+ DCHECK_LT(JSGeneratorObject::kGeneratorExecuting,
+ JSGeneratorObject::kGeneratorClosed);
+ assembler->GotoIf(assembler->SmiLessThan(receiver_continuation, closed),
&if_receiverisrunning);
// Resume the {receiver} using our trampoline.

Powered by Google App Engine
This is Rietveld 408576698