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

Unified Diff: runtime/vm/assembler_arm.cc

Issue 12439005: Implement leaf runtime call stub on ARM and corresponding call redirection (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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_arm.h ('k') | runtime/vm/code_patcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_arm.cc
===================================================================
--- runtime/vm/assembler_arm.cc (revision 19723)
+++ runtime/vm/assembler_arm.cc (working copy)
@@ -1398,10 +1398,21 @@
void Assembler::Branch(const ExternalLabel* label, Condition cond) {
LoadImmediate(IP, label->address(), cond); // Address is never patched.
- mov(PC, ShifterOperand(IP), cond);
+ bx(IP, cond);
}
+void Assembler::BranchPatchable(const ExternalLabel* label) {
+ // Use a fixed size code sequence, since a function prologue may be patched
+ // with this branch sequence.
+ // Contrarily to BranchLinkPatchable, BranchPatchable requires an instruction
+ // cache flush upon patching.
+ movw(IP, Utils::Low16Bits(label->address()));
+ movt(IP, Utils::High16Bits(label->address()));
+ bx(IP);
+}
+
+
void Assembler::BranchLink(const ExternalLabel* label) {
LoadImmediate(IP, label->address()); // Target address is never patched.
blx(IP); // Use blx instruction so that the return branch prediction works.
« no previous file with comments | « runtime/vm/assembler_arm.h ('k') | runtime/vm/code_patcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698