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

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

Issue 2031533002: [dictionaries] Use IsKey(Isolate* i, Object* o) everywhere (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: use new IsTheHole Created 4 years, 6 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') | src/profiler/heap-snapshot-generator.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 // 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 3034 matching lines...) Expand 10 before | Expand all | Expand 10 after
3045 } 3045 }
3046 3046
3047 3047
3048 // static 3048 // static
3049 int HashTableBase::ComputeCapacity(int at_least_space_for) { 3049 int HashTableBase::ComputeCapacity(int at_least_space_for) {
3050 const int kMinCapacity = 4; 3050 const int kMinCapacity = 4;
3051 int capacity = base::bits::RoundUpToPowerOfTwo32(at_least_space_for * 2); 3051 int capacity = base::bits::RoundUpToPowerOfTwo32(at_least_space_for * 2);
3052 return Max(capacity, kMinCapacity); 3052 return Max(capacity, kMinCapacity);
3053 } 3053 }
3054 3054
3055 bool HashTableBase::IsKey(Heap* heap, Object* k) { 3055 bool HashTableBase::IsKey(Isolate* isolate, Object* k) {
3056 Heap* heap = isolate->heap();
3056 return k != heap->the_hole_value() && k != heap->undefined_value(); 3057 return k != heap->the_hole_value() && k != heap->undefined_value();
3057 } 3058 }
3058 3059
3059 bool HashTableBase::IsKey(Object* k) { 3060 bool HashTableBase::IsKey(Object* k) {
3060 Isolate* isolate = this->GetIsolate(); 3061 Isolate* isolate = this->GetIsolate();
3061 return !k->IsTheHole(isolate) && !k->IsUndefined(isolate); 3062 return !k->IsTheHole(isolate) && !k->IsUndefined(isolate);
3062 } 3063 }
3063 3064
3064 3065
3065 void HashTableBase::SetNumberOfElements(int nof) { 3066 void HashTableBase::SetNumberOfElements(int nof) {
(...skipping 4861 matching lines...) Expand 10 before | Expand all | Expand 10 after
7927 #undef WRITE_INT64_FIELD 7928 #undef WRITE_INT64_FIELD
7928 #undef READ_BYTE_FIELD 7929 #undef READ_BYTE_FIELD
7929 #undef WRITE_BYTE_FIELD 7930 #undef WRITE_BYTE_FIELD
7930 #undef NOBARRIER_READ_BYTE_FIELD 7931 #undef NOBARRIER_READ_BYTE_FIELD
7931 #undef NOBARRIER_WRITE_BYTE_FIELD 7932 #undef NOBARRIER_WRITE_BYTE_FIELD
7932 7933
7933 } // namespace internal 7934 } // namespace internal
7934 } // namespace v8 7935 } // namespace v8
7935 7936
7936 #endif // V8_OBJECTS_INL_H_ 7937 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/profiler/heap-snapshot-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698