tor-browser

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

commit 21a87fad7ce2fc34cc7af996de29f7d19020c2a6
parent b11b2f1fcfa43f186caa2c9b220b2c8bef87f3da
Author: Jan de Mooij <jdemooij@mozilla.com>
Date:   Fri, 12 Dec 2025 10:35:54 +0000

Bug 2005479 part 5 - Use generate_lir: true for more MIR instructions. r=iain

Previous analysis got confused by `result_type: None` in MIROps.

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

Diffstat:
Mjs/src/jit/CodeGenerator.cpp | 2+-
Mjs/src/jit/LIROps.yaml | 47-----------------------------------------------
Mjs/src/jit/Lowering.cpp | 4+---
Mjs/src/jit/MIROps.yaml | 14++++++++++++++
4 files changed, 16 insertions(+), 51 deletions(-)

diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp @@ -23126,7 +23126,7 @@ void CodeGenerator::visitAddDisposableResource(LAddDisposableResource* lir) { ValueOperand resource = ToValue(lir->resource()); ValueOperand method = ToValue(lir->method()); Register needsClosure = ToRegister(lir->needsClosure()); - uint8_t hint = lir->hint(); + uint8_t hint = lir->mir()->hint(); pushArg(Imm32(hint)); pushArg(needsClosure); diff --git a/js/src/jit/LIROps.yaml b/js/src/jit/LIROps.yaml @@ -267,13 +267,6 @@ num_temps: 1 mir_op: true -# Takes in an Object and a Value. -- name: MutateProto - operands: - object: WordSized - value: BoxedValue - call_instruction: true - - name: WasmRefAsNonNull operands: ref: WordSized @@ -389,19 +382,6 @@ data: WordSized call_instruction: true -- name: WasmStackSwitchToSuspendable - operands: - suspender: WordSized - fn: WordSized - data: WordSized - call_instruction: true - -- name: WasmStackContinueOnSuspendable - operands: - suspender: WordSized - result: WordSized - call_instruction: true - - name: WasmInterruptCheck operands: instance: WordSized @@ -1976,16 +1956,6 @@ call_instruction: true mir_op: true -- name: KeepAliveObject - operands: - object: WordSized - -- name: DebugEnterGCUnsafeRegion - num_temps: 1 - -- name: DebugLeaveGCUnsafeRegion - num_temps: 1 - - name: GetNextEntryForIterator result_type: WordSized operands: @@ -2923,13 +2893,6 @@ num_temps: 1 mir_op: PostWriteElementBarrier -# Assert in debug mode that a post write barrier can be elided. -- name: AssertCanElidePostWriteBarrier - operands: - object: WordSized - value: BoxedValue - num_temps: 1 - # Guard against an object's identity. - name: GuardObjectIdentity operands: @@ -4651,16 +4614,6 @@ #endif #ifdef ENABLE_EXPLICIT_RESOURCE_MANAGEMENT -- name: AddDisposableResource - operands: - environment: WordSized - resource: BoxedValue - method: BoxedValue - needsClosure: WordSized - arguments: - hint: uint8_t - call_instruction: true - - name: CreateSuppressedError operands: error: BoxedValue diff --git a/js/src/jit/Lowering.cpp b/js/src/jit/Lowering.cpp @@ -8855,11 +8855,9 @@ void LIRGenerator::visitAddDisposableResource(MAddDisposableResource* ins) { MDefinition* method = ins->method(); MDefinition* needsClosure = ins->needsClosure(); - uint8_t hint = ins->hint(); - auto* lir = new (alloc()) LAddDisposableResource( useRegisterAtStart(env), useBoxAtStart(resource), useBoxAtStart(method), - useRegisterAtStart(needsClosure), hint); + useRegisterAtStart(needsClosure)); add(lir, ins); assignSafepoint(lir, ins); } diff --git a/js/src/jit/MIROps.yaml b/js/src/jit/MIROps.yaml @@ -422,6 +422,7 @@ value: Value result_type: None possibly_calls: true + generate_lir: true - name: InitPropGetterSetter operands: @@ -1980,16 +1981,21 @@ object: Object result_type: None guard: true + generate_lir: true - name: DebugEnterGCUnsafeRegion result_type: None guard: true alias_set: none + generate_lir: true + lir_temps: 1 - name: DebugLeaveGCUnsafeRegion result_type: None guard: true alias_set: none + generate_lir: true + lir_temps: 1 - name: Not gen_boilerplate: false @@ -3191,6 +3197,8 @@ result_type: None guard: true alias_set: none + generate_lir: true + lir_temps: 1 # Allocates a new NamedLambdaObject. # @@ -4323,12 +4331,16 @@ fn: Object data: WasmAnyRef type_policy: none + possibly_calls: true + generate_lir: true - name: WasmStackContinueOnSuspendable operands: suspender: Object result: WasmAnyRef type_policy: none + possibly_calls: true + generate_lir: true - name: WasmBinarySimd128 gen_boilerplate: false @@ -4462,6 +4474,8 @@ needsClosure: Boolean arguments: hint: uint8_t + possibly_calls: true + generate_lir: true - name: TakeDisposeCapability operands: