Issue #3049 - Wire loongarch64 non-Ion frame and patch hooks

This commit is contained in:
Basilisk-Dev 2026-04-23 19:16:28 -04:00 committed by wuggy
commit acea3a2b6b
3 changed files with 27 additions and 0 deletions

View file

@ -2539,6 +2539,13 @@ MachineState::FromBailout(RegisterDump::GPRArray& regs, RegisterDump::FPUArray&
machine.setRegisterLocation(FloatRegister(i, FloatRegisters::Double), &fpregs[i]);
machine.setRegisterLocation(FloatRegister(i, FloatRegisters::Single), &fpregs[i]);
}
#elif defined(JS_CODEGEN_LOONGARCH64)
for (unsigned i = 0; i < FloatRegisters::TotalPhys; i++) {
machine.setRegisterLocation(FloatRegister(FloatRegister::Encoding(i), FloatRegisters::Double),
&fpregs[i]);
machine.setRegisterLocation(FloatRegister(FloatRegister::Encoding(i), FloatRegisters::Single),
&fpregs[i]);
}
#elif defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64)
for (unsigned i = 0; i < FloatRegisters::TotalPhys; i++) {
machine.setRegisterLocation(FloatRegister(i, FloatRegisters::Single), &fpregs[i]);

View file

@ -19,6 +19,14 @@ using mozilla::DebugOnly;
using namespace js;
using namespace js::jit;
void js::jit::PatchJump(CodeLocationJump& jump_, CodeLocationLabel label,
ReprotectCode reprotect) {
(void)jump_;
(void)label;
(void)reprotect;
MOZ_CRASH("Ion patching is not supported on loongarch64");
}
// Note this is used for inter-wasm calls and may pass arguments and results
// in floating point registers even if the system ABI does not.

View file

@ -12,6 +12,7 @@
#include "jit/CompactBuffer.h"
#include "jit/IonCode.h"
#include "jit/JitCompartment.h"
#include "jit/JitSpewer.h"
#include "jit/loongarch64/Architecture-loongarch64.h"
#include "jit/shared/Assembler-shared.h"
@ -1448,6 +1449,7 @@ class AssemblerLOONGARCH64 : public AssemblerShared {
return false;
#endif
}
static bool SupportsSimd() { return false; }
static bool SupportsUnalignedAccesses() { return true; }
static bool SupportsFastUnalignedFPAccesses() { return true; }
@ -1882,6 +1884,16 @@ static inline bool GetTempRegForIntArg(uint32_t usedIntArgs,
return true;
}
void PatchJump(CodeLocationJump& jump_, CodeLocationLabel label,
ReprotectCode reprotect = DontReprotect);
static inline void PatchBackedge(CodeLocationJump& jump_,
CodeLocationLabel label,
JitRuntime::BackedgeTarget target) {
(void)target;
PatchJump(jump_, label);
}
} // namespace jit
} // namespace js