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

Side by Side Diff: runtime/vm/code_patcher_ia32.cc

Issue 2380403003: Lazy deopt without code patching. (Closed)
Patch Set: remove tracing register assignment Created 4 years, 2 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 | « runtime/vm/code_patcher_dbc.cc ('k') | runtime/vm/code_patcher_mips.cc » ('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 (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/code_patcher.h" 9 #include "vm/code_patcher.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 const Code& code, 170 const Code& code,
171 const Code& new_target) { 171 const Code& new_target) {
172 const Instructions& instrs = Instructions::Handle(code.instructions()); 172 const Instructions& instrs = Instructions::Handle(code.instructions());
173 WritableInstructionsScope writable(instrs.PayloadStart(), instrs.size()); 173 WritableInstructionsScope writable(instrs.PayloadStart(), instrs.size());
174 ASSERT(code.ContainsInstructionAt(return_address)); 174 ASSERT(code.ContainsInstructionAt(return_address));
175 StaticCall call(return_address); 175 StaticCall call(return_address);
176 call.set_target(new_target); 176 call.set_target(new_target);
177 } 177 }
178 178
179 179
180 void CodePatcher::InsertDeoptimizationCallAt(uword start, uword target) { 180 void CodePatcher::InsertDeoptimizationCallAt(uword start) {
181 // The inserted call should not overlap the lazy deopt jump code. 181 UNREACHABLE();
182 ASSERT(start + CallPattern::pattern_length_in_bytes() <= target);
183 *reinterpret_cast<uint8_t*>(start) = 0xE8;
184 CallPattern call(start);
185 call.SetTargetAddress(target);
186 CPU::FlushICache(start, CallPattern::pattern_length_in_bytes());
187 } 182 }
188 183
189 184
190 RawCode* CodePatcher::GetInstanceCallAt( 185 RawCode* CodePatcher::GetInstanceCallAt(
191 uword return_address, const Code& code, ICData* ic_data) { 186 uword return_address, const Code& code, ICData* ic_data) {
192 ASSERT(code.ContainsInstructionAt(return_address)); 187 ASSERT(code.ContainsInstructionAt(return_address));
193 InstanceCall call(return_address); 188 InstanceCall call(return_address);
194 if (ic_data != NULL) { 189 if (ic_data != NULL) {
195 *ic_data ^= call.ic_data(); 190 *ic_data ^= call.ic_data();
196 } 191 }
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 248
254 249
255 250
256 intptr_t CodePatcher::InstanceCallSizeInBytes() { 251 intptr_t CodePatcher::InstanceCallSizeInBytes() {
257 return InstanceCall::kPatternSize; 252 return InstanceCall::kPatternSize;
258 } 253 }
259 254
260 } // namespace dart 255 } // namespace dart
261 256
262 #endif // defined TARGET_ARCH_IA32 257 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/code_patcher_dbc.cc ('k') | runtime/vm/code_patcher_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698