| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
| 6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
| 7 | 7 |
| 8 #include "vm/code_patcher.h" | 8 #include "vm/code_patcher.h" |
| 9 | 9 |
| 10 #include "vm/flow_graph_compiler.h" | 10 #include "vm/flow_graph_compiler.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 } | 47 } |
| 48 | 48 |
| 49 | 49 |
| 50 intptr_t CodePatcher::InstanceCallSizeInBytes() { | 50 intptr_t CodePatcher::InstanceCallSizeInBytes() { |
| 51 // The instance call instruction sequence has a variable size on ARM. | 51 // The instance call instruction sequence has a variable size on ARM. |
| 52 UNREACHABLE(); | 52 UNREACHABLE(); |
| 53 return 0; | 53 return 0; |
| 54 } | 54 } |
| 55 | 55 |
| 56 | 56 |
| 57 RawFunction* CodePatcher::GetUnoptimizedStaticCallAt( | 57 RawFunction* CodePatcher::GetUnoptimizedStaticCallAt(uword return_address, |
| 58 uword return_address, const Code& code, ICData* ic_data_result) { | 58 const Code& code, |
| 59 ICData* ic_data_result) { |
| 59 ASSERT(code.ContainsInstructionAt(return_address)); | 60 ASSERT(code.ContainsInstructionAt(return_address)); |
| 60 CallPattern static_call(return_address, code); | 61 CallPattern static_call(return_address, code); |
| 61 ICData& ic_data = ICData::Handle(); | 62 ICData& ic_data = ICData::Handle(); |
| 62 ic_data ^= static_call.IcData(); | 63 ic_data ^= static_call.IcData(); |
| 63 if (ic_data_result != NULL) { | 64 if (ic_data_result != NULL) { |
| 64 *ic_data_result = ic_data.raw(); | 65 *ic_data_result = ic_data.raw(); |
| 65 } | 66 } |
| 66 return ic_data.GetTargetAt(0); | 67 return ic_data.GetTargetAt(0); |
| 67 } | 68 } |
| 68 | 69 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 99 NativeFunction target, | 100 NativeFunction target, |
| 100 const Code& trampoline) { | 101 const Code& trampoline) { |
| 101 ASSERT(code.ContainsInstructionAt(return_address)); | 102 ASSERT(code.ContainsInstructionAt(return_address)); |
| 102 NativeCallPattern call(return_address, code); | 103 NativeCallPattern call(return_address, code); |
| 103 call.set_target(trampoline); | 104 call.set_target(trampoline); |
| 104 call.set_native_function(target); | 105 call.set_native_function(target); |
| 105 } | 106 } |
| 106 | 107 |
| 107 | 108 |
| 108 RawCode* CodePatcher::GetNativeCallAt(uword return_address, | 109 RawCode* CodePatcher::GetNativeCallAt(uword return_address, |
| 109 const Code& code, | 110 const Code& code, |
| 110 NativeFunction* target) { | 111 NativeFunction* target) { |
| 111 ASSERT(code.ContainsInstructionAt(return_address)); | 112 ASSERT(code.ContainsInstructionAt(return_address)); |
| 112 NativeCallPattern call(return_address, code); | 113 NativeCallPattern call(return_address, code); |
| 113 *target = call.native_function(); | 114 *target = call.native_function(); |
| 114 return call.target(); | 115 return call.target(); |
| 115 } | 116 } |
| 116 | 117 |
| 117 } // namespace dart | 118 } // namespace dart |
| 118 | 119 |
| 119 #endif // defined TARGET_ARCH_ARM | 120 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |