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 { |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 // Validate that the name does not move on scavenge, and that we | 28 // Validate that the name does not move on scavenge, and that we |
29 // can use identity checks instead of structural equality checks. | 29 // can use identity checks instead of structural equality checks. |
30 DCHECK(!name->GetHeap()->InNewSpace(name)); | 30 DCHECK(!name->GetHeap()->InNewSpace(name)); |
31 DCHECK(name->IsUniqueName()); | 31 DCHECK(name->IsUniqueName()); |
32 | 32 |
33 // The state bits are not important to the hash function because the stub | 33 // The state bits are not important to the hash function because the stub |
34 // cache only contains handlers. Make sure that the bits are the least | 34 // cache only contains handlers. Make sure that the bits are the least |
35 // significant so they will be the ones masked out. | 35 // significant so they will be the ones masked out. |
36 DCHECK_EQ(Code::HANDLER, Code::ExtractKindFromFlags(flags)); | 36 DCHECK_EQ(Code::HANDLER, Code::ExtractKindFromFlags(flags)); |
37 STATIC_ASSERT((Code::ICStateField::kMask & 1) == 1); | |
38 | 37 |
39 // Make sure that the cache holder are not included in the hash. | 38 // Make sure that the cache holder are not included in the hash. |
40 DCHECK(Code::ExtractCacheHolderFromFlags(flags) == 0); | 39 DCHECK(Code::ExtractCacheHolderFromFlags(flags) == 0); |
41 | 40 |
42 return flags; | 41 return flags; |
43 } | 42 } |
44 | 43 |
45 | 44 |
46 Code* StubCache::Set(Name* name, Map* map, Code* code) { | 45 Code* StubCache::Set(Name* name, Map* map, Code* code) { |
47 Code::Flags flags = CommonStubCacheChecks(name, map, code->flags()); | 46 Code::Flags flags = CommonStubCacheChecks(name, map, code->flags()); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 int offset = SecondaryOffset(*name, flags, primary_offset); | 136 int offset = SecondaryOffset(*name, flags, primary_offset); |
138 if (entry(secondary_, offset) == &secondary_[i] && | 137 if (entry(secondary_, offset) == &secondary_[i] && |
139 TypeFeedbackOracle::IsRelevantFeedback(map, *native_context)) { | 138 TypeFeedbackOracle::IsRelevantFeedback(map, *native_context)) { |
140 types->AddMapIfMissing(Handle<Map>(map), zone); | 139 types->AddMapIfMissing(Handle<Map>(map), zone); |
141 } | 140 } |
142 } | 141 } |
143 } | 142 } |
144 } | 143 } |
145 } // namespace internal | 144 } // namespace internal |
146 } // namespace v8 | 145 } // namespace v8 |
OLD | NEW |