| 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_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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 | 257 |
| 258 intptr_t CodePatcher::InstanceCallSizeInBytes() { | 258 intptr_t CodePatcher::InstanceCallSizeInBytes() { |
| 259 return DartCallPattern::kNumInstructions * DartCallPattern::kInstructionSize; | 259 return DartCallPattern::kNumInstructions * DartCallPattern::kInstructionSize; |
| 260 } | 260 } |
| 261 | 261 |
| 262 | 262 |
| 263 void CodePatcher::InsertCallAt(uword start, uword target) { | 263 void CodePatcher::InsertCallAt(uword start, uword target) { |
| 264 *reinterpret_cast<uint8_t*>(start) = 0xE8; | 264 *reinterpret_cast<uint8_t*>(start) = 0xE8; |
| 265 CallPattern call(start); | 265 CallPattern call(start); |
| 266 call.SetTargetAddress(target); | 266 call.SetTargetAddress(target); |
| 267 CPU::FlushICache(start, CallPattern::InstructionLength()); |
| 267 } | 268 } |
| 268 | 269 |
| 269 | 270 |
| 270 } // namespace dart | 271 } // namespace dart |
| 271 | 272 |
| 272 #endif // defined TARGET_ARCH_IA32 | 273 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |