tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 4ef5ff63b2fd3ec569436a7016b64d767c1a25fa
parent ad2c07b35ec9ac10030b63aa9e896538fad5ebd3
Author: Rong "Mantle" Bao <webmaster@csmantle.top>
Date:   Mon,  5 Jan 2026 15:30:18 +0000

Bug 2008301 - [loong64] Part 1: Defer scratch allocation in demanding atomic ops for loong64. r=jandem

Differential Revision: https://phabricator.services.mozilla.com/D277737

Diffstat:
Mjs/src/jit/loong64/MacroAssembler-loong64.cpp | 17+++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/js/src/jit/loong64/MacroAssembler-loong64.cpp b/js/src/jit/loong64/MacroAssembler-loong64.cpp @@ -3615,8 +3615,6 @@ static void CompareExchange(MacroAssembler& masm, Register valueTemp, Register offsetTemp, Register maskTemp, Register output) { UseScratchRegisterScope temps(masm); - Register scratch = temps.Acquire(); - Register scratch2 = temps.Acquire(); bool signExtend = Scalar::isSignedIntType(type); unsigned nbytes = Scalar::byteSize(type); @@ -3635,8 +3633,11 @@ static void CompareExchange(MacroAssembler& masm, Label again, end; + Register scratch = temps.Acquire(); masm.computeEffectiveAddress(mem, scratch); + Register scratch2 = temps.Acquire(); + if (nbytes == 4) { masm.memoryBarrierBefore(sync); masm.bind(&again); @@ -3725,9 +3726,10 @@ static void CompareExchange64(MacroAssembler& masm, MOZ_ASSERT(expect != output && replace != output); UseScratchRegisterScope temps(masm); Register scratch = temps.Acquire(); - Register scratch2 = temps.Acquire(); masm.computeEffectiveAddress(mem, scratch); + Register scratch2 = temps.Acquire(); + Label tryAgain; Label exit; @@ -3865,10 +3867,12 @@ static void AtomicExchange64(MacroAssembler& masm, Register64 value, Register64 output) { MOZ_ASSERT(value != output); UseScratchRegisterScope temps(masm); + Register scratch = temps.Acquire(); - Register scratch2 = temps.Acquire(); masm.computeEffectiveAddress(mem, scratch); + Register scratch2 = temps.Acquire(); + Label tryAgain; masm.memoryBarrierBefore(sync); @@ -4263,8 +4267,6 @@ static void AtomicEffectOp(MacroAssembler& masm, const T& mem, Register value, Register valueTemp, Register offsetTemp, Register maskTemp) { UseScratchRegisterScope temps(masm); - Register scratch = temps.Acquire(); - Register scratch2 = temps.Acquire(); unsigned nbytes = Scalar::byteSize(type); switch (nbytes) { @@ -4282,8 +4284,11 @@ static void AtomicEffectOp(MacroAssembler& masm, Label again; + Register scratch = temps.Acquire(); masm.computeEffectiveAddress(mem, scratch); + Register scratch2 = temps.Acquire(); + if (nbytes == 4) { masm.memoryBarrierBefore(sync); masm.bind(&again);