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