OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // Review notes: | 5 // Review notes: |
6 // | 6 // |
7 // - The use of macros in these inline functions may seem superfluous | 7 // - The use of macros in these inline functions may seem superfluous |
8 // but it is absolutely needed to make sure gcc generates optimal | 8 // but it is absolutely needed to make sure gcc generates optimal |
9 // code. gcc is not happy when attempting to inline too deep. | 9 // code. gcc is not happy when attempting to inline too deep. |
10 // | 10 // |
(...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
843 if (FLAG_verify_heap) { | 843 if (FLAG_verify_heap) { |
844 reinterpret_cast<JSFunctionResultCache*>(this)-> | 844 reinterpret_cast<JSFunctionResultCache*>(this)-> |
845 JSFunctionResultCacheVerify(); | 845 JSFunctionResultCacheVerify(); |
846 } | 846 } |
847 #endif | 847 #endif |
848 return true; | 848 return true; |
849 } | 849 } |
850 | 850 |
851 | 851 |
852 bool Object::IsNormalizedMapCache() { | 852 bool Object::IsNormalizedMapCache() { |
853 if (!IsFixedArray()) return false; | 853 return NormalizedMapCache::IsNormalizedMapCache(this); |
854 if (FixedArray::cast(this)->length() != NormalizedMapCache::kEntries) { | 854 } |
| 855 |
| 856 |
| 857 int NormalizedMapCache::GetIndex(Handle<Map> map) { |
| 858 return map->Hash() % NormalizedMapCache::kEntries; |
| 859 } |
| 860 |
| 861 |
| 862 bool NormalizedMapCache::IsNormalizedMapCache(Object* obj) { |
| 863 if (!obj->IsFixedArray()) return false; |
| 864 if (FixedArray::cast(obj)->length() != NormalizedMapCache::kEntries) { |
855 return false; | 865 return false; |
856 } | 866 } |
857 #ifdef VERIFY_HEAP | 867 #ifdef VERIFY_HEAP |
858 if (FLAG_verify_heap) { | 868 if (FLAG_verify_heap) { |
859 reinterpret_cast<NormalizedMapCache*>(this)->NormalizedMapCacheVerify(); | 869 reinterpret_cast<NormalizedMapCache*>(obj)->NormalizedMapCacheVerify(); |
860 } | 870 } |
861 #endif | 871 #endif |
862 return true; | 872 return true; |
863 } | 873 } |
864 | 874 |
865 | 875 |
866 bool Object::IsCompilationCacheTable() { | 876 bool Object::IsCompilationCacheTable() { |
867 return IsHashTable(); | 877 return IsHashTable(); |
868 } | 878 } |
869 | 879 |
(...skipping 5968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6838 #undef READ_SHORT_FIELD | 6848 #undef READ_SHORT_FIELD |
6839 #undef WRITE_SHORT_FIELD | 6849 #undef WRITE_SHORT_FIELD |
6840 #undef READ_BYTE_FIELD | 6850 #undef READ_BYTE_FIELD |
6841 #undef WRITE_BYTE_FIELD | 6851 #undef WRITE_BYTE_FIELD |
6842 #undef NOBARRIER_READ_BYTE_FIELD | 6852 #undef NOBARRIER_READ_BYTE_FIELD |
6843 #undef NOBARRIER_WRITE_BYTE_FIELD | 6853 #undef NOBARRIER_WRITE_BYTE_FIELD |
6844 | 6854 |
6845 } } // namespace v8::internal | 6855 } } // namespace v8::internal |
6846 | 6856 |
6847 #endif // V8_OBJECTS_INL_H_ | 6857 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |