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

Unified Diff: runtime/vm/code_patcher_arm64.cc

Issue 1294113004: VM: Link native calls lazily. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: addressed comments Created 5 years, 4 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 7b0afef646b834eb8ff43dd34959aae7b74fb7bf..3e10b5a35512076d78095afef2f5abf68c05c427 100644
--- a/runtime/vm/code_patcher_arm64.cc
+++ b/runtime/vm/code_patcher_arm64.cc
@@ -118,6 +118,27 @@ RawFunction* CodePatcher::GetUnoptimizedStaticCallAt(
}
+void CodePatcher::PatchNativeCallAt(uword return_address,
+ const Code& code,
+ NativeFunction target,
+ const Code& trampoline) {
+ ASSERT(code.ContainsInstructionAt(return_address));
+ NativeCallPattern call(return_address, code);
+ call.set_target(trampoline.EntryPoint());
+ call.set_native_function(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();
+ return call.target();
+}
+
+
// This class pattern matches on a load from the object pool. Loading on
// ARM64 is complicated because it can take more than one form. We
// match backwards from the end of the sequence so we can reuse the code for
« 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