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/counters.h" | 9 #include "src/counters.h" |
10 #include "src/heap/heap.h" | 10 #include "src/heap/heap.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 Object* handler) { | 34 Object* handler) { |
35 // Validate that the name and handler do not move on scavenge, and that we | 35 // Validate that the name and handler do not move on scavenge, and that we |
36 // can use identity checks instead of structural equality checks. | 36 // can use identity checks instead of structural equality checks. |
37 DCHECK(!name->GetHeap()->InNewSpace(name)); | 37 DCHECK(!name->GetHeap()->InNewSpace(name)); |
38 DCHECK(!name->GetHeap()->InNewSpace(handler)); | 38 DCHECK(!name->GetHeap()->InNewSpace(handler)); |
39 DCHECK(name->IsUniqueName()); | 39 DCHECK(name->IsUniqueName()); |
40 DCHECK(name->HasHashCode()); | 40 DCHECK(name->HasHashCode()); |
41 if (handler) { | 41 if (handler) { |
42 DCHECK(IC::IsHandler(handler)); | 42 DCHECK(IC::IsHandler(handler)); |
43 if (handler->IsCode()) { | 43 if (handler->IsCode()) { |
44 Code* code = Code::cast(handler); | 44 Code::Flags code_flags = Code::cast(handler)->flags(); |
45 Code::Flags expected_flags = | 45 Code::Kind ic_code_kind = stub_cache->ic_kind(); |
46 Code::ComputeHandlerFlags(stub_cache->ic_kind()); | 46 DCHECK_EQ(ic_code_kind, Code::ExtractExtraICStateFromFlags(code_flags)); |
47 Code::Flags flags = code->flags(); | 47 DCHECK_EQ(Code::HANDLER, Code::ExtractKindFromFlags(code_flags)); |
48 DCHECK_EQ(expected_flags, flags); | |
49 DCHECK_EQ(Code::HANDLER, Code::ExtractKindFromFlags(code->flags())); | |
50 } | 48 } |
51 } | 49 } |
52 return true; | 50 return true; |
53 } | 51 } |
54 | 52 |
55 } // namespace | 53 } // namespace |
56 #endif | 54 #endif |
57 | 55 |
58 Object* StubCache::Set(Name* name, Map* map, Object* handler) { | 56 Object* StubCache::Set(Name* name, Map* map, Object* handler) { |
59 DCHECK(CommonStubCacheChecks(this, name, map, handler)); | 57 DCHECK(CommonStubCacheChecks(this, name, map, handler)); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 } | 104 } |
107 for (int j = 0; j < kSecondaryTableSize; j++) { | 105 for (int j = 0; j < kSecondaryTableSize; j++) { |
108 secondary_[j].key = isolate()->heap()->empty_string(); | 106 secondary_[j].key = isolate()->heap()->empty_string(); |
109 secondary_[j].map = nullptr; | 107 secondary_[j].map = nullptr; |
110 secondary_[j].value = empty; | 108 secondary_[j].value = empty; |
111 } | 109 } |
112 } | 110 } |
113 | 111 |
114 } // namespace internal | 112 } // namespace internal |
115 } // namespace v8 | 113 } // namespace v8 |
OLD | NEW |