diff --git a/js/src/ion/AsmJS.cpp b/js/src/ion/AsmJS.cpp index f31aa739fe0b..33ff4f8b6a46 100644 --- a/js/src/ion/AsmJS.cpp +++ b/js/src/ion/AsmJS.cpp @@ -5772,7 +5772,12 @@ GenerateFFIIonExit(ModuleCompiler &m, const ModuleCompiler::ExitDescriptor &exit // 5. Fill the arguments unsigned offsetToArgs = 3 * sizeof(size_t) + sizeof(Value); - unsigned offsetToCallerStackArgs = NativeFrameSize + masm.framePushed(); + unsigned offsetToCallerStackArgs = masm.framePushed(); +#if defined(JS_CPU_X86) || defined(JS_CPU_X64) + offsetToCallerStackArgs += NativeFrameSize; +#else + offsetToCallerStackArgs += ShadowStackSpace; +#endif FillArgumentArray(m, exit.argTypes(), offsetToArgs, offsetToCallerStackArgs, scratch); // Get the pointer to the ion code