Index: src/interpreter/interpreter.cc |
diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc |
index 8aea6c8209815b77e5d2d02d07d2a8600cfe5f96..284dbe34682a0c3e0f7bc8813a312ea873fb3dee 100644 |
--- a/src/interpreter/interpreter.cc |
+++ b/src/interpreter/interpreter.cc |
@@ -1791,7 +1791,8 @@ void Interpreter::DoNop(InterpreterAssembler* assembler) { __ Dispatch(); } |
// SuspendGenerator <generator> |
// |
// Exports the register file and stores it into the generator. Also stores the |
-// current context and the state given in the accumulator into the generator. |
+// current context, the state given in the accumulator, and the current bytecode |
+// offset (for debugging purposes) into the generator. |
void Interpreter::DoSuspendGenerator(InterpreterAssembler* assembler) { |
Node* generator_reg = __ BytecodeOperandReg(0); |
Node* generator = __ LoadRegister(generator_reg); |
@@ -1816,6 +1817,13 @@ void Interpreter::DoSuspendGenerator(InterpreterAssembler* assembler) { |
__ StoreObjectField(generator, JSGeneratorObject::kContextOffset, context); |
__ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, state); |
+ // The bytecode offsets here are relative to a different base than the ones |
+ // used in the source position table, hence the subtraction. |
+ Node* offset = __ SmiTag(__ IntPtrSub( |
+ __ BytecodeOffset(), |
+ __ IntPtrConstant(BytecodeArray::kHeaderSize - kHeapObjectTag))); |
+ __ StoreObjectField(generator, JSGeneratorObject::kInputOffset, offset); |
rmcilroy
2016/06/20 11:11:26
Could we just store the non-subtracted value in th
|
+ |
__ Dispatch(); |
__ Bind(&if_stepping); |