Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index 364376c722776fcc01303b035e798130db116054..44f7b9e647daa8367da4238737eadfa04bc8eafb 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -162,6 +162,22 @@ HEAP_OBJECT_TYPE_LIST(IS_TYPE_FUNCTION_DEF) |
ODDBALL_LIST(IS_TYPE_FUNCTION_DEF) |
#undef IS_TYPE_FUNCTION_DEF |
+bool HeapObject::IsTheHole(Isolate* isolate) const { |
+ return this == isolate->heap()->the_hole_value(); |
+} |
+ |
+bool HeapObject::IsUndefined(Isolate* isolate) const { |
+ return this == isolate->heap()->undefined_value(); |
+} |
+ |
+bool Object::IsTheHole(Isolate* isolate) const { |
+ return this == isolate->heap()->the_hole_value(); |
+} |
+ |
+bool Object::IsUndefined(Isolate* isolate) const { |
+ return this == isolate->heap()->undefined_value(); |
+} |
Toon Verwaest
2016/06/01 12:36:17
We should replace the versions above with these ve
|
+ |
bool HeapObject::IsString() const { |
return map()->instance_type() < FIRST_NONSTRING_TYPE; |
} |
@@ -244,7 +260,6 @@ bool HeapObject::IsExternalTwoByteString() const { |
String::cast(this)->IsTwoByteRepresentation(); |
} |
- |
bool Object::HasValidElements() { |
// Dictionary is covered under FixedArray. |
return IsFixedArray() || IsFixedDoubleArray() || IsFixedTypedArrayBase(); |
@@ -3021,7 +3036,8 @@ bool HashTableBase::IsKey(Heap* heap, Object* k) { |
} |
bool HashTableBase::IsKey(Object* k) { |
- return !k->IsTheHole() && !k->IsUndefined(); |
+ Isolate* isolate = this->GetIsolate(); |
+ return !k->IsTheHole(isolate) && !k->IsUndefined(isolate); |
} |