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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 | 213 |
214 void CodePatcher::PatchInstanceCallAt(uword return_address, | 214 void CodePatcher::PatchInstanceCallAt(uword return_address, |
215 const Code& code, | 215 const Code& code, |
216 uword new_target) { | 216 uword new_target) { |
217 ASSERT(code.ContainsInstructionAt(return_address)); | 217 ASSERT(code.ContainsInstructionAt(return_address)); |
218 InstanceCall call(return_address); | 218 InstanceCall call(return_address); |
219 call.set_target(new_target); | 219 call.set_target(new_target); |
220 } | 220 } |
221 | 221 |
222 | 222 |
| 223 int32_t CodePatcher::GetPoolOffsetAt(uword return_address) { |
| 224 UNREACHABLE(); |
| 225 return 0; |
| 226 } |
| 227 |
| 228 |
| 229 void CodePatcher::SetPoolOffsetAt(uword return_address, int32_t offset) { |
| 230 UNREACHABLE(); |
| 231 } |
| 232 |
223 | 233 |
224 void CodePatcher::InsertCallAt(uword start, uword target) { | 234 void CodePatcher::InsertCallAt(uword start, uword target) { |
225 // The inserted call should not overlap the lazy deopt jump code. | 235 // The inserted call should not overlap the lazy deopt jump code. |
226 ASSERT(start + CallPattern::InstructionLength() <= target); | 236 ASSERT(start + CallPattern::InstructionLength() <= target); |
227 *reinterpret_cast<uint8_t*>(start) = 0xE8; | 237 *reinterpret_cast<uint8_t*>(start) = 0xE8; |
228 CallPattern call(start); | 238 CallPattern call(start); |
229 call.SetTargetAddress(target); | 239 call.SetTargetAddress(target); |
230 CPU::FlushICache(start, CallPattern::InstructionLength()); | 240 CPU::FlushICache(start, CallPattern::InstructionLength()); |
231 } | 241 } |
232 | 242 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 | 298 |
289 RawObject* CodePatcher::GetEdgeCounterAt(uword pc, const Code& code) { | 299 RawObject* CodePatcher::GetEdgeCounterAt(uword pc, const Code& code) { |
290 ASSERT(code.ContainsInstructionAt(pc)); | 300 ASSERT(code.ContainsInstructionAt(pc)); |
291 EdgeCounter counter(pc, code); | 301 EdgeCounter counter(pc, code); |
292 return counter.edge_counter(); | 302 return counter.edge_counter(); |
293 } | 303 } |
294 | 304 |
295 } // namespace dart | 305 } // namespace dart |
296 | 306 |
297 #endif // defined TARGET_ARCH_IA32 | 307 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |