Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Side by Side Diff: src/ic/ic-inl.h

Issue 1151253004: VectorICs: Create a StoreICState to more easily create matching code stubs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Dumb compile error :P. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/ic/ic-compiler.cc ('k') | src/ic/ic-state.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 (target->kind() != Code::LOAD_IC && 102 (target->kind() != Code::LOAD_IC &&
103 target->kind() != Code::KEYED_LOAD_IC)); 103 target->kind() != Code::KEYED_LOAD_IC));
104 104
105 Heap* heap = target->GetHeap(); 105 Heap* heap = target->GetHeap();
106 Code* old_target = GetTargetAtAddress(address, constant_pool); 106 Code* old_target = GetTargetAtAddress(address, constant_pool);
107 #ifdef DEBUG 107 #ifdef DEBUG
108 // 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
109 // ICs as language mode. The language mode of the IC must be preserved. 109 // ICs as language mode. The language mode of the IC must be preserved.
110 if (old_target->kind() == Code::STORE_IC || 110 if (old_target->kind() == Code::STORE_IC ||
111 old_target->kind() == Code::KEYED_STORE_IC) { 111 old_target->kind() == Code::KEYED_STORE_IC) {
112 DCHECK(StoreIC::GetLanguageMode(old_target->extra_ic_state()) == 112 DCHECK(StoreICState::GetLanguageMode(old_target->extra_ic_state()) ==
113 StoreIC::GetLanguageMode(target->extra_ic_state())); 113 StoreICState::GetLanguageMode(target->extra_ic_state()));
114 } 114 }
115 #endif 115 #endif
116 Assembler::set_target_address_at(address, constant_pool, 116 Assembler::set_target_address_at(address, constant_pool,
117 target->instruction_start()); 117 target->instruction_start());
118 if (heap->gc_state() == Heap::MARK_COMPACT) { 118 if (heap->gc_state() == Heap::MARK_COMPACT) {
119 heap->mark_compact_collector()->RecordCodeTargetPatch(address, target); 119 heap->mark_compact_collector()->RecordCodeTargetPatch(address, target);
120 } else { 120 } else {
121 heap->incremental_marking()->RecordCodeTargetPatch(address, target); 121 heap->incremental_marking()->RecordCodeTargetPatch(address, target);
122 } 122 }
123 PostPatching(address, target, old_target); 123 PostPatching(address, target, old_target);
(...skipping 10 matching lines...) Expand all
134 // The contextual mode must be preserved across IC patching. 134 // The contextual mode must be preserved across IC patching.
135 DCHECK(LoadICState::GetContextualMode(code->extra_ic_state()) == 135 DCHECK(LoadICState::GetContextualMode(code->extra_ic_state()) ==
136 LoadICState::GetContextualMode(target()->extra_ic_state())); 136 LoadICState::GetContextualMode(target()->extra_ic_state()));
137 137
138 IC::set_target(code); 138 IC::set_target(code);
139 } 139 }
140 140
141 141
142 void StoreIC::set_target(Code* code) { 142 void StoreIC::set_target(Code* code) {
143 // Language mode must be preserved across IC patching. 143 // Language mode must be preserved across IC patching.
144 DCHECK(GetLanguageMode(code->extra_ic_state()) == 144 DCHECK(StoreICState::GetLanguageMode(code->extra_ic_state()) ==
145 GetLanguageMode(target()->extra_ic_state())); 145 StoreICState::GetLanguageMode(target()->extra_ic_state()));
146 IC::set_target(code); 146 IC::set_target(code);
147 } 147 }
148 148
149 149
150 void KeyedStoreIC::set_target(Code* code) { 150 void KeyedStoreIC::set_target(Code* code) {
151 // Language mode must be preserved across IC patching. 151 // Language mode must be preserved across IC patching.
152 DCHECK(GetLanguageMode(code->extra_ic_state()) == language_mode()); 152 DCHECK(StoreICState::GetLanguageMode(code->extra_ic_state()) ==
153 language_mode());
153 IC::set_target(code); 154 IC::set_target(code);
154 } 155 }
155 156
156 157
157 Code* IC::raw_target() const { 158 Code* IC::raw_target() const {
158 return GetTargetAtAddress(address(), constant_pool()); 159 return GetTargetAtAddress(address(), constant_pool());
159 } 160 }
160 161
161 void IC::UpdateTarget() { target_ = handle(raw_target(), isolate_); } 162 void IC::UpdateTarget() { target_ = handle(raw_target(), isolate_); }
162 163
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 inline Code* IC::get_host() { 215 inline Code* IC::get_host() {
215 return isolate() 216 return isolate()
216 ->inner_pointer_to_code_cache() 217 ->inner_pointer_to_code_cache()
217 ->GetCacheEntry(address()) 218 ->GetCacheEntry(address())
218 ->code; 219 ->code;
219 } 220 }
220 } 221 }
221 } // namespace v8::internal 222 } // namespace v8::internal
222 223
223 #endif // V8_IC_INL_H_ 224 #endif // V8_IC_INL_H_
OLDNEW
« no previous file with comments | « src/ic/ic-compiler.cc ('k') | src/ic/ic-state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698