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

Unified Diff: runtime/vm/stub_code_arm.cc

Issue 602993002: Frees up LR on arm for use by the register allocator. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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
Index: runtime/vm/stub_code_arm.cc
===================================================================
--- runtime/vm/stub_code_arm.cc (revision 40650)
+++ runtime/vm/stub_code_arm.cc (working copy)
@@ -476,9 +476,25 @@
bool preserve_result) {
// DeoptimizeCopyFrame expects a Dart frame, i.e. EnterDartFrame(0), but there
// is no need to set the correct PC marker or load PP, since they get patched.
- __ mov(IP, Operand(LR));
- __ mov(LR, Operand(0));
- __ EnterFrame((1 << PP) | (1 << FP) | (1 << IP) | (1 << LR), 0);
+
+ // IP has the potentially live LR value. LR was clobbered by the call with
+ // the return address, so move it into IP to set up the Dart frame.
+ __ eor(IP, IP, Operand(LR));
+ __ eor(LR, IP, Operand(LR));
+ __ eor(IP, IP, Operand(LR));
+
+ // Set up the frame manually. We can't use EnterFrame because we can't
+ // clobber LR (or any other register) with 0, yet.
+ __ sub(SP, SP, Operand(kWordSize)); // Make room for PC marker of 0.
+ __ Push(IP); // Push return address.
+ __ Push(FP);
+ __ mov(FP, Operand(SP));
+ __ Push(PP);
+ // Now that IP holding the return address has been written to the stack,
+ // we can clobber it with 0 to write the null PC marker.
+ __ mov(IP, Operand(0));
+ __ str(IP, Address(SP, +3 * kWordSize));
+
// The code in this frame may not cause GC. kDeoptimizeCopyFrameRuntimeEntry
// and kDeoptimizeFillFrameRuntimeEntry are leaf runtime calls.
const intptr_t saved_result_slot_from_fp =
« runtime/vm/intermediate_language_arm.cc ('K') | « runtime/vm/intermediate_language_arm.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698