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

Unified Diff: src/objects.h

Issue 13542002: Calling a generator function returns a generator object (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Link generator iterator definitions and uses through local variable Created 7 years, 9 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/heap.cc ('k') | src/objects.cc » ('j') | src/objects.cc » ('J')
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 f8afdbcc79572899f249f5abb708d2f096ec3f42..cdbb0b90a6d3e7810d6d6dc07097c86a1ae192cd 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -62,6 +62,7 @@
// - JSWeakMap
// - JSRegExp
// - JSFunction
+// - JSGeneratorIterator
Michael Starzinger 2013/04/08 13:14:05 As discussed offline, the name "JSGeneratorIterato
// - JSModule
// - GlobalObject
// - JSGlobalObject
@@ -395,6 +396,7 @@ const int kStubMinorKeyBits = kBitsPerInt - kSmiTagSize - kStubMajorKeyBits;
V(JS_DATE_TYPE) \
V(JS_OBJECT_TYPE) \
V(JS_CONTEXT_EXTENSION_OBJECT_TYPE) \
+ V(JS_GENERATOR_ITERATOR_TYPE) \
V(JS_MODULE_TYPE) \
V(JS_GLOBAL_OBJECT_TYPE) \
V(JS_BUILTINS_OBJECT_TYPE) \
@@ -726,6 +728,7 @@ enum InstanceType {
JS_DATE_TYPE,
JS_OBJECT_TYPE,
JS_CONTEXT_EXTENSION_OBJECT_TYPE,
+ JS_GENERATOR_ITERATOR_TYPE,
JS_MODULE_TYPE,
JS_GLOBAL_OBJECT_TYPE,
JS_BUILTINS_OBJECT_TYPE,
@@ -953,6 +956,7 @@ class MaybeObject BASE_EMBEDDED {
V(JSReceiver) \
V(JSObject) \
V(JSContextExtensionObject) \
+ V(JSGeneratorIterator) \
V(JSModule) \
V(Map) \
V(DescriptorArray) \
@@ -6238,6 +6242,41 @@ class SharedFunctionInfo: public HeapObject {
};
+// Representation for generator iterators.
+class JSGeneratorIterator: public JSObject {
+ public:
+ // [function]: The function corresponding to this iterator.
+ DECL_ACCESSORS(function, JSFunction)
+
+ // [context]: The context of the suspended computation, or Smi 0.
+ DECL_ACCESSORS(context, Object)
+
+ // [continuation]: Offset into code of continuation.
+ inline int continuation();
+ inline void set_continuation(int continuation);
+
+ // [operands]: Saved operand stack: FixedArray or Smi 0.
+ DECL_ACCESSORS(operand_stack, Object)
+
+ // Casting.
+ static inline JSGeneratorIterator* cast(Object* obj);
+
+ // Dispatched behavior.
+ DECLARE_PRINTER(JSGeneratorIterator)
+ DECLARE_VERIFIER(JSGeneratorIterator)
+
+ // Layout description.
+ static const int kFunctionOffset = JSObject::kHeaderSize;
+ static const int kContextOffset = kFunctionOffset + kPointerSize;
+ static const int kContinuationOffset = kContextOffset + kPointerSize;
+ static const int kOperandStackOffset = kContinuationOffset + kPointerSize;
+ static const int kSize = kOperandStackOffset + kPointerSize;
+
+ private:
+ DISALLOW_IMPLICIT_CONSTRUCTORS(JSGeneratorIterator);
+};
+
+
// Representation for module instance objects.
class JSModule: public JSObject {
public:
« no previous file with comments | « src/heap.cc ('k') | src/objects.cc » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698