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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 return result; | 91 return result; |
92 } | 92 } |
93 | 93 |
94 | 94 |
95 void IC::SetTargetAtAddress(Address address, Code* target, | 95 void IC::SetTargetAtAddress(Address address, Code* target, |
96 Address constant_pool) { | 96 Address constant_pool) { |
97 if (AddressIsDeoptimizedCode(target->GetIsolate(), address)) return; | 97 if (AddressIsDeoptimizedCode(target->GetIsolate(), address)) return; |
98 | 98 |
99 DCHECK(target->is_inline_cache_stub() || target->is_compare_ic_stub()); | 99 DCHECK(target->is_inline_cache_stub() || target->is_compare_ic_stub()); |
100 | 100 |
101 // Don't use this for load_ics when --vector-ics is turned on. | |
102 DCHECK(!target->is_inline_cache_stub() || | 101 DCHECK(!target->is_inline_cache_stub() || |
103 (target->kind() != Code::LOAD_IC && | 102 (target->kind() != Code::LOAD_IC && |
104 target->kind() != Code::KEYED_LOAD_IC)); | 103 target->kind() != Code::KEYED_LOAD_IC && |
| 104 (!FLAG_vector_stores || (target->kind() != Code::STORE_IC && |
| 105 target->kind() != Code::KEYED_STORE_IC)))); |
105 | 106 |
106 Heap* heap = target->GetHeap(); | 107 Heap* heap = target->GetHeap(); |
107 Code* old_target = GetTargetAtAddress(address, constant_pool); | 108 Code* old_target = GetTargetAtAddress(address, constant_pool); |
108 #ifdef DEBUG | 109 #ifdef DEBUG |
109 // STORE_IC and KEYED_STORE_IC use Code::extra_ic_state() to mark | 110 // STORE_IC and KEYED_STORE_IC use Code::extra_ic_state() to mark |
110 // ICs as language mode. The language mode of the IC must be preserved. | 111 // ICs as language mode. The language mode of the IC must be preserved. |
111 if (old_target->kind() == Code::STORE_IC || | 112 if (old_target->kind() == Code::STORE_IC || |
112 old_target->kind() == Code::KEYED_STORE_IC) { | 113 old_target->kind() == Code::KEYED_STORE_IC) { |
113 DCHECK(StoreICState::GetLanguageMode(old_target->extra_ic_state()) == | 114 DCHECK(StoreICState::GetLanguageMode(old_target->extra_ic_state()) == |
114 StoreICState::GetLanguageMode(target->extra_ic_state())); | 115 StoreICState::GetLanguageMode(target->extra_ic_state())); |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 bool IC::AddressIsDeoptimizedCode(Isolate* isolate, Address address) { | 230 bool IC::AddressIsDeoptimizedCode(Isolate* isolate, Address address) { |
230 Code* host = | 231 Code* host = |
231 isolate->inner_pointer_to_code_cache()->GetCacheEntry(address)->code; | 232 isolate->inner_pointer_to_code_cache()->GetCacheEntry(address)->code; |
232 return (host->kind() == Code::OPTIMIZED_FUNCTION && | 233 return (host->kind() == Code::OPTIMIZED_FUNCTION && |
233 host->marked_for_deoptimization()); | 234 host->marked_for_deoptimization()); |
234 } | 235 } |
235 } | 236 } |
236 } // namespace v8::internal | 237 } // namespace v8::internal |
237 | 238 |
238 #endif // V8_IC_INL_H_ | 239 #endif // V8_IC_INL_H_ |
OLD | NEW |