| 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/ic/stub-cache.h" | 5 #include "src/ic/stub-cache.h" |
| 6 | 6 |
| 7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
| 8 #include "src/type-info.h" | 8 #include "src/type-info.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| 11 namespace internal { | 11 namespace internal { |
| 12 | 12 |
| 13 | 13 StubCache::StubCache(Isolate* isolate, Code::Kind ic_kind) |
| 14 StubCache::StubCache(Isolate* isolate) : isolate_(isolate) {} | 14 : isolate_(isolate), ic_kind_(ic_kind) {} |
| 15 | |
| 16 | 15 |
| 17 void StubCache::Initialize() { | 16 void StubCache::Initialize() { |
| 18 DCHECK(base::bits::IsPowerOfTwo32(kPrimaryTableSize)); | 17 DCHECK(base::bits::IsPowerOfTwo32(kPrimaryTableSize)); |
| 19 DCHECK(base::bits::IsPowerOfTwo32(kSecondaryTableSize)); | 18 DCHECK(base::bits::IsPowerOfTwo32(kSecondaryTableSize)); |
| 20 Clear(); | 19 Clear(); |
| 21 } | 20 } |
| 22 | 21 |
| 23 | 22 |
| 24 static Code::Flags CommonStubCacheChecks(Name* name, Map* map, | 23 static Code::Flags CommonStubCacheChecks(Name* name, Map* map, |
| 25 Code::Flags flags) { | 24 Code::Flags flags) { |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 int offset = SecondaryOffset(*name, flags, primary_offset); | 135 int offset = SecondaryOffset(*name, flags, primary_offset); |
| 137 if (entry(secondary_, offset) == &secondary_[i] && | 136 if (entry(secondary_, offset) == &secondary_[i] && |
| 138 TypeFeedbackOracle::IsRelevantFeedback(map, *native_context)) { | 137 TypeFeedbackOracle::IsRelevantFeedback(map, *native_context)) { |
| 139 types->AddMapIfMissing(Handle<Map>(map), zone); | 138 types->AddMapIfMissing(Handle<Map>(map), zone); |
| 140 } | 139 } |
| 141 } | 140 } |
| 142 } | 141 } |
| 143 } | 142 } |
| 144 } // namespace internal | 143 } // namespace internal |
| 145 } // namespace v8 | 144 } // namespace v8 |
| OLD | NEW |