Bug 1071444: Return stack offset before incrementing it for win64 args; r=luke
authorBenjamin Bouvier <benj@benj.me>
Wed, 24 Sep 2014 16:01:42 +0200
changeset 222490 d6710f2fc838d71df51db08ae231fe08ce176509
parent 222489 6c5cf0e394adf47d7a578c425510aa6bb42fa306
child 222491 8e746619502b6de2879ca18113c32d10c56c0e4d
push id7107
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 17:43:31 +0000
treeherdermozilla-aurora@b4b34e0acc75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs1071444
milestone35.0a1
Bug 1071444: Return stack offset before incrementing it for win64 args; r=luke
js/src/asmjs/AsmJSValidate.cpp
js/src/jit/x64/Assembler-x64.cpp
--- a/js/src/asmjs/AsmJSValidate.cpp
+++ b/js/src/asmjs/AsmJSValidate.cpp
@@ -7015,17 +7015,17 @@ GenerateEntry(ModuleCompiler &m, unsigne
     // effective addresses).
 #if defined(JS_CODEGEN_X64) || defined(JS_CODEGEN_ARM) || defined(JS_CODEGEN_MIPS)
     masm.loadPtr(Address(IntArgReg1, AsmJSModule::heapGlobalDataOffset()), HeapReg);
 #endif
 
     // Put the 'argv' argument into a non-argument/return register so that we
     // can use 'argv' while we fill in the arguments for the asm.js callee.
     // Also, save 'argv' on the stack so that we can recover it after the call.
-    // Use a second non-argument/return register as temporary scratch. 
+    // Use a second non-argument/return register as temporary scratch.
     Register argv = ABIArgGenerator::NonArgReturnReg0;
     Register scratch = ABIArgGenerator::NonArgReturnReg1;
 #if defined(JS_CODEGEN_X86)
     masm.loadPtr(Address(StackPointer, EntryFrameSize + masm.framePushed()), argv);
 #else
     masm.movePtr(IntArgReg0, argv);
 #endif
     masm.Push(argv);
--- a/js/src/jit/x64/Assembler-x64.cpp
+++ b/js/src/jit/x64/Assembler-x64.cpp
@@ -33,18 +33,18 @@ ABIArgGenerator::next(MIRType type)
         if (IsSimdType(type)) {
             // On Win64, >64 bit args need to be passed by reference, but asm.js
             // doesn't allow passing SIMD values to FFIs. The only way to reach
             // here is asm to asm calls, so we can break the ABI here.
             stackOffset_ = AlignBytes(stackOffset_, SimdStackAlignment);
             current_ = ABIArg(stackOffset_);
             stackOffset_ += Simd128DataSize;
         } else {
+            current_ = ABIArg(stackOffset_);
             stackOffset_ += sizeof(uint64_t);
-            current_ = ABIArg(stackOffset_);
         }
         return current_;
     }
     switch (type) {
       case MIRType_Int32:
       case MIRType_Pointer:
         current_ = ABIArg(IntArgRegs[regIndex_++]);
         break;