diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:37 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:37 +0000 |
commit | a90a5cba08fdf6c0ceb95101c275108a152a3aed (patch) | |
tree | 532507288f3defd7f4dcf1af49698bcb76034855 /js/src/jit/Lowering.cpp | |
parent | Adding debian version 126.0.1-1. (diff) | |
download | firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.tar.xz firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.zip |
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/jit/Lowering.cpp')
-rw-r--r-- | js/src/jit/Lowering.cpp | 79 |
1 files changed, 66 insertions, 13 deletions
diff --git a/js/src/jit/Lowering.cpp b/js/src/jit/Lowering.cpp index f7b898f240..f84ed576b4 100644 --- a/js/src/jit/Lowering.cpp +++ b/js/src/jit/Lowering.cpp @@ -654,7 +654,6 @@ void LIRGenerator::visitApplyArgs(MApplyArgs* apply) { static_assert(CallTempReg2 != JSReturnReg_Type); static_assert(CallTempReg2 != JSReturnReg_Data); - auto function = useFixedAtStart(apply->getFunction(), CallTempReg3); auto argc = useFixedAtStart(apply->getArgc(), CallTempReg0); auto thisValue = useBoxFixedAtStart(apply->getThis(), CallTempReg4, CallTempReg5); @@ -665,9 +664,13 @@ void LIRGenerator::visitApplyArgs(MApplyArgs* apply) { LInstruction* lir; if (target && target->isNativeWithoutJitEntry()) { + auto temp = tempFixed(CallTempReg3); + lir = new (alloc()) - LApplyArgsNative(function, argc, thisValue, tempObj, tempCopy); + LApplyArgsNative(argc, thisValue, tempObj, tempCopy, temp); } else { + auto function = useFixedAtStart(apply->getFunction(), CallTempReg3); + lir = new (alloc()) LApplyArgsGeneric(function, argc, thisValue, tempObj, tempCopy); } @@ -686,7 +689,6 @@ void LIRGenerator::visitApplyArgsObj(MApplyArgsObj* apply) { static_assert(CallTempReg2 != JSReturnReg_Type); static_assert(CallTempReg2 != JSReturnReg_Data); - auto function = useFixedAtStart(apply->getFunction(), CallTempReg3); auto argsObj = useFixedAtStart(apply->getArgsObj(), CallTempReg0); auto thisValue = useBoxFixedAtStart(apply->getThis(), CallTempReg4, CallTempReg5); @@ -697,9 +699,13 @@ void LIRGenerator::visitApplyArgsObj(MApplyArgsObj* apply) { LInstruction* lir; if (target && target->isNativeWithoutJitEntry()) { + auto temp = tempFixed(CallTempReg3); + lir = new (alloc()) - LApplyArgsObjNative(function, argsObj, thisValue, tempObj, tempCopy); + LApplyArgsObjNative(argsObj, thisValue, tempObj, tempCopy, temp); } else { + auto function = useFixedAtStart(apply->getFunction(), CallTempReg3); + lir = new (alloc()) LApplyArgsObj(function, argsObj, thisValue, tempObj, tempCopy); } @@ -718,7 +724,6 @@ void LIRGenerator::visitApplyArray(MApplyArray* apply) { static_assert(CallTempReg2 != JSReturnReg_Type); static_assert(CallTempReg2 != JSReturnReg_Data); - auto function = useFixedAtStart(apply->getFunction(), CallTempReg3); auto elements = useFixedAtStart(apply->getElements(), CallTempReg0); auto thisValue = useBoxFixedAtStart(apply->getThis(), CallTempReg4, CallTempReg5); @@ -729,9 +734,13 @@ void LIRGenerator::visitApplyArray(MApplyArray* apply) { LInstruction* lir; if (target && target->isNativeWithoutJitEntry()) { + auto temp = tempFixed(CallTempReg3); + lir = new (alloc()) - LApplyArrayNative(function, elements, thisValue, tempObj, tempCopy); + LApplyArrayNative(elements, thisValue, tempObj, tempCopy, temp); } else { + auto function = useFixedAtStart(apply->getFunction(), CallTempReg3); + lir = new (alloc()) LApplyArrayGeneric(function, elements, thisValue, tempObj, tempCopy); } @@ -754,7 +763,6 @@ void LIRGenerator::visitConstructArgs(MConstructArgs* mir) { static_assert(CallTempReg2 != JSReturnReg_Type); static_assert(CallTempReg2 != JSReturnReg_Data); - auto function = useFixedAtStart(mir->getFunction(), CallTempReg3); auto argc = useFixedAtStart(mir->getArgc(), CallTempReg0); auto newTarget = useFixedAtStart(mir->getNewTarget(), CallTempReg1); auto temp = tempFixed(CallTempReg2); @@ -763,11 +771,13 @@ void LIRGenerator::visitConstructArgs(MConstructArgs* mir) { LInstruction* lir; if (target && target->isNativeWithoutJitEntry()) { - auto temp2 = tempFixed(CallTempReg4); + auto temp2 = tempFixed(CallTempReg3); + auto temp3 = tempFixed(CallTempReg4); - lir = new (alloc()) - LConstructArgsNative(function, argc, newTarget, temp, temp2); + lir = + new (alloc()) LConstructArgsNative(argc, newTarget, temp, temp2, temp3); } else { + auto function = useFixedAtStart(mir->getFunction(), CallTempReg3); auto thisValue = useBoxFixedAtStart(mir->getThis(), CallTempReg4, CallTempReg5); @@ -792,7 +802,6 @@ void LIRGenerator::visitConstructArray(MConstructArray* mir) { static_assert(CallTempReg2 != JSReturnReg_Type); static_assert(CallTempReg2 != JSReturnReg_Data); - auto function = useFixedAtStart(mir->getFunction(), CallTempReg3); auto elements = useFixedAtStart(mir->getElements(), CallTempReg0); auto newTarget = useFixedAtStart(mir->getNewTarget(), CallTempReg1); auto temp = tempFixed(CallTempReg2); @@ -801,11 +810,13 @@ void LIRGenerator::visitConstructArray(MConstructArray* mir) { LInstruction* lir; if (target && target->isNativeWithoutJitEntry()) { - auto temp2 = tempFixed(CallTempReg4); + auto temp2 = tempFixed(CallTempReg3); + auto temp3 = tempFixed(CallTempReg4); lir = new (alloc()) - LConstructArrayNative(function, elements, newTarget, temp, temp2); + LConstructArrayNative(elements, newTarget, temp, temp2, temp3); } else { + auto function = useFixedAtStart(mir->getFunction(), CallTempReg3); auto thisValue = useBoxFixedAtStart(mir->getThis(), CallTempReg4, CallTempReg5); @@ -6351,6 +6362,48 @@ void LIRGenerator::visitWasmStackResult(MWasmStackResult* ins) { add(lir, ins); } +void LIRGenerator::visitWasmStackSwitchToSuspendable( + MWasmStackSwitchToSuspendable* ins) { +#ifdef ENABLE_WASM_JSPI + auto* lir = new (alloc()) LWasmStackSwitchToSuspendable( + useFixedAtStart(ins->suspender(), ABINonArgReg0), + useFixedAtStart(ins->fn(), ABINonArgReg1), + useFixedAtStart(ins->data(), ABINonArgReg2)); + + add(lir, ins); + assignWasmSafepoint(lir); +#else + MOZ_CRASH("NYI"); +#endif +} + +void LIRGenerator::visitWasmStackSwitchToMain(MWasmStackSwitchToMain* ins) { +#ifdef ENABLE_WASM_JSPI + auto* lir = new (alloc()) + LWasmStackSwitchToMain(useFixedAtStart(ins->suspender(), ABINonArgReg0), + useFixedAtStart(ins->fn(), ABINonArgReg1), + useFixedAtStart(ins->data(), ABINonArgReg2)); + + add(lir, ins); + assignWasmSafepoint(lir); +#else + MOZ_CRASH("NYI"); +#endif +} + +void LIRGenerator::visitWasmStackContinueOnSuspendable( + MWasmStackContinueOnSuspendable* ins) { +#ifdef ENABLE_WASM_JSPI + auto* lir = new (alloc()) LWasmStackContinueOnSuspendable( + useFixedAtStart(ins->suspender(), ABINonArgReg0)); + + add(lir, ins); + assignWasmSafepoint(lir); +#else + MOZ_CRASH("NYI"); +#endif +} + template <class MWasmCallT> void LIRGenerator::visitWasmCall(MWasmCallT ins) { bool needsBoundsCheck = true; |