| OLD | NEW |
| 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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 | 239 |
| 240 intptr_t CodePatcher::InstanceCallSizeInBytes() { | 240 intptr_t CodePatcher::InstanceCallSizeInBytes() { |
| 241 return DartCallPattern::kCallPatternSize; | 241 return DartCallPattern::kCallPatternSize; |
| 242 } | 242 } |
| 243 | 243 |
| 244 | 244 |
| 245 void CodePatcher::InsertCallAt(uword start, uword target) { | 245 void CodePatcher::InsertCallAt(uword start, uword target) { |
| 246 *reinterpret_cast<uint8_t*>(start) = 0xE8; | 246 *reinterpret_cast<uint8_t*>(start) = 0xE8; |
| 247 ShortCallPattern call(start); | 247 ShortCallPattern call(start); |
| 248 call.SetTargetAddress(target); | 248 call.SetTargetAddress(target); |
| 249 CPU::FlushICache(start, ShortCallPattern::InstructionLength()); |
| 249 } | 250 } |
| 250 | 251 |
| 251 | 252 |
| 252 } // namespace dart | 253 } // namespace dart |
| 253 | 254 |
| 254 #endif // defined TARGET_ARCH_X64 | 255 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |