diff --git a/js/src/jit/loongarch64/MacroAssembler-loongarch64-inl.h b/js/src/jit/loongarch64/MacroAssembler-loongarch64-inl.h index 944baf6c9a..d4d83d0daa 100644 --- a/js/src/jit/loongarch64/MacroAssembler-loongarch64-inl.h +++ b/js/src/jit/loongarch64/MacroAssembler-loongarch64-inl.h @@ -1442,6 +1442,12 @@ void MacroAssembler::wasmBoundsCheck(Condition cond, Register index, L label) { MOZ_CRASH("wasm bounds checks are not supported on loongarch64 yet"); } +void MacroAssembler::wasmPatchBoundsCheck(uint8_t* patchAt, uint32_t limit) { + (void)patchAt; + (void)limit; + MOZ_CRASH("wasm bounds checks are not supported on loongarch64 yet"); +} + void MacroAssembler::memoryBarrier(MemoryBarrierBits barrier) { if (barrier == MembarNobits) { return; diff --git a/js/src/jit/loongarch64/MacroAssembler-loongarch64.cpp b/js/src/jit/loongarch64/MacroAssembler-loongarch64.cpp index 3cd5fb5d91..a6a173220d 100644 --- a/js/src/jit/loongarch64/MacroAssembler-loongarch64.cpp +++ b/js/src/jit/loongarch64/MacroAssembler-loongarch64.cpp @@ -22,6 +22,33 @@ namespace js { namespace jit { +void MacroAssembler::alignFrameForICArguments(AfterICSaveLive& aic) { + if (framePushed() % ABIStackAlignment != 0) { + aic.alignmentPadding = ABIStackAlignment - (framePushed() % ABIStackAlignment); + reserveStack(aic.alignmentPadding); + } else { + aic.alignmentPadding = 0; + } + MOZ_ASSERT(framePushed() % ABIStackAlignment == 0); +} + +void MacroAssembler::restoreFrameAlignmentForICArguments(AfterICSaveLive& aic) { + if (aic.alignmentPadding != 0) { + freeStack(aic.alignmentPadding); + } +} + +FrameSizeClass FrameSizeClass::FromDepth(uint32_t frameDepth) { + (void)frameDepth; + return FrameSizeClass::None(); +} + +FrameSizeClass FrameSizeClass::ClassLimit() { return FrameSizeClass(0); } + +uint32_t FrameSizeClass::frameSize() const { + MOZ_CRASH("loongarch64 does not use frame size classes"); +} + void MacroAssembler::clampDoubleToUint8(FloatRegister input, Register output) { ScratchRegisterScope scratch(asMasm()); ScratchDoubleScope fpscratch(asMasm()); @@ -2409,6 +2436,27 @@ void MacroAssembler::patchFarJump(CodeOffset farJump, uint32_t targetOffset) { *u32 = targetOffset - farJump.offset(); } +void MacroAssembler::repatchFarJump(uint8_t* code, uint32_t farJumpOffset, + uint32_t targetOffset) { + uint32_t* u32 = reinterpret_cast(code + farJumpOffset); + *u32 = targetOffset - farJumpOffset; +} + +CodeOffset MacroAssembler::nopPatchableToNearJump() { + MOZ_CRASH("wasm patchable jumps are not supported on loongarch64"); +} + +void MacroAssembler::patchNopToNearJump(uint8_t* jump, uint8_t* target) { + (void)jump; + (void)target; + MOZ_CRASH("wasm patchable jumps are not supported on loongarch64"); +} + +void MacroAssembler::patchNearJumpToNop(uint8_t* jump) { + (void)jump; + MOZ_CRASH("wasm patchable jumps are not supported on loongarch64"); +} + void MacroAssembler::call(wasm::SymbolicAddress target) { movePtr(target, CallReg); call(CallReg); diff --git a/js/src/wasm/WasmStubs.cpp b/js/src/wasm/WasmStubs.cpp index 7fd674826a..40704c93dd 100644 --- a/js/src/wasm/WasmStubs.cpp +++ b/js/src/wasm/WasmStubs.cpp @@ -21,6 +21,7 @@ #include "mozilla/ArrayUtils.h" #include "wasm/WasmCode.h" +#include "wasm/WasmBaselineCompile.h" #include "wasm/WasmIonCompile.h" #include "jit/MacroAssembler-inl.h" @@ -1098,3 +1099,21 @@ wasm::GenerateThrowStub(MacroAssembler& masm, Label* throwLabel) offsets.end = masm.currentOffset(); return offsets; } + +#if defined(JS_CODEGEN_LOONGARCH64) + +bool +js::wasm::BaselineCanCompile(const FunctionGenerator* fg) +{ + (void)fg; + return false; +} + +bool +js::wasm::CompileFunction(IonCompileTask* task) +{ + (void)task; + return false; +} + +#endif