Skip to content

Commit

Permalink
Bug 1832558 part 6 - Remove LRegExpExecMatch temp register. r=iain
Browse files Browse the repository at this point in the history
Similar to the previous change, the RegExpExecMatch stub also just uses this
register internally.

Depends on D178086

Differential Revision: https://phabricator.services.mozilla.com/D178087
  • Loading branch information
jandem committed May 16, 2023
1 parent 9f99d3e commit 990d668
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
4 changes: 0 additions & 4 deletions js/src/jit/CodeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2926,20 +2926,16 @@ void CodeGenerator::visitOutOfLineRegExpExecMatch(
void CodeGenerator::visitRegExpExecMatch(LRegExpExecMatch* lir) {
MOZ_ASSERT(ToRegister(lir->regexp()) == RegExpMatcherRegExpReg);
MOZ_ASSERT(ToRegister(lir->string()) == RegExpMatcherStringReg);
MOZ_ASSERT(ToRegister(lir->temp0()) == RegExpMatcherLastIndexReg);
MOZ_ASSERT(ToOutValue(lir) == JSReturnOperand);

#if defined(JS_NUNBOX32)
static_assert(RegExpMatcherRegExpReg != JSReturnReg_Type);
static_assert(RegExpMatcherRegExpReg != JSReturnReg_Data);
static_assert(RegExpMatcherStringReg != JSReturnReg_Type);
static_assert(RegExpMatcherStringReg != JSReturnReg_Data);
static_assert(RegExpMatcherLastIndexReg != JSReturnReg_Type);
static_assert(RegExpMatcherLastIndexReg != JSReturnReg_Data);
#elif defined(JS_PUNBOX64)
static_assert(RegExpMatcherRegExpReg != JSReturnReg);
static_assert(RegExpMatcherStringReg != JSReturnReg);
static_assert(RegExpMatcherLastIndexReg != JSReturnReg);
#endif

masm.reserveStack(RegExpReservedStack);
Expand Down
2 changes: 1 addition & 1 deletion js/src/jit/LIROps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1497,7 +1497,7 @@
regexp: WordSized
string: WordSized
call_instruction: true
num_temps: 1
num_temps: 0
mir_op: true

- name: RegExpExecTest
Expand Down
3 changes: 1 addition & 2 deletions js/src/jit/Lowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3139,8 +3139,7 @@ void LIRGenerator::visitRegExpExecMatch(MRegExpExecMatch* ins) {

auto* lir = new (alloc())
LRegExpExecMatch(useFixedAtStart(ins->regexp(), RegExpMatcherRegExpReg),
useFixedAtStart(ins->string(), RegExpMatcherStringReg),
tempFixed(RegExpMatcherLastIndexReg));
useFixedAtStart(ins->string(), RegExpMatcherStringReg));
defineReturn(lir, ins);
assignSafepoint(lir, ins);
}
Expand Down

0 comments on commit 990d668

Please sign in to comment.