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

Unified Diff: src/objects.h

Issue 2079613003: [generators] Implement %GeneratorGetSourcePosition. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: enable test 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
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index a7aabe23e0f856b18734e09f3fe4f40c7b4b508d..0e00d0d1c4c352bf973de60efef21bf7a576ff9b 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -7363,23 +7363,29 @@ class JSGeneratorObject: public JSObject {
// [receiver]: The receiver of the suspended computation.
DECL_ACCESSORS(receiver, Object)
- // [input]: The most recent input value.
+ // [input]: For active generators: the most recent input value.
+ // (For suspended new-style generators, we abuse this field to store debug
+ // information.)
DECL_ACCESSORS(input, 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)

Powered by Google App Engine
This is Rietveld 408576698