| 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 3193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3204 inline void ElementRemoved(); | 3204 inline void ElementRemoved(); |
| 3205 inline void ElementsRemoved(int n); | 3205 inline void ElementsRemoved(int n); |
| 3206 | 3206 |
| 3207 // Computes the required capacity for a table holding the given | 3207 // Computes the required capacity for a table holding the given |
| 3208 // number of elements. May be more than HashTable::kMaxCapacity. | 3208 // number of elements. May be more than HashTable::kMaxCapacity. |
| 3209 static inline int ComputeCapacity(int at_least_space_for); | 3209 static inline int ComputeCapacity(int at_least_space_for); |
| 3210 | 3210 |
| 3211 // Tells whether k is a real key. The hole and undefined are not allowed | 3211 // Tells whether k is a real key. The hole and undefined are not allowed |
| 3212 // as keys and can be used to indicate missing or deleted elements. | 3212 // as keys and can be used to indicate missing or deleted elements. |
| 3213 inline bool IsKey(Object* k); | 3213 inline bool IsKey(Object* k); |
| 3214 inline bool IsKey(Heap* heap, Object* k); |
| 3214 | 3215 |
| 3215 // Compute the probe offset (quadratic probing). | 3216 // Compute the probe offset (quadratic probing). |
| 3216 INLINE(static uint32_t GetProbeOffset(uint32_t n)) { | 3217 INLINE(static uint32_t GetProbeOffset(uint32_t n)) { |
| 3217 return (n + n * n) >> 1; | 3218 return (n + n * n) >> 1; |
| 3218 } | 3219 } |
| 3219 | 3220 |
| 3220 static const int kNumberOfElementsIndex = 0; | 3221 static const int kNumberOfElementsIndex = 0; |
| 3221 static const int kNumberOfDeletedElementsIndex = 1; | 3222 static const int kNumberOfDeletedElementsIndex = 1; |
| 3222 static const int kCapacityIndex = 2; | 3223 static const int kCapacityIndex = 2; |
| 3223 static const int kPrefixStartIndex = 3; | 3224 static const int kPrefixStartIndex = 3; |
| (...skipping 7693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10917 } | 10918 } |
| 10918 return value; | 10919 return value; |
| 10919 } | 10920 } |
| 10920 }; | 10921 }; |
| 10921 | 10922 |
| 10922 | 10923 |
| 10923 } // NOLINT, false-positive due to second-order macros. | 10924 } // NOLINT, false-positive due to second-order macros. |
| 10924 } // NOLINT, false-positive due to second-order macros. | 10925 } // NOLINT, false-positive due to second-order macros. |
| 10925 | 10926 |
| 10926 #endif // V8_OBJECTS_H_ | 10927 #endif // V8_OBJECTS_H_ |
| OLD | NEW |