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 12 matching lines...) Expand all Loading... |
23 | 23 |
24 void CodePatcher::PatchStaticCallAt(uword return_address, | 24 void CodePatcher::PatchStaticCallAt(uword return_address, |
25 const Code& code, | 25 const Code& code, |
26 const Code& new_target) { | 26 const Code& new_target) { |
27 ASSERT(code.ContainsInstructionAt(return_address)); | 27 ASSERT(code.ContainsInstructionAt(return_address)); |
28 CallPattern call(return_address, code); | 28 CallPattern call(return_address, code); |
29 call.SetTargetCode(new_target); | 29 call.SetTargetCode(new_target); |
30 } | 30 } |
31 | 31 |
32 | 32 |
33 void CodePatcher::InsertDeoptimizationCallAt(uword start) { | 33 void CodePatcher::InsertDeoptimizationCallAt(uword start, uword target) { |
34 UNREACHABLE(); | 34 // The inserted call should not overlap the lazy deopt jump code. |
| 35 ASSERT(start + CallPattern::DeoptCallPatternLengthInBytes() <= target); |
| 36 CallPattern::InsertDeoptCallAt(start, target); |
35 } | 37 } |
36 | 38 |
37 | 39 |
38 RawCode* CodePatcher::GetInstanceCallAt(uword return_address, | 40 RawCode* CodePatcher::GetInstanceCallAt(uword return_address, |
39 const Code& code, | 41 const Code& code, |
40 ICData* ic_data) { | 42 ICData* ic_data) { |
41 ASSERT(code.ContainsInstructionAt(return_address)); | 43 ASSERT(code.ContainsInstructionAt(return_address)); |
42 CallPattern call(return_address, code); | 44 CallPattern call(return_address, code); |
43 if (ic_data != NULL) { | 45 if (ic_data != NULL) { |
44 *ic_data = call.IcData(); | 46 *ic_data = call.IcData(); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 NativeFunction* target) { | 112 NativeFunction* target) { |
111 ASSERT(code.ContainsInstructionAt(return_address)); | 113 ASSERT(code.ContainsInstructionAt(return_address)); |
112 NativeCallPattern call(return_address, code); | 114 NativeCallPattern call(return_address, code); |
113 *target = call.native_function(); | 115 *target = call.native_function(); |
114 return call.target(); | 116 return call.target(); |
115 } | 117 } |
116 | 118 |
117 } // namespace dart | 119 } // namespace dart |
118 | 120 |
119 #endif // defined TARGET_ARCH_ARM | 121 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |