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 962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
973 V(JSSet) \ | 973 V(JSSet) \ |
974 V(JSMap) \ | 974 V(JSMap) \ |
975 V(JSSetIterator) \ | 975 V(JSSetIterator) \ |
976 V(JSMapIterator) \ | 976 V(JSMapIterator) \ |
977 V(JSWeakCollection) \ | 977 V(JSWeakCollection) \ |
978 V(JSWeakMap) \ | 978 V(JSWeakMap) \ |
979 V(JSWeakSet) \ | 979 V(JSWeakSet) \ |
980 V(JSRegExp) \ | 980 V(JSRegExp) \ |
981 V(HashTable) \ | 981 V(HashTable) \ |
982 V(Dictionary) \ | 982 V(Dictionary) \ |
| 983 V(UnseededNumberDictionary) \ |
983 V(StringTable) \ | 984 V(StringTable) \ |
984 V(StringSet) \ | 985 V(StringSet) \ |
985 V(NormalizedMapCache) \ | 986 V(NormalizedMapCache) \ |
986 V(CompilationCacheTable) \ | 987 V(CompilationCacheTable) \ |
987 V(CodeCacheHashTable) \ | 988 V(CodeCacheHashTable) \ |
988 V(MapCache) \ | 989 V(MapCache) \ |
989 V(JSGlobalObject) \ | 990 V(JSGlobalObject) \ |
990 V(JSGlobalProxy) \ | 991 V(JSGlobalProxy) \ |
991 V(Undetectable) \ | 992 V(Undetectable) \ |
992 V(AccessCheckNeeded) \ | 993 V(AccessCheckNeeded) \ |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1071 INLINE(bool Is##Name() const); | 1072 INLINE(bool Is##Name() const); |
1072 STRUCT_LIST(DECLARE_STRUCT_PREDICATE) | 1073 STRUCT_LIST(DECLARE_STRUCT_PREDICATE) |
1073 #undef DECLARE_STRUCT_PREDICATE | 1074 #undef DECLARE_STRUCT_PREDICATE |
1074 | 1075 |
1075 // ES6, section 7.2.2 IsArray. NOT to be confused with %_IsArray. | 1076 // ES6, section 7.2.2 IsArray. NOT to be confused with %_IsArray. |
1076 MUST_USE_RESULT static Maybe<bool> IsArray(Handle<Object> object); | 1077 MUST_USE_RESULT static Maybe<bool> IsArray(Handle<Object> object); |
1077 | 1078 |
1078 INLINE(bool IsNameDictionary() const); | 1079 INLINE(bool IsNameDictionary() const); |
1079 INLINE(bool IsGlobalDictionary() const); | 1080 INLINE(bool IsGlobalDictionary() const); |
1080 INLINE(bool IsSeededNumberDictionary() const); | 1081 INLINE(bool IsSeededNumberDictionary() const); |
1081 INLINE(bool IsUnseededNumberDictionary() const); | |
1082 INLINE(bool IsOrderedHashSet() const); | 1082 INLINE(bool IsOrderedHashSet() const); |
1083 INLINE(bool IsOrderedHashMap() const); | 1083 INLINE(bool IsOrderedHashMap() const); |
1084 | 1084 |
1085 // Extract the number. | 1085 // Extract the number. |
1086 inline double Number() const; | 1086 inline double Number() const; |
1087 INLINE(bool IsNaN() const); | 1087 INLINE(bool IsNaN() const); |
1088 INLINE(bool IsMinusZero() const); | 1088 INLINE(bool IsMinusZero() const); |
1089 bool ToInt32(int32_t* value); | 1089 bool ToInt32(int32_t* value); |
1090 inline bool ToUint32(uint32_t* value); | 1090 inline bool ToUint32(uint32_t* value); |
1091 | 1091 |
(...skipping 2025 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 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3639 DECLARE_CAST(GlobalDictionary) | 3640 DECLARE_CAST(GlobalDictionary) |
3640 | 3641 |
3641 static const int kEntryValueIndex = 1; | 3642 static const int kEntryValueIndex = 1; |
3642 }; | 3643 }; |
3643 | 3644 |
3644 | 3645 |
3645 class NumberDictionaryShape : public BaseDictionaryShape<uint32_t> { | 3646 class NumberDictionaryShape : public BaseDictionaryShape<uint32_t> { |
3646 public: | 3647 public: |
3647 static inline bool IsMatch(uint32_t key, Object* other); | 3648 static inline bool IsMatch(uint32_t key, Object* other); |
3648 static inline Handle<Object> AsHandle(Isolate* isolate, uint32_t key); | 3649 static inline Handle<Object> AsHandle(Isolate* isolate, uint32_t key); |
3649 static const int kEntrySize = 3; | |
3650 static const bool kIsEnumerable = false; | 3650 static const bool kIsEnumerable = false; |
3651 }; | 3651 }; |
3652 | 3652 |
3653 | 3653 |
3654 class SeededNumberDictionaryShape : public NumberDictionaryShape { | 3654 class SeededNumberDictionaryShape : public NumberDictionaryShape { |
3655 public: | 3655 public: |
3656 static const bool UsesSeed = true; | 3656 static const bool UsesSeed = true; |
3657 static const int kPrefixSize = 2; | 3657 static const int kPrefixSize = 2; |
| 3658 static const int kEntrySize = 3; |
3658 | 3659 |
3659 static inline uint32_t SeededHash(uint32_t key, uint32_t seed); | 3660 static inline uint32_t SeededHash(uint32_t key, uint32_t seed); |
3660 static inline uint32_t SeededHashForObject(uint32_t key, | 3661 static inline uint32_t SeededHashForObject(uint32_t key, |
3661 uint32_t seed, | 3662 uint32_t seed, |
3662 Object* object); | 3663 Object* object); |
3663 }; | 3664 }; |
3664 | 3665 |
3665 | 3666 |
3666 class UnseededNumberDictionaryShape : public NumberDictionaryShape { | 3667 class UnseededNumberDictionaryShape : public NumberDictionaryShape { |
3667 public: | 3668 public: |
3668 static const int kPrefixSize = 0; | 3669 static const int kPrefixSize = 0; |
| 3670 static const int kEntrySize = 2; |
3669 | 3671 |
3670 static inline uint32_t Hash(uint32_t key); | 3672 static inline uint32_t Hash(uint32_t key); |
3671 static inline uint32_t HashForObject(uint32_t key, Object* object); | 3673 static inline uint32_t HashForObject(uint32_t key, Object* object); |
| 3674 |
| 3675 template <typename Dictionary> |
| 3676 static inline PropertyDetails DetailsAt(Dictionary* dict, int entry) { |
| 3677 UNREACHABLE(); |
| 3678 return PropertyDetails::Empty(); |
| 3679 } |
| 3680 |
| 3681 template <typename Dictionary> |
| 3682 static inline void DetailsAtPut(Dictionary* dict, int entry, |
| 3683 PropertyDetails value) { |
| 3684 UNREACHABLE(); |
| 3685 } |
| 3686 |
| 3687 static inline Map* GetMap(Isolate* isolate); |
3672 }; | 3688 }; |
3673 | 3689 |
3674 | 3690 |
3675 class SeededNumberDictionary | 3691 class SeededNumberDictionary |
3676 : public Dictionary<SeededNumberDictionary, | 3692 : public Dictionary<SeededNumberDictionary, |
3677 SeededNumberDictionaryShape, | 3693 SeededNumberDictionaryShape, |
3678 uint32_t> { | 3694 uint32_t> { |
3679 public: | 3695 public: |
3680 DECLARE_CAST(SeededNumberDictionary) | 3696 DECLARE_CAST(SeededNumberDictionary) |
3681 | 3697 |
(...skipping 7217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10899 } | 10915 } |
10900 return value; | 10916 return value; |
10901 } | 10917 } |
10902 }; | 10918 }; |
10903 | 10919 |
10904 | 10920 |
10905 } // NOLINT, false-positive due to second-order macros. | 10921 } // NOLINT, false-positive due to second-order macros. |
10906 } // NOLINT, false-positive due to second-order macros. | 10922 } // NOLINT, false-positive due to second-order macros. |
10907 | 10923 |
10908 #endif // V8_OBJECTS_H_ | 10924 #endif // V8_OBJECTS_H_ |
OLD | NEW |