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

Side by Side Diff: runtime/vm/code_patcher_x64.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_mips.cc ('k') | runtime/vm/deopt_instructions.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_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 } 286 }
287 return call.target(); 287 return call.target();
288 } 288 }
289 289
290 290
291 intptr_t CodePatcher::InstanceCallSizeInBytes() { 291 intptr_t CodePatcher::InstanceCallSizeInBytes() {
292 return InstanceCall::kCallPatternSize; 292 return InstanceCall::kCallPatternSize;
293 } 293 }
294 294
295 295
296 void CodePatcher::InsertDeoptimizationCallAt(uword start) { 296 void CodePatcher::InsertDeoptimizationCallAt(uword start, uword target) {
297 UNREACHABLE(); 297 // The inserted call should not overlap the lazy deopt jump code.
298 ASSERT(start + ShortCallPattern::pattern_length_in_bytes() <= target);
299 *reinterpret_cast<uint8_t*>(start) = 0xE8;
300 ShortCallPattern call(start);
301 call.SetTargetAddress(target);
302 CPU::FlushICache(start, ShortCallPattern::pattern_length_in_bytes());
298 } 303 }
299 304
300 305
301 RawFunction* CodePatcher::GetUnoptimizedStaticCallAt( 306 RawFunction* CodePatcher::GetUnoptimizedStaticCallAt(
302 uword return_address, const Code& code, ICData* ic_data_result) { 307 uword return_address, const Code& code, ICData* ic_data_result) {
303 ASSERT(code.ContainsInstructionAt(return_address)); 308 ASSERT(code.ContainsInstructionAt(return_address));
304 UnoptimizedStaticCall static_call(return_address, code); 309 UnoptimizedStaticCall static_call(return_address, code);
305 ICData& ic_data = ICData::Handle(); 310 ICData& ic_data = ICData::Handle();
306 ic_data ^= static_call.ic_data(); 311 ic_data ^= static_call.ic_data();
307 if (ic_data_result != NULL) { 312 if (ic_data_result != NULL) {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 NativeFunction* target) { 359 NativeFunction* target) {
355 ASSERT(code.ContainsInstructionAt(return_address)); 360 ASSERT(code.ContainsInstructionAt(return_address));
356 NativeCall call(return_address, code); 361 NativeCall call(return_address, code);
357 *target = call.native_function(); 362 *target = call.native_function();
358 return call.target(); 363 return call.target();
359 } 364 }
360 365
361 } // namespace dart 366 } // namespace dart
362 367
363 #endif // defined TARGET_ARCH_X64 368 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/code_patcher_mips.cc ('k') | runtime/vm/deopt_instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698