Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(666)

Unified Diff: runtime/vm/code_patcher_arm64.cc

Issue 1343373003: Revert "VM: New calling convention for generated code." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/code_patcher_arm.cc ('k') | runtime/vm/code_patcher_ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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, &reg_, &index_);
+ end_ - Instr::kInstrSize, &reg_, &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();
« no previous file with comments | « runtime/vm/code_patcher_arm.cc ('k') | runtime/vm/code_patcher_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698