commit 696cbdd758e921775adc1628e784faaac4f5c540
parent 147f2316380c2b808b37c7a65b2eee69b796619a
Author: Iain Ireland <iireland@mozilla.com>
Date: Thu, 27 Nov 2025 21:04:49 +0000
Bug 2000328: Remove unused argument from emitPreBarrierFastPath r=jandem
Bug 1740745 removed the last use of this argument.
Driveby: remove unnecessary arch-specific code
Differential Revision: https://phabricator.services.mozilla.com/D273672
Diffstat:
9 files changed, 19 insertions(+), 42 deletions(-)
diff --git a/js/src/jit/MacroAssembler.cpp b/js/src/jit/MacroAssembler.cpp
@@ -8067,13 +8067,19 @@ void MacroAssembler::nopPatchableToCall(const wasm::CallSiteDesc& desc) {
append(desc, offset);
}
-void MacroAssembler::emitPreBarrierFastPath(JSRuntime* rt, MIRType type,
- Register temp1, Register temp2,
- Register temp3, Label* noBarrier) {
+void MacroAssembler::emitPreBarrierFastPath(MIRType type, Register temp1,
+ Register temp2, Register temp3,
+ Label* noBarrier) {
MOZ_ASSERT(temp1 != PreBarrierReg);
MOZ_ASSERT(temp2 != PreBarrierReg);
MOZ_ASSERT(temp3 != PreBarrierReg);
+#ifdef JS_CODEGEN_X64
+ MOZ_ASSERT(temp3 == rcx);
+#elif JS_CODEGEN_X86
+ MOZ_ASSERT(temp3 == ecx);
+#endif
+
// Load the GC thing in temp1.
if (type == MIRType::Value) {
unboxGCThingForGCBarrier(Address(PreBarrierReg, 0), temp1);
@@ -8150,29 +8156,7 @@ void MacroAssembler::emitPreBarrierFastPath(JSRuntime* rt, MIRType type,
// mask = uintptr_t(1) << (bit % WordBits);
andPtr(Imm32(gc::ChunkMarkBitmap::BitsPerWord - 1), temp3);
move32(Imm32(1), temp1);
-#ifdef JS_CODEGEN_X64
- MOZ_ASSERT(temp3 == rcx);
- shlq_cl(temp1);
-#elif JS_CODEGEN_X86
- MOZ_ASSERT(temp3 == ecx);
- shll_cl(temp1);
-#elif JS_CODEGEN_ARM
- ma_lsl(temp3, temp1, temp1);
-#elif JS_CODEGEN_ARM64
- Lsl(ARMRegister(temp1, 64), ARMRegister(temp1, 64), ARMRegister(temp3, 64));
-#elif JS_CODEGEN_MIPS64
- ma_dsll(temp1, temp1, temp3);
-#elif JS_CODEGEN_LOONG64
- as_sll_d(temp1, temp1, temp3);
-#elif JS_CODEGEN_RISCV64
- sll(temp1, temp1, temp3);
-#elif JS_CODEGEN_WASM32
- MOZ_CRASH();
-#elif JS_CODEGEN_NONE
- MOZ_CRASH();
-#else
-# error "Unknown architecture"
-#endif
+ lshiftPtr(temp3, temp1);
// No barrier is needed if the bit is set, |word & mask != 0|.
branchTestPtr(Assembler::NonZero, temp2, temp1, noBarrier);
diff --git a/js/src/jit/MacroAssembler.h b/js/src/jit/MacroAssembler.h
@@ -4191,8 +4191,8 @@ class MacroAssembler : public MacroAssemblerSpecific {
// ========================================================================
// Barrier functions.
- void emitPreBarrierFastPath(JSRuntime* rt, MIRType type, Register temp1,
- Register temp2, Register temp3, Label* noBarrier);
+ void emitPreBarrierFastPath(MIRType type, Register temp1, Register temp2,
+ Register temp3, Label* noBarrier);
public:
// ========================================================================
diff --git a/js/src/jit/arm/Trampoline-arm.cpp b/js/src/jit/arm/Trampoline-arm.cpp
@@ -545,8 +545,7 @@ uint32_t JitRuntime::generatePreBarrier(JSContext* cx, MacroAssembler& masm,
masm.push(temp3);
Label noBarrier;
- masm.emitPreBarrierFastPath(cx->runtime(), type, temp1, temp2, temp3,
- &noBarrier);
+ masm.emitPreBarrierFastPath(type, temp1, temp2, temp3, &noBarrier);
// Call into C++ to mark this GC thing.
masm.pop(temp3);
diff --git a/js/src/jit/arm64/Trampoline-arm64.cpp b/js/src/jit/arm64/Trampoline-arm64.cpp
@@ -663,8 +663,7 @@ uint32_t JitRuntime::generatePreBarrier(JSContext* cx, MacroAssembler& masm,
masm.push(temp3);
Label noBarrier;
- masm.emitPreBarrierFastPath(cx->runtime(), type, temp1, temp2, temp3,
- &noBarrier);
+ masm.emitPreBarrierFastPath(type, temp1, temp2, temp3, &noBarrier);
// Call into C++ to mark this GC thing.
masm.pop(temp3);
diff --git a/js/src/jit/loong64/Trampoline-loong64.cpp b/js/src/jit/loong64/Trampoline-loong64.cpp
@@ -490,8 +490,7 @@ uint32_t JitRuntime::generatePreBarrier(JSContext* cx, MacroAssembler& masm,
masm.push(temp3);
Label noBarrier;
- masm.emitPreBarrierFastPath(cx->runtime(), type, temp1, temp2, temp3,
- &noBarrier);
+ masm.emitPreBarrierFastPath(type, temp1, temp2, temp3, &noBarrier);
// Call into C++ to mark this GC thing.
masm.pop(temp3);
diff --git a/js/src/jit/mips64/Trampoline-mips64.cpp b/js/src/jit/mips64/Trampoline-mips64.cpp
@@ -519,8 +519,7 @@ uint32_t JitRuntime::generatePreBarrier(JSContext* cx, MacroAssembler& masm,
masm.push(temp3);
Label noBarrier;
- masm.emitPreBarrierFastPath(cx->runtime(), type, temp1, temp2, temp3,
- &noBarrier);
+ masm.emitPreBarrierFastPath(type, temp1, temp2, temp3, &noBarrier);
// Call into C++ to mark this GC thing.
masm.pop(temp3);
diff --git a/js/src/jit/riscv64/Trampoline-riscv64.cpp b/js/src/jit/riscv64/Trampoline-riscv64.cpp
@@ -403,8 +403,7 @@ uint32_t JitRuntime::generatePreBarrier(JSContext* cx, MacroAssembler& masm,
masm.push(temp3);
Label noBarrier;
- masm.emitPreBarrierFastPath(cx->runtime(), type, temp1, temp2, temp3,
- &noBarrier);
+ masm.emitPreBarrierFastPath(type, temp1, temp2, temp3, &noBarrier);
// Call into C++ to mark this GC thing.
masm.pop(temp3);
diff --git a/js/src/jit/x64/Trampoline-x64.cpp b/js/src/jit/x64/Trampoline-x64.cpp
@@ -545,8 +545,7 @@ uint32_t JitRuntime::generatePreBarrier(JSContext* cx, MacroAssembler& masm,
masm.push(temp3);
Label noBarrier;
- masm.emitPreBarrierFastPath(cx->runtime(), type, temp1, temp2, temp3,
- &noBarrier);
+ masm.emitPreBarrierFastPath(type, temp1, temp2, temp3, &noBarrier);
// Call into C++ to mark this GC thing.
masm.pop(temp3);
diff --git a/js/src/jit/x86/Trampoline-x86.cpp b/js/src/jit/x86/Trampoline-x86.cpp
@@ -473,8 +473,7 @@ uint32_t JitRuntime::generatePreBarrier(JSContext* cx, MacroAssembler& masm,
masm.push(temp3);
Label noBarrier;
- masm.emitPreBarrierFastPath(cx->runtime(), type, temp1, temp2, temp3,
- &noBarrier);
+ masm.emitPreBarrierFastPath(type, temp1, temp2, temp3, &noBarrier);
// Call into C++ to mark this GC thing.
masm.pop(temp3);