Index: src/objects-inl.h |
=================================================================== |
--- src/objects-inl.h (revision 539) |
+++ src/objects-inl.h (working copy) |
@@ -359,23 +359,25 @@ |
} |
+bool Object::IsJSGlobalProxy() { |
+ bool result = IsHeapObject() && |
+ (HeapObject::cast(this)->map()->instance_type() == |
+ JS_GLOBAL_PROXY_TYPE); |
+ ASSERT(!result || IsAccessCheckNeeded()); |
+ return result; |
+} |
+ |
+ |
bool Object::IsGlobalObject() { |
- return IsHeapObject() && |
- ((HeapObject::cast(this)->map()->instance_type() == |
- JS_GLOBAL_OBJECT_TYPE) || |
- (HeapObject::cast(this)->map()->instance_type() == |
- JS_BUILTINS_OBJECT_TYPE)); |
+ if (!IsHeapObject()) return false; |
+ |
+ InstanceType type = HeapObject::cast(this)->map()->instance_type(); |
+ return type == JS_GLOBAL_OBJECT_TYPE || |
+ type == JS_BUILTINS_OBJECT_TYPE; |
} |
bool Object::IsJSGlobalObject() { |
-#ifdef DEBUG |
- if (IsHeapObject() && |
- (HeapObject::cast(this)->map()->instance_type() == |
- JS_GLOBAL_OBJECT_TYPE)) { |
- ASSERT(IsAccessCheckNeeded()); |
- } |
-#endif |
return IsHeapObject() && |
(HeapObject::cast(this)->map()->instance_type() == |
JS_GLOBAL_OBJECT_TYPE); |
@@ -397,7 +399,7 @@ |
bool Object::IsAccessCheckNeeded() { |
return IsHeapObject() |
- && HeapObject::cast(this)->map()->needs_access_check(); |
+ && HeapObject::cast(this)->map()->is_access_check_needed(); |
} |
@@ -856,7 +858,7 @@ |
ACCESSORS(JSObject, properties, FixedArray, kPropertiesOffset) |
-ACCESSORS(JSObject, elements, HeapObject, kElementsOffset) |
+ACCESSORS(JSObject, elements, FixedArray, kElementsOffset) |
void JSObject::initialize_properties() { |
@@ -877,6 +879,8 @@ |
int JSObject::GetHeaderSize() { |
switch (map()->instance_type()) { |
+ case JS_GLOBAL_PROXY_TYPE: |
+ return JSGlobalProxy::kSize; |
case JS_GLOBAL_OBJECT_TYPE: |
return JSGlobalObject::kSize; |
case JS_BUILTINS_OBJECT_TYPE: |
@@ -1202,6 +1206,7 @@ |
CAST_ACCESSOR(SharedFunctionInfo) |
CAST_ACCESSOR(Map) |
CAST_ACCESSOR(JSFunction) |
+CAST_ACCESSOR(JSGlobalProxy) |
CAST_ACCESSOR(JSGlobalObject) |
CAST_ACCESSOR(JSBuiltinsObject) |
CAST_ACCESSOR(Code) |
@@ -1796,8 +1801,9 @@ |
ACCESSORS(GlobalObject, builtins, JSBuiltinsObject, kBuiltinsOffset) |
ACCESSORS(GlobalObject, global_context, Context, kGlobalContextOffset) |
+ACCESSORS(GlobalObject, global_receiver, JSObject, kGlobalReceiverOffset) |
-ACCESSORS(JSGlobalObject, security_token, Object, kSecurityTokenOffset) |
+ACCESSORS(JSGlobalProxy, context, Object, kContextOffset) |
ACCESSORS(AccessorInfo, getter, Object, kGetterOffset) |
ACCESSORS(AccessorInfo, setter, Object, kSetterOffset) |