Closed Bug 1833624 Opened 1 year ago Closed 1 year ago

Call Ion RegExp stubs also from Baseline ICs


(Core :: JavaScript Engine: JIT, task, P3)




115 Branch
Tracking Status
firefox115 --- fixed


(Reporter: jandem, Assigned: jandem)


(Blocks 1 open bug)


(Whiteboard: [sp3])


(4 files)

We need those to call the stubs from Baseline IC code.

The realm stubs are currently stored as weak references so the IC stub will need
to hold a strong reference to keep it alive.

Depends on D178328

This is faster, especially for the Matcher and ExecMatch stubs, because allocating
the match result array is faster from JIT code than from C++.

Speedometer 3 shows some medium/high confidence improvements for various sub tests.

Moving the input registers into place was one of the tricky parts. After trying a few
approaches, using MoveResolver was simplest so that's what this patch implements.

Because the regexp stubs are held weakly by JitRealm, this patch stores a strong
reference to the stub's JitCode in the IC stub. It isn't actually used for the call,
because there are some edge cases (that we shouldn't hit in practice) where we discard
JIT code including the regexp stubs, but this doesn't work for scripts active on the stack.
To make sure we always call the correct regexp stub code, we load it from JitRealm.

Depends on D178330

Pushed by
part 1 - Move some RegExp stub constants to a header file. r=iain
part 2 - Add support for JitCode stub fields. r=iain
part 3 - Minor Realm and JitRealm changes. r=iain
part 4 - Call RegExp stubs also from Baseline ICs. r=iain
Whiteboard: [sp3]
You need to log in before you can comment on or make changes to this bug.