Prefer r0 as TOS when performing virtual frame dup on ARM
authorsgjesse@chromium.org <sgjesse@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 5 May 2010 09:11:21 +0000 (09:11 +0000)
committersgjesse@chromium.org <sgjesse@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 5 May 2010 09:11:21 +0000 (09:11 +0000)
Review URL: http://codereview.chromium.org/1956004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4590 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/arm/virtual-frame-arm.cc

index bf5cff2..e432c59 100644 (file)
@@ -505,21 +505,25 @@ void VirtualFrame::Dup() {
       break;
     case R0_TOS:
       __ mov(r1, r0);
+      // r0 and r1 contains the same value. Prefer a state with r0 holding TOS.
       top_of_stack_state_ = R0_R1_TOS;
       break;
     case R1_TOS:
       __ mov(r0, r1);
+      // r0 and r1 contains the same value. Prefer a state with r0 holding TOS.
       top_of_stack_state_ = R0_R1_TOS;
       break;
     case R0_R1_TOS:
       __ push(r1);
       __ mov(r1, r0);
-      // No need to change state as r0 and r1 now contains the same value.
+      // r0 and r1 contains the same value. Prefer a state with r0 holding TOS.
+      top_of_stack_state_ = R0_R1_TOS;
       break;
     case R1_R0_TOS:
       __ push(r0);
       __ mov(r0, r1);
-      // No need to change state as r0 and r1 now contains the same value.
+      // r0 and r1 contains the same value. Prefer a state with r0 holding TOS.
+      top_of_stack_state_ = R0_R1_TOS;
       break;
     default:
       UNREACHABLE();