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

Unified Diff: src/objects.h

Issue 13704010: Generator objects can suspend (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Use sentinel values for continuations Created 7 years, 8 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/ia32/full-codegen-ia32.cc ('k') | src/objects-inl.h » ('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 d20eba58fc91117e4bac2bd39898905b1c25cd3c..4bc2009d0a372c3b229ef8b27fe8414eba69cfb7 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -6264,10 +6264,14 @@ class JSGeneratorObject: public JSObject {
// [function]: The function corresponding to this generator object.
DECL_ACCESSORS(function, JSFunction)
- // [context]: The context of the suspended computation, or undefined.
- DECL_ACCESSORS(context, Object)
+ // [context]: The context of the suspended computation.
+ DECL_ACCESSORS(context, Context)
// [continuation]: Offset into code of continuation.
+ //
+ // A positive offset indicates a suspended generator. The special
+ // kGeneratorExecuting and kGeneratorClosed values indicate that a generator
+ // cannot be resumed.
inline int continuation();
inline void set_continuation(int continuation);
@@ -6281,6 +6285,10 @@ class JSGeneratorObject: public JSObject {
DECLARE_PRINTER(JSGeneratorObject)
DECLARE_VERIFIER(JSGeneratorObject)
+ // Magic sentinel values for the continuation.
+ static const int kGeneratorExecuting = -1;
+ static const int kGeneratorClosed = 0;
+
// Layout description.
static const int kFunctionOffset = JSObject::kHeaderSize;
static const int kContextOffset = kFunctionOffset + kPointerSize;
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698