Bug 1917807 - Fix GenerateJitEntry call parameters alignment. r=jandem

Differential Revision: https://phabricator.services.mozilla.com/D221868
This commit is contained in:
Yury Delendik 2024-09-13 17:07:58 +00:00
Родитель 97967b0ece
Коммит 684cad8813
1 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -944,15 +944,18 @@ static bool GenerateJitEntry(MacroAssembler& masm, size_t funcExportIndex,
MOZ_ASSERT(masm.framePushed() == 0);
// Avoid overlapping aligned stack arguments area with ExitFooterFrame.
const unsigned AlignedExitFooterFrameSize =
AlignBytes(ExitFooterFrame::Size(), WasmStackAlignment);
unsigned normalBytesNeeded =
ExitFooterFrame::Size() + StackArgBytesForWasmABI(funcType);
AlignedExitFooterFrameSize + StackArgBytesForWasmABI(funcType);
MIRTypeVector coerceArgTypes;
MOZ_ALWAYS_TRUE(coerceArgTypes.append(MIRType::Int32));
MOZ_ALWAYS_TRUE(coerceArgTypes.append(MIRType::Pointer));
MOZ_ALWAYS_TRUE(coerceArgTypes.append(MIRType::Pointer));
unsigned oolBytesNeeded =
ExitFooterFrame::Size() + StackArgBytesForWasmABI(coerceArgTypes);
AlignedExitFooterFrameSize + StackArgBytesForWasmABI(coerceArgTypes);
unsigned bytesNeeded = std::max(normalBytesNeeded, oolBytesNeeded);