Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index bb24a2f8544ef73e069031be3bd38c0ed6315855..81886e07424d0c19082c1833b0b5097803c4e2f7 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -509,20 +509,23 @@ Failure* Failure::cast(MaybeObject* obj) { |
bool Object::IsJSReceiver() { |
+ STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); |
return IsHeapObject() && |
HeapObject::cast(this)->map()->instance_type() >= FIRST_JS_RECEIVER_TYPE; |
} |
bool Object::IsJSObject() { |
- return IsJSReceiver() && !IsJSProxy(); |
+ STATIC_ASSERT(LAST_JS_OBJECT_TYPE == LAST_TYPE); |
+ return IsHeapObject() && |
+ HeapObject::cast(this)->map()->instance_type() >= FIRST_JS_OBJECT_TYPE; |
} |
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); |
+ if (!Object::IsHeapObject()) return false; |
+ InstanceType type = HeapObject::cast(this)->map()->instance_type(); |
+ return FIRST_JS_PROXY_TYPE <= type && type <= LAST_JS_PROXY_TYPE; |
} |