Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index 5cde67d7e97e17560c8e22553a0909eb20f38532..bffe4144d791b5e7bab0ffa78df44e4f9543f754 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -653,6 +653,7 @@ TYPE_CHECKER(Code, CODE_TYPE) |
TYPE_CHECKER(Oddball, ODDBALL_TYPE) |
TYPE_CHECKER(JSGlobalPropertyCell, JS_GLOBAL_PROPERTY_CELL_TYPE) |
TYPE_CHECKER(SharedFunctionInfo, SHARED_FUNCTION_INFO_TYPE) |
+TYPE_CHECKER(JSGeneratorObject, JS_GENERATOR_OBJECT_TYPE) |
TYPE_CHECKER(JSModule, JS_MODULE_TYPE) |
TYPE_CHECKER(JSValue, JS_VALUE_TYPE) |
TYPE_CHECKER(JSDate, JS_DATE_TYPE) |
@@ -1584,6 +1585,8 @@ int JSObject::GetHeaderSize() { |
// field operations considerably on average. |
if (type == JS_OBJECT_TYPE) return JSObject::kHeaderSize; |
switch (type) { |
+ case JS_GENERATOR_OBJECT_TYPE: |
+ return JSGeneratorObject::kSize; |
case JS_MODULE_TYPE: |
return JSModule::kSize; |
case JS_GLOBAL_PROXY_TYPE: |
@@ -5010,6 +5013,19 @@ void Foreign::set_foreign_address(Address value) { |
} |
+ACCESSORS(JSGeneratorObject, function, JSFunction, kFunctionOffset) |
+ACCESSORS(JSGeneratorObject, context, Object, kContextOffset) |
+SMI_ACCESSORS(JSGeneratorObject, continuation, kContinuationOffset) |
+ACCESSORS(JSGeneratorObject, operand_stack, FixedArray, kOperandStackOffset) |
+ |
+ |
+JSGeneratorObject* JSGeneratorObject::cast(Object* obj) { |
+ ASSERT(obj->IsJSGeneratorObject()); |
+ ASSERT(HeapObject::cast(obj)->Size() == JSGeneratorObject::kSize); |
+ return reinterpret_cast<JSGeneratorObject*>(obj); |
+} |
+ |
+ |
ACCESSORS(JSModule, context, Object, kContextOffset) |
ACCESSORS(JSModule, scope_info, ScopeInfo, kScopeInfoOffset) |