Closed Bug 1832558 Opened 2 years ago Closed 2 years ago

Improve RegExp stubs more

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

RESOLVED FIXED
115 Branch
Tracking Status
firefox115 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

(Blocks 1 open bug)

Details

(Whiteboard: [sp3])

Attachments

(6 files)

After the changes in bug 1831314, it should be possible to move a bit more of the BuiltinExec code into the RegExp stubs instead of emitting it before/after calling the stub.

We should also look into calling these stubs from Baseline ICs.

Iain also suggested generating all of the stubs at once when we need one of them, to avoid mprotect overhead.

The RegExpTester stub is now only used for RegExpExecTest, so we can move the
lastIndex code there. This lets us get rid of some extra branches. We now also
directly return a boolean from the stub instead of an integer.

Later patches will rename RegExpTester to RegExpExecTest.

Now it matches the name of the LIR instruction again.

Also add explicit registers for RegExpSearcher instead of reusing the Tester ones.

Depends on D178082

This adds a separate stub instead of reusing the RegExpMatcher stub. This lets us
move more code into the stub and fuses some branches.

Depends on D178083

This removes the lastIndex argument from the C++ functions called from JIT code.
Loading lastIndex now happens either in the RegExp stubs or in the C++ Code.

This is more like the rest of the code and simplifies future changes.

Depends on D178084

After the previous changes, lastIndex can be just a temp register inside the stub
because it's never used outside the stub code.

Depends on D178085

Similar to the previous change, the RegExpExecMatch stub also just uses this
register internally.

Depends on D178086

Whiteboard: [sp3]
Keywords: leave-open
Pushed by jdemooij@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/574b109aab5f part 1 - Move lastIndex code into RegExpTester stub. r=iain https://hg.mozilla.org/integration/autoland/rev/46287fa0fd6c part 2 - Rename RegExpTester stub to RegExpExecTest stub. r=iain https://hg.mozilla.org/integration/autoland/rev/a6b8c95eff33 part 3 - Add RegExpExecMatch stub. r=iain https://hg.mozilla.org/integration/autoland/rev/dc43ea76ea71 part 4 - Load/check lastIndex in C++. r=iain https://hg.mozilla.org/integration/autoland/rev/040471307c86 part 5 - Remove RegExpExecTestLastIndexReg. r=iain https://hg.mozilla.org/integration/autoland/rev/f9b9756b0d51 part 6 - Remove LRegExpExecMatch temp register. r=iain
Keywords: leave-open
Regressions: CVE-2023-4577
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: