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

Side by Side Diff: src/objects.h

Issue 1268413002: Revert of Remove serializer-specific hash table size heuristic. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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/isolate.h ('k') | src/objects.cc » ('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 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 #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/allocation.h" 10 #include "src/allocation.h"
(...skipping 2889 matching lines...) Expand 10 before | Expand all | Expand 10 after
2900 } 2900 }
2901 void ElementsRemoved(int n) { 2901 void ElementsRemoved(int n) {
2902 SetNumberOfElements(NumberOfElements() - n); 2902 SetNumberOfElements(NumberOfElements() - n);
2903 SetNumberOfDeletedElements(NumberOfDeletedElements() + n); 2903 SetNumberOfDeletedElements(NumberOfDeletedElements() + n);
2904 } 2904 }
2905 2905
2906 // Computes the required capacity for a table holding the given 2906 // Computes the required capacity for a table holding the given
2907 // number of elements. May be more than HashTable::kMaxCapacity. 2907 // number of elements. May be more than HashTable::kMaxCapacity.
2908 static inline int ComputeCapacity(int at_least_space_for); 2908 static inline int ComputeCapacity(int at_least_space_for);
2909 2909
2910 // Use a different heuristic to compute capacity when serializing.
2911 static inline int ComputeCapacityForSerialization(int at_least_space_for);
2912
2910 // Tells whether k is a real key. The hole and undefined are not allowed 2913 // Tells whether k is a real key. The hole and undefined are not allowed
2911 // as keys and can be used to indicate missing or deleted elements. 2914 // as keys and can be used to indicate missing or deleted elements.
2912 bool IsKey(Object* k) { 2915 bool IsKey(Object* k) {
2913 return !k->IsTheHole() && !k->IsUndefined(); 2916 return !k->IsTheHole() && !k->IsUndefined();
2914 } 2917 }
2915 2918
2916 // Compute the probe offset (quadratic probing). 2919 // Compute the probe offset (quadratic probing).
2917 INLINE(static uint32_t GetProbeOffset(uint32_t n)) { 2920 INLINE(static uint32_t GetProbeOffset(uint32_t n)) {
2918 return (n + n * n) >> 1; 2921 return (n + n * n) >> 1;
2919 } 2922 }
(...skipping 7618 matching lines...) Expand 10 before | Expand all | Expand 10 after
10538 } else { 10541 } else {
10539 value &= ~(1 << bit_position); 10542 value &= ~(1 << bit_position);
10540 } 10543 }
10541 return value; 10544 return value;
10542 } 10545 }
10543 }; 10546 };
10544 10547
10545 } } // namespace v8::internal 10548 } } // namespace v8::internal
10546 10549
10547 #endif // V8_OBJECTS_H_ 10550 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/isolate.h ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698