Fix ScratchRegister usage on x86_64
authorLars Knoll <lars.knoll@digia.com>
Sun, 21 Oct 2012 16:22:26 +0000 (18:22 +0200)
committerSimon Hausmann <simon.hausmann@digia.com>
Mon, 22 Oct 2012 09:22:51 +0000 (11:22 +0200)
r11 is already being used quite a bit internally in
the macro assembler, leading to collisions and crashes.
Rather use r10 for most scratch operations.

Change-Id: I27bbbf825ca0e90af4ec85b8da12c25ae8ca00df
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
qv4isel_masm_p.h

index e2242e1..7d0b81a 100644 (file)
@@ -92,7 +92,8 @@ protected:
     static const RegisterID StackPointerRegister = JSC::X86Registers::esp;
     static const RegisterID ContextRegister = JSC::X86Registers::r14;
     static const RegisterID ReturnValueRegister = JSC::X86Registers::eax;
-    static const RegisterID ScratchRegister = JSC::MacroAssemblerX86Common::scratchRegister; // r11
+    static const RegisterID ScratchRegister = JSC::X86Registers::r10;
+    static const RegisterID ScratchRegister2 = JSC::X86Registers::r11;
     static const FPRegisterID FPGpr0 = JSC::X86Registers::xmm0;
 
     static const int RegisterSize = 8;
@@ -280,7 +281,7 @@ private:
     void storeArgument(RegisterID src, IR::Temp *temp)
     {
         if (temp) {
-            Pointer addr = loadTempAddress(ScratchRegister, temp);
+            Pointer addr = loadTempAddress(ScratchRegister2, temp);
 #ifdef VALUE_FITS_IN_REGISTER
             storePtr(src, addr);
 #else