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/ast/ast.h" | 7 #include "src/ast/ast.h" |
8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
9 #include "src/ic/ic-inl.h" | 9 #include "src/ic/ic-inl.h" |
10 #include "src/type-info.h" | 10 #include "src/type-info.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 DCHECK(base::bits::IsPowerOfTwo32(kPrimaryTableSize)); | 23 DCHECK(base::bits::IsPowerOfTwo32(kPrimaryTableSize)); |
24 DCHECK(base::bits::IsPowerOfTwo32(kSecondaryTableSize)); | 24 DCHECK(base::bits::IsPowerOfTwo32(kSecondaryTableSize)); |
25 Clear(); | 25 Clear(); |
26 } | 26 } |
27 | 27 |
28 #ifdef DEBUG | 28 #ifdef DEBUG |
29 namespace { | 29 namespace { |
30 | 30 |
31 bool CommonStubCacheChecks(StubCache* stub_cache, Name* name, Map* map, | 31 bool CommonStubCacheChecks(StubCache* stub_cache, Name* name, Map* map, |
32 Object* handler) { | 32 Object* handler) { |
33 // Validate that the name does not move on scavenge, and that we | 33 // Validate that the name and handler do not move on scavenge, and that we |
34 // can use identity checks instead of structural equality checks. | 34 // can use identity checks instead of structural equality checks. |
35 DCHECK(!name->GetHeap()->InNewSpace(name)); | 35 DCHECK(!name->GetHeap()->InNewSpace(name)); |
| 36 DCHECK(!name->GetHeap()->InNewSpace(handler)); |
36 DCHECK(name->IsUniqueName()); | 37 DCHECK(name->IsUniqueName()); |
37 DCHECK(name->HasHashCode()); | 38 DCHECK(name->HasHashCode()); |
38 if (handler) { | 39 if (handler) { |
39 DCHECK(IC::IsHandler(handler)); | 40 DCHECK(IC::IsHandler(handler)); |
40 if (handler->IsCode()) { | 41 if (handler->IsCode()) { |
41 Code* code = Code::cast(handler); | 42 Code* code = Code::cast(handler); |
42 Code::Flags expected_flags = Code::RemoveHolderFromFlags( | 43 Code::Flags expected_flags = Code::RemoveHolderFromFlags( |
43 Code::ComputeHandlerFlags(stub_cache->ic_kind())); | 44 Code::ComputeHandlerFlags(stub_cache->ic_kind())); |
44 Code::Flags flags = Code::RemoveHolderFromFlags(code->flags()); | 45 Code::Flags flags = Code::RemoveHolderFromFlags(code->flags()); |
45 DCHECK_EQ(expected_flags, flags); | 46 DCHECK_EQ(expected_flags, flags); |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 int offset = SecondaryOffset(*name, primary_offset); | 142 int offset = SecondaryOffset(*name, primary_offset); |
142 if (entry(secondary_, offset) == &secondary_[i] && | 143 if (entry(secondary_, offset) == &secondary_[i] && |
143 TypeFeedbackOracle::IsRelevantFeedback(map, *native_context)) { | 144 TypeFeedbackOracle::IsRelevantFeedback(map, *native_context)) { |
144 types->AddMapIfMissing(Handle<Map>(map), zone); | 145 types->AddMapIfMissing(Handle<Map>(map), zone); |
145 } | 146 } |
146 } | 147 } |
147 } | 148 } |
148 } | 149 } |
149 } // namespace internal | 150 } // namespace internal |
150 } // namespace v8 | 151 } // namespace v8 |
OLD | NEW |