Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index 841fcbc0f335d12d4f97d0cd45cd0c2673acf59a..e1d25f82c72a072f410acf2ce97215878e69f0f2 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -446,9 +446,27 @@ Failure* Failure::cast(MaybeObject* obj) { |
} |
+bool Object::IsJSReceiver() { |
+ return IsHeapObject() && |
+ HeapObject::cast(this)->map()->instance_type() >= FIRST_JS_RECEIVER_TYPE; |
+} |
+ |
+ |
bool Object::IsJSObject() { |
- return IsHeapObject() |
- && HeapObject::cast(this)->map()->instance_type() >= FIRST_JS_OBJECT_TYPE; |
+ return IsJSReceiver() && !IsJSProxy(); |
+} |
+ |
+ |
+bool Object::IsJSProxy() { |
+ return Object::IsHeapObject() && |
+ (HeapObject::cast(this)->map()->instance_type() == JS_PROXY_TYPE || |
+ HeapObject::cast(this)->map()->instance_type() == JS_FUNCTION_PROXY_TYPE); |
+} |
+ |
+ |
+bool Object::IsJSFunctionProxy() { |
+ return Object::IsHeapObject() && |
+ HeapObject::cast(this)->map()->instance_type() == JS_FUNCTION_PROXY_TYPE; |
} |
@@ -584,12 +602,6 @@ bool Object::IsStringWrapper() { |
} |
-bool Object::IsJSProxy() { |
- return Object::IsHeapObject() |
- && HeapObject::cast(this)->map()->instance_type() == JS_PROXY_TYPE; |
-} |
- |
- |
bool Object::IsForeign() { |
return Object::IsHeapObject() |
&& HeapObject::cast(this)->map()->instance_type() == FOREIGN_TYPE; |
@@ -1888,6 +1900,7 @@ CAST_ACCESSOR(ConsString) |
CAST_ACCESSOR(ExternalString) |
CAST_ACCESSOR(ExternalAsciiString) |
CAST_ACCESSOR(ExternalTwoByteString) |
+CAST_ACCESSOR(JSReceiver) |
CAST_ACCESSOR(JSObject) |
CAST_ACCESSOR(Smi) |
CAST_ACCESSOR(HeapObject) |
@@ -1905,6 +1918,7 @@ CAST_ACCESSOR(Code) |
CAST_ACCESSOR(JSArray) |
CAST_ACCESSOR(JSRegExp) |
CAST_ACCESSOR(JSProxy) |
+CAST_ACCESSOR(JSFunctionProxy) |
CAST_ACCESSOR(Foreign) |
CAST_ACCESSOR(ByteArray) |
CAST_ACCESSOR(ExternalArray) |
@@ -3916,12 +3930,12 @@ bool String::AsArrayIndex(uint32_t* index) { |
} |
-Object* JSObject::GetPrototype() { |
- return JSObject::cast(this)->map()->prototype(); |
+Object* JSReceiver::GetPrototype() { |
+ return HeapObject::cast(this)->map()->prototype(); |
} |
-PropertyAttributes JSObject::GetPropertyAttribute(String* key) { |
+PropertyAttributes JSReceiver::GetPropertyAttribute(String* key) { |
return GetPropertyAttributeWithReceiver(this, key); |
} |