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

Unified Diff: runtime/vm/code_patcher_arm64.cc

Issue 241573002: Code patching for ARM64. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 8 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/assembler_arm64_test.cc ('k') | runtime/vm/code_patcher_arm64_test.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
===================================================================
--- runtime/vm/code_patcher_arm64.cc (revision 35070)
+++ runtime/vm/code_patcher_arm64.cc (working copy)
@@ -14,58 +14,72 @@
RawArray* CodePatcher::GetClosureArgDescAt(uword return_address,
const Code& code) {
- UNIMPLEMENTED();
- return NULL;
+ ASSERT(code.ContainsInstructionAt(return_address));
+ CallPattern call(return_address, code);
+ return call.ClosureArgumentsDescriptor();
}
uword CodePatcher::GetStaticCallTargetAt(uword return_address,
const Code& code) {
- UNIMPLEMENTED();
- return 0;
+ ASSERT(code.ContainsInstructionAt(return_address));
+ CallPattern call(return_address, code);
+ return call.TargetAddress();
}
void CodePatcher::PatchStaticCallAt(uword return_address,
const Code& code,
uword new_target) {
- UNIMPLEMENTED();
+ ASSERT(code.ContainsInstructionAt(return_address));
+ CallPattern call(return_address, code);
+ call.SetTargetAddress(new_target);
}
void CodePatcher::PatchInstanceCallAt(uword return_address,
const Code& code,
uword new_target) {
- UNIMPLEMENTED();
+ ASSERT(code.ContainsInstructionAt(return_address));
+ CallPattern call(return_address, code);
+ call.SetTargetAddress(new_target);
}
int32_t CodePatcher::GetPoolOffsetAt(uword return_address) {
+ // TODO(zra): Needed for debugger.
UNIMPLEMENTED();
return 0;
}
void CodePatcher::SetPoolOffsetAt(uword return_address, int32_t offset) {
+ // TODO(zra): Needed for debugger.
UNIMPLEMENTED();
}
void CodePatcher::InsertCallAt(uword start, uword target) {
- UNIMPLEMENTED();
+ // The inserted call should not overlap the lazy deopt jump code.
+ ASSERT(start + CallPattern::kLengthInBytes <= target);
+ CallPattern::InsertAt(start, target);
}
uword CodePatcher::GetInstanceCallAt(uword return_address,
const Code& code,
ICData* ic_data) {
- UNIMPLEMENTED();
- return 0;
+ ASSERT(code.ContainsInstructionAt(return_address));
+ CallPattern call(return_address, code);
+ if (ic_data != NULL) {
+ *ic_data = call.IcData();
+ }
+ return call.TargetAddress();
}
intptr_t CodePatcher::InstanceCallSizeInBytes() {
- // The instance call instruction sequence has a variable size on ARM.
+ // The instance call instruction sequence has a variable size on ARM64.
UNREACHABLE();
return 0;
}
@@ -73,8 +87,14 @@
RawFunction* CodePatcher::GetUnoptimizedStaticCallAt(
uword return_address, const Code& code, ICData* ic_data_result) {
- UNIMPLEMENTED();
- return NULL;
+ ASSERT(code.ContainsInstructionAt(return_address));
+ CallPattern static_call(return_address, code);
+ ICData& ic_data = ICData::Handle();
+ ic_data ^= static_call.IcData();
+ if (ic_data_result != NULL) {
+ *ic_data_result = ic_data.raw();
+ }
+ return ic_data.GetTargetAt(0);
}
« no previous file with comments | « runtime/vm/assembler_arm64_test.cc ('k') | runtime/vm/code_patcher_arm64_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698