Bug 871783 - Do not copy the stack pointer for alignment checks. r=nbp
authorDan Gohman <sunfish@google.com>
Tue, 14 May 2013 13:44:43 -0700
changeset 131953 4667ec13bb63766ee8c694e801491d10949c209a
parent 131952 04155dec2ead2dbc7bc13192d200785213d2476b
child 131954 f5e13f8aa8cfafcdcdb3e845b3db76aa865fbf72
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersnbp
bugs871783
milestone24.0a1
Bug 871783 - Do not copy the stack pointer for alignment checks. r=nbp Test the stack pointer directly instead of copying it to a temporary register. This is debug-only code, but tidiness is nice.
js/src/ion/x64/MacroAssembler-x64.cpp
js/src/ion/x86/MacroAssembler-x86.cpp
--- a/js/src/ion/x64/MacroAssembler-x64.cpp
+++ b/js/src/ion/x64/MacroAssembler-x64.cpp
@@ -115,18 +115,17 @@ MacroAssemblerX64::callWithABIPre(uint32
         MoveEmitter emitter(*this);
         emitter.emit(moveResolver_);
         emitter.finish();
     }
 
 #ifdef DEBUG
     {
         Label good;
-        movl(rsp, rax);
-        testq(rax, Imm32(StackAlignment - 1));
+        testq(rsp, Imm32(StackAlignment - 1));
         j(Equal, &good);
         breakpoint();
         bind(&good);
     }
 #endif
 }
 
 void
--- a/js/src/ion/x86/MacroAssembler-x86.cpp
+++ b/js/src/ion/x86/MacroAssembler-x86.cpp
@@ -144,18 +144,17 @@ MacroAssemblerX86::callWithABIPre(uint32
         emitter.emit(moveResolver_);
         emitter.finish();
     }
 
 #ifdef DEBUG
     {
         // Check call alignment.
         Label good;
-        movl(esp, eax);
-        testl(eax, Imm32(StackAlignment - 1));
+        testl(esp, Imm32(StackAlignment - 1));
         j(Equal, &good);
         breakpoint();
         bind(&good);
     }
 #endif
 }
 
 void