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

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

Issue 2382953004: Revert "Lazy deopt without code patching." (Closed)
Patch Set: 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) { 180 void CodePatcher::InsertDeoptimizationCallAt(uword start, uword target) {
181 UNREACHABLE(); 181 // The inserted call should not overlap the lazy deopt jump code.
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());
182 } 187 }
183 188
184 189
185 RawCode* CodePatcher::GetInstanceCallAt( 190 RawCode* CodePatcher::GetInstanceCallAt(
186 uword return_address, const Code& code, ICData* ic_data) { 191 uword return_address, const Code& code, ICData* ic_data) {
187 ASSERT(code.ContainsInstructionAt(return_address)); 192 ASSERT(code.ContainsInstructionAt(return_address));
188 InstanceCall call(return_address); 193 InstanceCall call(return_address);
189 if (ic_data != NULL) { 194 if (ic_data != NULL) {
190 *ic_data ^= call.ic_data(); 195 *ic_data ^= call.ic_data();
191 } 196 }
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 253
249 254
250 255
251 intptr_t CodePatcher::InstanceCallSizeInBytes() { 256 intptr_t CodePatcher::InstanceCallSizeInBytes() {
252 return InstanceCall::kPatternSize; 257 return InstanceCall::kPatternSize;
253 } 258 }
254 259
255 } // namespace dart 260 } // namespace dart
256 261
257 #endif // defined TARGET_ARCH_IA32 262 #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