Issue #3049 - Fix LoongArch minimal JIT return path

This commit is contained in:
Basilisk-Dev 2026-04-22 23:13:21 -04:00 committed by wuggy
commit 13a37bf023
2 changed files with 19 additions and 1 deletions

View file

@ -16,6 +16,14 @@ function unsupported(a, b) {
return a + (b + 0.5);
}
function largeResult(a) {
return a + 300;
}
function negativeResult(a) {
return a - 300;
}
for (var i = 0; i < 100; i++) {
assertEq(add(i, i + 1), (i + i + 1));
assertEq(withLocal(i, 7), i + 7);
@ -23,6 +31,8 @@ for (var i = 0; i < 100; i++) {
assertEq(overflow(2147483647, 1), 2147483648);
assertEq(unsupported(2, 3), 5.5);
assertEq(largeResult(7), 307);
assertEq(negativeResult(7), -293);
(function testPropertyWrappers() {
function getX(obj) { return obj.x; }

View file

@ -261,7 +261,8 @@ class MinimalLoongArchCompiler
}
bool emitReturn(LoongArchReg result) {
if (!emit(EncodeUnsignedImm12(0x29000000, result, a2, 0)))
// Write the full int32 result back to the out-parameter.
if (!emit(EncodeUnsignedImm12(0x29800000, result, a2, 0)))
return false;
if (!emit(EncodeImm12(0x02800000, a0, zero, 1)))
return false;
@ -801,4 +802,11 @@ js::jit::TryEnterLoongArchMinimalJit(JSContext*, RunState&)
return false;
}
bool
js::jit::TryCallLoongArchMinimalJit(JSContext*, HandleFunction, const CallArgs&, bool* handled)
{
*handled = false;
return true;
}
#endif