Bug 1875096 - Part 1: Only apply StepBackToLeadSurrogate for atom matches. r=iain
commitf33228184b2234ed690a7a9dd506b2fdbbde2cf7
authorAndré Bargull <andre.bargull@gmail.com>
Thu, 18 Jan 2024 10:26:02 +0000 (18 10:26 +0000)
committerAndré Bargull <andre.bargull@gmail.com>
Thu, 18 Jan 2024 10:26:02 +0000 (18 10:26 +0000)
tree5213361a28162811a5f1d5f9ece310c47dbf4179
parent16a6dcdaf39d31b5eb7d461cc453abae3ba60602
Bug 1875096 - Part 1: Only apply StepBackToLeadSurrogate for atom matches. r=iain

It's no longer necessary to adjust `lastIndex` before calling into irregexp,
because irregexp has been fixed a while ago to correctly handle split surrogate
pairs, cf. `v8::internal::RegExpCompiler::OptionallyStepBackToLeadSurrogate`.

That means we only need to adjust `lastIndex` when performing atom matches,
which allows to remove `StepBackToLeadSurrogate` from code-gen and move the
corresponding C++ code from "builtin/RegExp.cpp" to "vm/RegExpObject.cpp".

Differential Revision: https://phabricator.services.mozilla.com/D198821
js/src/builtin/RegExp.cpp
js/src/jit/CodeGenerator.cpp
js/src/vm/RegExpObject.cpp