Index: runtime/vm/code_patcher_arm64.cc |
diff --git a/runtime/vm/code_patcher_arm64.cc b/runtime/vm/code_patcher_arm64.cc |
index 3aa2982682956e3ab2ba4f47bd861570482a5a5c..3e10b5a35512076d78095afef2f5abf68c05c427 100644 |
--- a/runtime/vm/code_patcher_arm64.cc |
+++ b/runtime/vm/code_patcher_arm64.cc |
@@ -12,6 +12,15 @@ |
namespace dart { |
+void CodePatcher::PatchInstanceCallAt(uword return_address, |
+ const Code& code, |
+ uword new_target) { |
+ ASSERT(code.ContainsInstructionAt(return_address)); |
+ CallPattern call(return_address, code); |
+ call.SetTargetAddress(new_target); |
+} |
+ |
+ |
class PoolPointerCall : public ValueObject { |
public: |
PoolPointerCall(uword pc, const Code& code) |
@@ -20,19 +29,19 @@ class PoolPointerCall : public ValueObject { |
// Last instruction: blr ip0. |
ASSERT(*(reinterpret_cast<uint32_t*>(end_) - 1) == 0xd63f0200); |
InstructionPattern::DecodeLoadWordFromPool( |
- end_ - 2 * Instr::kInstrSize, ®_, &index_); |
+ end_ - Instr::kInstrSize, ®_, &index_); |
} |
intptr_t pp_index() const { |
return index_; |
} |
- RawCode* Target() const { |
- return reinterpret_cast<RawCode*>(object_pool_.ObjectAt(pp_index())); |
+ uword Target() const { |
+ return object_pool_.RawValueAt(pp_index()); |
} |
- void SetTarget(const Code& target) const { |
- object_pool_.SetObjectAt(pp_index(), target); |
+ void SetTarget(uword target) const { |
+ object_pool_.SetRawValueAt(pp_index(), target); |
// No need to flush the instruction cache, since the code is not modified. |
} |
@@ -46,8 +55,8 @@ class PoolPointerCall : public ValueObject { |
}; |
-RawCode* CodePatcher::GetStaticCallTargetAt(uword return_address, |
- const Code& code) { |
+uword CodePatcher::GetStaticCallTargetAt(uword return_address, |
+ const Code& code) { |
ASSERT(code.ContainsInstructionAt(return_address)); |
PoolPointerCall call(return_address, code); |
return call.Target(); |
@@ -56,36 +65,36 @@ RawCode* CodePatcher::GetStaticCallTargetAt(uword return_address, |
void CodePatcher::PatchStaticCallAt(uword return_address, |
const Code& code, |
- const Code& new_target) { |
+ uword new_target) { |
PatchPoolPointerCallAt(return_address, code, new_target); |
} |
void CodePatcher::PatchPoolPointerCallAt(uword return_address, |
const Code& code, |
- const Code& new_target) { |
+ uword new_target) { |
ASSERT(code.ContainsInstructionAt(return_address)); |
PoolPointerCall call(return_address, code); |
call.SetTarget(new_target); |
} |
-void CodePatcher::InsertDeoptimizationCallAt(uword start, uword target) { |
+void CodePatcher::InsertCallAt(uword start, uword target) { |
// The inserted call should not overlap the lazy deopt jump code. |
- ASSERT(start + CallPattern::kDeoptCallLengthInBytes <= target); |
- CallPattern::InsertDeoptCallAt(start, target); |
+ ASSERT(start + CallPattern::kLengthInBytes <= target); |
+ CallPattern::InsertAt(start, target); |
} |
-RawCode* CodePatcher::GetInstanceCallAt(uword return_address, |
- const Code& code, |
- ICData* ic_data) { |
+uword CodePatcher::GetInstanceCallAt(uword return_address, |
+ const Code& code, |
+ ICData* ic_data) { |
ASSERT(code.ContainsInstructionAt(return_address)); |
CallPattern call(return_address, code); |
if (ic_data != NULL) { |
*ic_data = call.IcData(); |
} |
- return call.TargetCode(); |
+ return call.TargetAddress(); |
} |
@@ -115,14 +124,14 @@ void CodePatcher::PatchNativeCallAt(uword return_address, |
const Code& trampoline) { |
ASSERT(code.ContainsInstructionAt(return_address)); |
NativeCallPattern call(return_address, code); |
- call.set_target(trampoline); |
+ call.set_target(trampoline.EntryPoint()); |
call.set_native_function(target); |
} |
-RawCode* CodePatcher::GetNativeCallAt(uword return_address, |
- const Code& code, |
- NativeFunction* target) { |
+uword CodePatcher::GetNativeCallAt(uword return_address, |
+ const Code& code, |
+ NativeFunction* target) { |
ASSERT(code.ContainsInstructionAt(return_address)); |
NativeCallPattern call(return_address, code); |
*target = call.native_function(); |