Bug 1763592 part 1 - Make setupAlignedABICall work on ARM64. r=iain

This just works nowadays. Wasm already uses aligned ABI calls via setupWasmABICall
as well.

Also add a missing assertion to callWithABIPre to match other platforms.

Differential Revision: https://phabricator.services.mozilla.com/D143152
This commit is contained in:
Jan de Mooij 2022-04-09 11:35:51 +00:00
Родитель d6349e9ab2
Коммит 23bbb257ed
3 изменённых файлов: 8 добавлений и 7 удалений

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

@ -3077,10 +3077,6 @@ void MacroAssembler::setupAlignedABICall() {
MOZ_ASSERT(!IsCompilingWasm(), "wasm should use setupWasmABICall");
setupNativeABICall();
dynamicAlignment_ = false;
#if defined(JS_CODEGEN_ARM64)
MOZ_CRASH("Not supported on arm64");
#endif
}
void MacroAssembler::passABIArg(const MoveOperand& from, MoveOp::Type type) {

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

@ -722,14 +722,17 @@ class MacroAssembler : public MacroAssemblerSpecific {
// accordingly.
// Setup a call to C/C++ code, given the assumption that the framePushed
// accruately define the state of the stack, and that the top of the stack
// accurately defines the state of the stack, and that the top of the stack
// was properly aligned. Note that this only supports cdecl.
void setupAlignedABICall(); // CRASH_ON(arm64)
//
// As a rule of thumb, this can be used in CodeGenerator but not in CacheIR or
// Baseline code (because the stack is not aligned to ABIStackAlignment).
void setupAlignedABICall();
// As setupAlignedABICall, but for WebAssembly native ABI calls, which pass
// through a builtin thunk that uses the wasm ABI. All the wasm ABI calls
// can be native, since we always know the stack alignment a priori.
void setupWasmABICall(); // CRASH_ON(arm64)
void setupWasmABICall();
// Setup an ABI call for when the alignment is not known. This may need a
// scratch register.

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

@ -1507,6 +1507,8 @@ void MacroAssembler::callWithABIPre(uint32_t* stackAdjust, bool callFromWasm) {
// the MacroAssembler::call methods generate a sync before the call.
// Removing it does not cause any failures for all of jit-tests.
syncStackPtr();
assertStackAlignment(ABIStackAlignment);
}
void MacroAssembler::callWithABIPost(uint32_t stackAdjust, MoveOp::Type result,