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

Unified Diff: src/objects.h

Issue 2079613003: [generators] Implement %GeneratorGetSourcePosition. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rename again, and move subtraction to runtime Created 4 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/mips64/builtins-mips64.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « src/mips64/builtins-mips64.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698