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

Side by Side Diff: src/objects-inl.h

Issue 1265983006: Remove serializer-specific hash table size heuristic. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: skip failing test 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/objects.cc ('k') | test/mjsunit/mjsunit.status » ('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 // Review notes: 5 // Review notes:
6 // 6 //
7 // - The use of macros in these inline functions may seem superfluous 7 // - The use of macros in these inline functions may seem superfluous
8 // but it is absolutely needed to make sure gcc generates optimal 8 // but it is absolutely needed to make sure gcc generates optimal
9 // code. gcc is not happy when attempting to inline too deep. 9 // code. gcc is not happy when attempting to inline too deep.
10 // 10 //
(...skipping 2978 matching lines...) Expand 10 before | Expand all | Expand 10 after
2989 } 2989 }
2990 2990
2991 2991
2992 int HashTableBase::ComputeCapacity(int at_least_space_for) { 2992 int HashTableBase::ComputeCapacity(int at_least_space_for) {
2993 const int kMinCapacity = 4; 2993 const int kMinCapacity = 4;
2994 int capacity = base::bits::RoundUpToPowerOfTwo32(at_least_space_for * 2); 2994 int capacity = base::bits::RoundUpToPowerOfTwo32(at_least_space_for * 2);
2995 return Max(capacity, kMinCapacity); 2995 return Max(capacity, kMinCapacity);
2996 } 2996 }
2997 2997
2998 2998
2999 int HashTableBase::ComputeCapacityForSerialization(int at_least_space_for) {
3000 const int kMinCapacity = 1;
3001 int capacity = base::bits::RoundUpToPowerOfTwo32(at_least_space_for);
3002 return Max(capacity, kMinCapacity);
3003 }
3004
3005
3006 template <typename Derived, typename Shape, typename Key> 2999 template <typename Derived, typename Shape, typename Key>
3007 int HashTable<Derived, Shape, Key>::FindEntry(Key key) { 3000 int HashTable<Derived, Shape, Key>::FindEntry(Key key) {
3008 return FindEntry(GetIsolate(), key); 3001 return FindEntry(GetIsolate(), key);
3009 } 3002 }
3010 3003
3011 3004
3012 template<typename Derived, typename Shape, typename Key> 3005 template<typename Derived, typename Shape, typename Key>
3013 int HashTable<Derived, Shape, Key>::FindEntry(Isolate* isolate, Key key) { 3006 int HashTable<Derived, Shape, Key>::FindEntry(Isolate* isolate, Key key) {
3014 return FindEntry(isolate, key, HashTable::Hash(key)); 3007 return FindEntry(isolate, key, HashTable::Hash(key));
3015 } 3008 }
(...skipping 4212 matching lines...) Expand 10 before | Expand all | Expand 10 after
7228 #undef READ_INT64_FIELD 7221 #undef READ_INT64_FIELD
7229 #undef WRITE_INT64_FIELD 7222 #undef WRITE_INT64_FIELD
7230 #undef READ_BYTE_FIELD 7223 #undef READ_BYTE_FIELD
7231 #undef WRITE_BYTE_FIELD 7224 #undef WRITE_BYTE_FIELD
7232 #undef NOBARRIER_READ_BYTE_FIELD 7225 #undef NOBARRIER_READ_BYTE_FIELD
7233 #undef NOBARRIER_WRITE_BYTE_FIELD 7226 #undef NOBARRIER_WRITE_BYTE_FIELD
7234 7227
7235 } } // namespace v8::internal 7228 } } // namespace v8::internal
7236 7229
7237 #endif // V8_OBJECTS_INL_H_ 7230 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | test/mjsunit/mjsunit.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698