tor-browser

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

commit ccdf83f3504656889a8cc461e72fba62793d822d
parent 9c998e4037783caae2a56d84dd5b6a81409fff47
Author: André Bargull <andre.bargull@gmail.com>
Date:   Tue, 21 Oct 2025 14:12:15 +0000

Bug 1995542: Use storePtr in storeValue for non-GC things. r=spidermonkey-reviewers,jandem

Initialising private values in `LNewTypedArrayInline` generated:
```asm
xorl       %r11d, %r11d
movq       %r11, 0x20(%rax)
xorl       %r11d, %r11d
movq       %r11, 0x28(%rax)
```

With this change is now directly:
```asm
movq       $0, 0x20(%rax)
movq       $0, 0x28(%rax)
```

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

Diffstat:
Mjs/src/jit/x64/MacroAssembler-x64.h | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/js/src/jit/x64/MacroAssembler-x64.h b/js/src/jit/x64/MacroAssembler-x64.h @@ -153,14 +153,14 @@ class MacroAssemblerX64 : public MacroAssemblerX86Shared { } template <typename T> void storeValue(const Value& val, const T& dest) { - ScratchRegisterScope scratch(asMasm()); if (val.isGCThing()) { + ScratchRegisterScope scratch(asMasm()); movWithPatch(ImmWord(val.asRawBits()), scratch); writeDataRelocation(val); + movq(scratch, Operand(dest)); } else { - mov(ImmWord(val.asRawBits()), scratch); + storePtr(ImmWord(val.asRawBits()), dest); } - movq(scratch, Operand(dest)); } void storeValue(ValueOperand val, BaseIndex dest) { storeValue(val, Operand(dest));