| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef V8_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_H_ |
| 6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
| 7 | 7 |
| 8 #include <iosfwd> | 8 #include <iosfwd> |
| 9 | 9 |
| 10 #include "src/assert-scope.h" | 10 #include "src/assert-scope.h" |
| (...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 975 V(JSSet) \ | 975 V(JSSet) \ |
| 976 V(JSMap) \ | 976 V(JSMap) \ |
| 977 V(JSSetIterator) \ | 977 V(JSSetIterator) \ |
| 978 V(JSMapIterator) \ | 978 V(JSMapIterator) \ |
| 979 V(JSWeakCollection) \ | 979 V(JSWeakCollection) \ |
| 980 V(JSWeakMap) \ | 980 V(JSWeakMap) \ |
| 981 V(JSWeakSet) \ | 981 V(JSWeakSet) \ |
| 982 V(JSRegExp) \ | 982 V(JSRegExp) \ |
| 983 V(HashTable) \ | 983 V(HashTable) \ |
| 984 V(Dictionary) \ | 984 V(Dictionary) \ |
| 985 V(UnseededNumberDictionary) \ |
| 985 V(StringTable) \ | 986 V(StringTable) \ |
| 986 V(StringSet) \ | 987 V(StringSet) \ |
| 987 V(NormalizedMapCache) \ | 988 V(NormalizedMapCache) \ |
| 988 V(CompilationCacheTable) \ | 989 V(CompilationCacheTable) \ |
| 989 V(CodeCacheHashTable) \ | 990 V(CodeCacheHashTable) \ |
| 990 V(MapCache) \ | 991 V(MapCache) \ |
| 991 V(JSGlobalObject) \ | 992 V(JSGlobalObject) \ |
| 992 V(JSGlobalProxy) \ | 993 V(JSGlobalProxy) \ |
| 993 V(Undetectable) \ | 994 V(Undetectable) \ |
| 994 V(AccessCheckNeeded) \ | 995 V(AccessCheckNeeded) \ |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1072 INLINE(bool Is##Name() const); | 1073 INLINE(bool Is##Name() const); |
| 1073 STRUCT_LIST(DECLARE_STRUCT_PREDICATE) | 1074 STRUCT_LIST(DECLARE_STRUCT_PREDICATE) |
| 1074 #undef DECLARE_STRUCT_PREDICATE | 1075 #undef DECLARE_STRUCT_PREDICATE |
| 1075 | 1076 |
| 1076 // ES6, section 7.2.2 IsArray. NOT to be confused with %_IsArray. | 1077 // ES6, section 7.2.2 IsArray. NOT to be confused with %_IsArray. |
| 1077 MUST_USE_RESULT static Maybe<bool> IsArray(Handle<Object> object); | 1078 MUST_USE_RESULT static Maybe<bool> IsArray(Handle<Object> object); |
| 1078 | 1079 |
| 1079 INLINE(bool IsNameDictionary() const); | 1080 INLINE(bool IsNameDictionary() const); |
| 1080 INLINE(bool IsGlobalDictionary() const); | 1081 INLINE(bool IsGlobalDictionary() const); |
| 1081 INLINE(bool IsSeededNumberDictionary() const); | 1082 INLINE(bool IsSeededNumberDictionary() const); |
| 1082 INLINE(bool IsUnseededNumberDictionary() const); | |
| 1083 INLINE(bool IsOrderedHashSet() const); | 1083 INLINE(bool IsOrderedHashSet() const); |
| 1084 INLINE(bool IsOrderedHashMap() const); | 1084 INLINE(bool IsOrderedHashMap() const); |
| 1085 | 1085 |
| 1086 // Extract the number. | 1086 // Extract the number. |
| 1087 inline double Number() const; | 1087 inline double Number() const; |
| 1088 INLINE(bool IsNaN() const); | 1088 INLINE(bool IsNaN() const); |
| 1089 INLINE(bool IsMinusZero() const); | 1089 INLINE(bool IsMinusZero() const); |
| 1090 bool ToInt32(int32_t* value); | 1090 bool ToInt32(int32_t* value); |
| 1091 inline bool ToUint32(uint32_t* value); | 1091 inline bool ToUint32(uint32_t* value); |
| 1092 | 1092 |
| (...skipping 2024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3117 static uint32_t Hash(Key key) { return 0; } | 3117 static uint32_t Hash(Key key) { return 0; } |
| 3118 static uint32_t SeededHash(Key key, uint32_t seed) { | 3118 static uint32_t SeededHash(Key key, uint32_t seed) { |
| 3119 DCHECK(UsesSeed); | 3119 DCHECK(UsesSeed); |
| 3120 return Hash(key); | 3120 return Hash(key); |
| 3121 } | 3121 } |
| 3122 static uint32_t HashForObject(Key key, Object* object) { return 0; } | 3122 static uint32_t HashForObject(Key key, Object* object) { return 0; } |
| 3123 static uint32_t SeededHashForObject(Key key, uint32_t seed, Object* object) { | 3123 static uint32_t SeededHashForObject(Key key, uint32_t seed, Object* object) { |
| 3124 DCHECK(UsesSeed); | 3124 DCHECK(UsesSeed); |
| 3125 return HashForObject(key, object); | 3125 return HashForObject(key, object); |
| 3126 } | 3126 } |
| 3127 static inline Map* GetMap(Isolate* isolate); |
| 3127 }; | 3128 }; |
| 3128 | 3129 |
| 3129 | 3130 |
| 3130 class HashTableBase : public FixedArray { | 3131 class HashTableBase : public FixedArray { |
| 3131 public: | 3132 public: |
| 3132 // Returns the number of elements in the hash table. | 3133 // Returns the number of elements in the hash table. |
| 3133 inline int NumberOfElements(); | 3134 inline int NumberOfElements(); |
| 3134 | 3135 |
| 3135 // Returns the number of deleted elements in the hash table. | 3136 // Returns the number of deleted elements in the hash table. |
| 3136 inline int NumberOfDeletedElements(); | 3137 inline int NumberOfDeletedElements(); |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3635 DECLARE_CAST(GlobalDictionary) | 3636 DECLARE_CAST(GlobalDictionary) |
| 3636 | 3637 |
| 3637 static const int kEntryValueIndex = 1; | 3638 static const int kEntryValueIndex = 1; |
| 3638 }; | 3639 }; |
| 3639 | 3640 |
| 3640 | 3641 |
| 3641 class NumberDictionaryShape : public BaseDictionaryShape<uint32_t> { | 3642 class NumberDictionaryShape : public BaseDictionaryShape<uint32_t> { |
| 3642 public: | 3643 public: |
| 3643 static inline bool IsMatch(uint32_t key, Object* other); | 3644 static inline bool IsMatch(uint32_t key, Object* other); |
| 3644 static inline Handle<Object> AsHandle(Isolate* isolate, uint32_t key); | 3645 static inline Handle<Object> AsHandle(Isolate* isolate, uint32_t key); |
| 3645 static const int kEntrySize = 3; | |
| 3646 static const bool kIsEnumerable = false; | 3646 static const bool kIsEnumerable = false; |
| 3647 }; | 3647 }; |
| 3648 | 3648 |
| 3649 | 3649 |
| 3650 class SeededNumberDictionaryShape : public NumberDictionaryShape { | 3650 class SeededNumberDictionaryShape : public NumberDictionaryShape { |
| 3651 public: | 3651 public: |
| 3652 static const bool UsesSeed = true; | 3652 static const bool UsesSeed = true; |
| 3653 static const int kPrefixSize = 2; | 3653 static const int kPrefixSize = 2; |
| 3654 static const int kEntrySize = 3; |
| 3654 | 3655 |
| 3655 static inline uint32_t SeededHash(uint32_t key, uint32_t seed); | 3656 static inline uint32_t SeededHash(uint32_t key, uint32_t seed); |
| 3656 static inline uint32_t SeededHashForObject(uint32_t key, | 3657 static inline uint32_t SeededHashForObject(uint32_t key, |
| 3657 uint32_t seed, | 3658 uint32_t seed, |
| 3658 Object* object); | 3659 Object* object); |
| 3659 }; | 3660 }; |
| 3660 | 3661 |
| 3661 | 3662 |
| 3662 class UnseededNumberDictionaryShape : public NumberDictionaryShape { | 3663 class UnseededNumberDictionaryShape : public NumberDictionaryShape { |
| 3663 public: | 3664 public: |
| 3664 static const int kPrefixSize = 0; | 3665 static const int kPrefixSize = 0; |
| 3666 static const int kEntrySize = 2; |
| 3665 | 3667 |
| 3666 static inline uint32_t Hash(uint32_t key); | 3668 static inline uint32_t Hash(uint32_t key); |
| 3667 static inline uint32_t HashForObject(uint32_t key, Object* object); | 3669 static inline uint32_t HashForObject(uint32_t key, Object* object); |
| 3670 |
| 3671 template <typename Dictionary> |
| 3672 static inline PropertyDetails DetailsAt(Dictionary* dict, int entry) { |
| 3673 UNREACHABLE(); |
| 3674 return PropertyDetails::Empty(); |
| 3675 } |
| 3676 |
| 3677 template <typename Dictionary> |
| 3678 static inline void DetailsAtPut(Dictionary* dict, int entry, |
| 3679 PropertyDetails value) { |
| 3680 UNREACHABLE(); |
| 3681 } |
| 3682 |
| 3683 static inline Map* GetMap(Isolate* isolate); |
| 3668 }; | 3684 }; |
| 3669 | 3685 |
| 3670 | 3686 |
| 3671 class SeededNumberDictionary | 3687 class SeededNumberDictionary |
| 3672 : public Dictionary<SeededNumberDictionary, | 3688 : public Dictionary<SeededNumberDictionary, |
| 3673 SeededNumberDictionaryShape, | 3689 SeededNumberDictionaryShape, |
| 3674 uint32_t> { | 3690 uint32_t> { |
| 3675 public: | 3691 public: |
| 3676 DECLARE_CAST(SeededNumberDictionary) | 3692 DECLARE_CAST(SeededNumberDictionary) |
| 3677 | 3693 |
| (...skipping 7220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10898 } | 10914 } |
| 10899 return value; | 10915 return value; |
| 10900 } | 10916 } |
| 10901 }; | 10917 }; |
| 10902 | 10918 |
| 10903 | 10919 |
| 10904 } // NOLINT, false-positive due to second-order macros. | 10920 } // NOLINT, false-positive due to second-order macros. |
| 10905 } // NOLINT, false-positive due to second-order macros. | 10921 } // NOLINT, false-positive due to second-order macros. |
| 10906 | 10922 |
| 10907 #endif // V8_OBJECTS_H_ | 10923 #endif // V8_OBJECTS_H_ |
| OLD | NEW |