Bug 1521939 - Correct the offset for reading stack args on ARM64 (for mozilla-beta). r=bbouvier a=lizzard
authorLars T Hansen <lhansen@mozilla.com>
Thu, 28 Feb 2019 08:09:36 +0100
changeset 516218 dd3195cc539c4f909b12327443ea0ed6e5c0fcfe
parent 516217 8986082a63e66dfe130fe689d2c8bca27a2920c5
child 516219 a57747b9852b8f6990ce49a26680c723a708560b
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbouvier, lizzard
bugs1521939
milestone66.0
Bug 1521939 - Correct the offset for reading stack args on ARM64 (for mozilla-beta). r=bbouvier a=lizzard
js/src/wasm/WasmStubs.cpp
--- a/js/src/wasm/WasmStubs.cpp
+++ b/js/src/wasm/WasmStubs.cpp
@@ -1058,19 +1058,17 @@ static void FillArgumentArray(MacroAssem
           MOZ_ASSERT(type == MIRType::Float32);
           if (toValue) {
             // JS::Values can't store Float32, so convert to a Double.
             masm.convertFloat32ToDouble(srcReg, ScratchDoubleReg);
             masm.canonicalizeDouble(ScratchDoubleReg);
             masm.storeDouble(ScratchDoubleReg, dst);
           } else {
             // Preserve the NaN pattern in the input.
-            masm.moveFloat32(srcReg, ScratchFloat32Reg);
-            masm.canonicalizeFloat(ScratchFloat32Reg);
-            masm.storeFloat32(ScratchFloat32Reg, dst);
+            masm.storeFloat32(srcReg, dst);
           }
         }
         break;
       }
       case ABIArg::Stack: {
         Address src(masm.getStackPointer(),
                     offsetToCallerStackArgs + i->offsetFromArgBase());
         if (toValue) {
@@ -1396,17 +1394,17 @@ static bool GenerateImportJitExit(MacroA
   argOffset += sizeof(size_t);
   MOZ_ASSERT(argOffset == sizeOfPreFrame + frameAlignExtra);
 
   // 4. |this| value
   masm.storeValue(UndefinedValue(), Address(masm.getStackPointer(), argOffset));
   argOffset += sizeof(Value);
 
   // 5. Fill the arguments
-  unsigned offsetToCallerStackArgs = jitFramePushed + sizeof(Frame);
+  unsigned offsetToCallerStackArgs = jitFramePushed + sizeof(Frame) + frameAlignExtra;
   FillArgumentArray(masm, fi.funcType().args(), argOffset,
                     offsetToCallerStackArgs, scratch, ToValue(true));
   argOffset += fi.funcType().args().length() * sizeof(Value);
   MOZ_ASSERT(argOffset == sizeOfThisAndArgs + sizeOfPreFrame + frameAlignExtra);
 
   // 6. Check if we need to rectify arguments
   masm.load16ZeroExtend(Address(callee, JSFunction::offsetOfNargs()), scratch);