Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index 2f3de9da2c075b6660b573268eb7f8b32817d43b..44f1c7cb97e396f65e847a1667d2240b84da3dd8 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -850,13 +850,23 @@ bool Object::IsJSFunctionResultCache() { |
bool Object::IsNormalizedMapCache() { |
- if (!IsFixedArray()) return false; |
- if (FixedArray::cast(this)->length() != NormalizedMapCache::kEntries) { |
+ return NormalizedMapCache::IsNormalizedMapCache(this); |
+} |
+ |
+ |
+int NormalizedMapCache::GetIndex(Handle<Map> map) { |
+ return map->Hash() % NormalizedMapCache::kEntries; |
+} |
+ |
+ |
+bool NormalizedMapCache::IsNormalizedMapCache(Object* obj) { |
+ if (!obj->IsFixedArray()) return false; |
+ if (FixedArray::cast(obj)->length() != NormalizedMapCache::kEntries) { |
return false; |
} |
#ifdef VERIFY_HEAP |
if (FLAG_verify_heap) { |
- reinterpret_cast<NormalizedMapCache*>(this)->NormalizedMapCacheVerify(); |
+ reinterpret_cast<NormalizedMapCache*>(obj)->NormalizedMapCacheVerify(); |
} |
#endif |
return true; |