| 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 | 169 |
| 170 void CodePatcher::PatchInstanceCallAt(uword return_address, | 170 void CodePatcher::PatchInstanceCallAt(uword return_address, |
| 171 const Code& code, | 171 const Code& code, |
| 172 uword new_target) { | 172 uword new_target) { |
| 173 ASSERT(code.ContainsInstructionAt(return_address)); | 173 ASSERT(code.ContainsInstructionAt(return_address)); |
| 174 InstanceCall call(return_address); | 174 InstanceCall call(return_address); |
| 175 call.set_target(new_target); | 175 call.set_target(new_target); |
| 176 } | 176 } |
| 177 | 177 |
| 178 | 178 |
| 179 int32_t CodePatcher::GetPoolOffsetAt(uword return_address) { | |
| 180 UNREACHABLE(); | |
| 181 return 0; | |
| 182 } | |
| 183 | |
| 184 | |
| 185 void CodePatcher::SetPoolOffsetAt(uword return_address, int32_t offset) { | |
| 186 UNREACHABLE(); | |
| 187 } | |
| 188 | |
| 189 | |
| 190 void CodePatcher::InsertCallAt(uword start, uword target) { | 179 void CodePatcher::InsertCallAt(uword start, uword target) { |
| 191 // The inserted call should not overlap the lazy deopt jump code. | 180 // The inserted call should not overlap the lazy deopt jump code. |
| 192 ASSERT(start + CallPattern::InstructionLength() <= target); | 181 ASSERT(start + CallPattern::InstructionLength() <= target); |
| 193 *reinterpret_cast<uint8_t*>(start) = 0xE8; | 182 *reinterpret_cast<uint8_t*>(start) = 0xE8; |
| 194 CallPattern call(start); | 183 CallPattern call(start); |
| 195 call.SetTargetAddress(target); | 184 call.SetTargetAddress(target); |
| 196 CPU::FlushICache(start, CallPattern::InstructionLength()); | 185 CPU::FlushICache(start, CallPattern::InstructionLength()); |
| 197 } | 186 } |
| 198 | 187 |
| 199 | 188 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 | 239 |
| 251 RawObject* CodePatcher::GetEdgeCounterAt(uword pc, const Code& code) { | 240 RawObject* CodePatcher::GetEdgeCounterAt(uword pc, const Code& code) { |
| 252 ASSERT(code.ContainsInstructionAt(pc)); | 241 ASSERT(code.ContainsInstructionAt(pc)); |
| 253 EdgeCounter counter(pc, code); | 242 EdgeCounter counter(pc, code); |
| 254 return counter.edge_counter(); | 243 return counter.edge_counter(); |
| 255 } | 244 } |
| 256 | 245 |
| 257 } // namespace dart | 246 } // namespace dart |
| 258 | 247 |
| 259 #endif // defined TARGET_ARCH_IA32 | 248 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |