| OLD | NEW |
| 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 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/base/bits.h" |
| 7 #include "src/ic/stub-cache.h" | 8 #include "src/ic/stub-cache.h" |
| 8 #include "src/type-info.h" | 9 #include "src/type-info.h" |
| 9 | 10 |
| 10 namespace v8 { | 11 namespace v8 { |
| 11 namespace internal { | 12 namespace internal { |
| 12 | 13 |
| 13 | 14 |
| 14 StubCache::StubCache(Isolate* isolate) : isolate_(isolate) {} | 15 StubCache::StubCache(Isolate* isolate) : isolate_(isolate) {} |
| 15 | 16 |
| 16 | 17 |
| 17 void StubCache::Initialize() { | 18 void StubCache::Initialize() { |
| 18 DCHECK(IsPowerOf2(kPrimaryTableSize)); | 19 DCHECK(base::bits::IsPowerOfTwo32(kPrimaryTableSize)); |
| 19 DCHECK(IsPowerOf2(kSecondaryTableSize)); | 20 DCHECK(base::bits::IsPowerOfTwo32(kSecondaryTableSize)); |
| 20 Clear(); | 21 Clear(); |
| 21 } | 22 } |
| 22 | 23 |
| 23 | 24 |
| 24 static Code::Flags CommonStubCacheChecks(Name* name, Map* map, | 25 static Code::Flags CommonStubCacheChecks(Name* name, Map* map, |
| 25 Code::Flags flags) { | 26 Code::Flags flags) { |
| 26 flags = Code::RemoveTypeAndHolderFromFlags(flags); | 27 flags = Code::RemoveTypeAndHolderFromFlags(flags); |
| 27 | 28 |
| 28 // Validate that the name does not move on scavenge, and that we | 29 // Validate that the name does not move on scavenge, and that we |
| 29 // can use identity checks instead of structural equality checks. | 30 // can use identity checks instead of structural equality checks. |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 int offset = SecondaryOffset(*name, flags, primary_offset); | 138 int offset = SecondaryOffset(*name, flags, primary_offset); |
| 138 if (entry(secondary_, offset) == &secondary_[i] && | 139 if (entry(secondary_, offset) == &secondary_[i] && |
| 139 !TypeFeedbackOracle::CanRetainOtherContext(map, *native_context)) { | 140 !TypeFeedbackOracle::CanRetainOtherContext(map, *native_context)) { |
| 140 types->AddMapIfMissing(Handle<Map>(map), zone); | 141 types->AddMapIfMissing(Handle<Map>(map), zone); |
| 141 } | 142 } |
| 142 } | 143 } |
| 143 } | 144 } |
| 144 } | 145 } |
| 145 } | 146 } |
| 146 } // namespace v8::internal | 147 } // namespace v8::internal |
| OLD | NEW |