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: |