Index: src/objects.h |
diff --git a/src/objects.h b/src/objects.h |
index a7aabe23e0f856b18734e09f3fe4f40c7b4b508d..f76e1d7fb2008abd2a344bae25c19d92e0415a1b 100644 |
--- a/src/objects.h |
+++ b/src/objects.h |
@@ -7363,23 +7363,32 @@ class JSGeneratorObject: public JSObject { |
// [receiver]: The receiver of the suspended computation. |
DECL_ACCESSORS(receiver, Object) |
- // [input]: The most recent input value. |
- DECL_ACCESSORS(input, Object) |
+ // [input_or_debug_pos] |
+ // For executing generators: the most recent input value. |
+ // For suspended new-style generators: debug information (bytecode offset). |
+ // For suspended old-style generators: unused. |
+ // There is currently no need to remember the most recent input value for a |
+ // suspended generator. |
+ DECL_ACCESSORS(input_or_debug_pos, Object) |
// [resume_mode]: The most recent resume mode. |
enum ResumeMode { kNext, kReturn, kThrow }; |
DECL_INT_ACCESSORS(resume_mode) |
- // [continuation]: Offset into code of continuation. |
+ // [continuation] |
// |
- // A positive offset indicates a suspended generator. The special |
+ // A positive value indicates a suspended generator. The special |
// kGeneratorExecuting and kGeneratorClosed values indicate that a generator |
// cannot be resumed. |
inline int continuation() const; |
inline void set_continuation(int continuation); |
- inline bool is_closed(); |
- inline bool is_executing(); |
- inline bool is_suspended(); |
+ inline bool is_closed() const; |
+ inline bool is_executing() const; |
+ inline bool is_suspended() const; |
+ |
+ // For suspended generators: the source position at which the generator |
+ // is suspended. |
+ int source_position() const; |
// [operand_stack]: Saved operand stack. |
DECL_ACCESSORS(operand_stack, FixedArray) |
@@ -7397,8 +7406,8 @@ class JSGeneratorObject: public JSObject { |
static const int kFunctionOffset = JSObject::kHeaderSize; |
static const int kContextOffset = kFunctionOffset + kPointerSize; |
static const int kReceiverOffset = kContextOffset + kPointerSize; |
- static const int kInputOffset = kReceiverOffset + kPointerSize; |
- static const int kResumeModeOffset = kInputOffset + kPointerSize; |
+ static const int kInputOrDebugPosOffset = kReceiverOffset + kPointerSize; |
+ static const int kResumeModeOffset = kInputOrDebugPosOffset + kPointerSize; |
static const int kContinuationOffset = kResumeModeOffset + kPointerSize; |
static const int kOperandStackOffset = kContinuationOffset + kPointerSize; |
static const int kSize = kOperandStackOffset + kPointerSize; |