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 #ifndef V8_IC_INL_H_ | 5 #ifndef V8_IC_INL_H_ |
6 #define V8_IC_INL_H_ | 6 #define V8_IC_INL_H_ |
7 | 7 |
8 #include "src/ic/ic.h" | 8 #include "src/ic/ic.h" |
9 | 9 |
10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 // is safe for use during GC where the map might be marked. | 89 // is safe for use during GC where the map might be marked. |
90 Code* result = Code::GetCodeFromTargetAddress(target); | 90 Code* result = Code::GetCodeFromTargetAddress(target); |
91 DCHECK(result->is_inline_cache_stub()); | 91 DCHECK(result->is_inline_cache_stub()); |
92 return result; | 92 return result; |
93 } | 93 } |
94 | 94 |
95 | 95 |
96 void IC::SetTargetAtAddress(Address address, Code* target, | 96 void IC::SetTargetAtAddress(Address address, Code* target, |
97 ConstantPoolArray* constant_pool) { | 97 ConstantPoolArray* constant_pool) { |
98 DCHECK(target->is_inline_cache_stub() || target->is_compare_ic_stub()); | 98 DCHECK(target->is_inline_cache_stub() || target->is_compare_ic_stub()); |
| 99 |
| 100 // Don't use this for load_ics when --vector-ics is turned on. |
| 101 DCHECK(!(FLAG_vector_ics && target->is_inline_cache_stub()) || |
| 102 (target->kind() != Code::LOAD_IC && |
| 103 target->kind() != Code::KEYED_LOAD_IC)); |
| 104 |
99 Heap* heap = target->GetHeap(); | 105 Heap* heap = target->GetHeap(); |
100 Code* old_target = GetTargetAtAddress(address, constant_pool); | 106 Code* old_target = GetTargetAtAddress(address, constant_pool); |
101 #ifdef DEBUG | 107 #ifdef DEBUG |
102 // STORE_IC and KEYED_STORE_IC use Code::extra_ic_state() to mark | 108 // STORE_IC and KEYED_STORE_IC use Code::extra_ic_state() to mark |
103 // ICs as strict mode. The strict-ness of the IC must be preserved. | 109 // ICs as strict mode. The strict-ness of the IC must be preserved. |
104 if (old_target->kind() == Code::STORE_IC || | 110 if (old_target->kind() == Code::STORE_IC || |
105 old_target->kind() == Code::KEYED_STORE_IC) { | 111 old_target->kind() == Code::KEYED_STORE_IC) { |
106 DCHECK(StoreIC::GetStrictMode(old_target->extra_ic_state()) == | 112 DCHECK(StoreIC::GetStrictMode(old_target->extra_ic_state()) == |
107 StoreIC::GetStrictMode(target->extra_ic_state())); | 113 StoreIC::GetStrictMode(target->extra_ic_state())); |
108 } | 114 } |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 inline Code* IC::get_host() { | 217 inline Code* IC::get_host() { |
212 return isolate() | 218 return isolate() |
213 ->inner_pointer_to_code_cache() | 219 ->inner_pointer_to_code_cache() |
214 ->GetCacheEntry(address()) | 220 ->GetCacheEntry(address()) |
215 ->code; | 221 ->code; |
216 } | 222 } |
217 } | 223 } |
218 } // namespace v8::internal | 224 } // namespace v8::internal |
219 | 225 |
220 #endif // V8_IC_INL_H_ | 226 #endif // V8_IC_INL_H_ |
OLD | NEW |