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. |