Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: src/objects.h

Issue 1847183004: [elements] Avoid using IsKey in loops (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: addressing comments Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/elements.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « src/elements.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698