Closed Bug 1879225 Opened 8 months ago Closed 7 months ago

Update irregexp to new version

Categories

(Core :: JavaScript Engine, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
125 Branch
Tracking Status
firefox124 --- wontfix
firefox125 --- fixed

People

(Reporter: update-bot, Assigned: iain)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [3pl-filed][task_id: KpKWeAMORi6FNtZV8BolHQ])

Attachments

(9 files)

This update covers 3526 commits, including 112 new upstream commits I've never filed a bug on before. (They're the top 112.). Here are the overall diff statistics.


js/src/irregexp/imported/gen-regexp-special-case.cc | 48 ---
js/src/irregexp/imported/regexp-ast.cc | 17 +-
js/src/irregexp/imported/regexp-ast.h | 23 +-
js/src/irregexp/imported/regexp-bytecode-generator.cc | 2 +-
js/src/irregexp/imported/regexp-bytecode-peephole.cc | 4 +-
js/src/irregexp/imported/regexp-compiler-tonode.cc | 86 +++--
js/src/irregexp/imported/regexp-compiler.cc | 43 ++-
js/src/irregexp/imported/regexp-compiler.h | 8 +-
js/src/irregexp/imported/regexp-dotprinter.cc | 4 +
js/src/irregexp/imported/regexp-interpreter.cc | 84 ++--
js/src/irregexp/imported/regexp-interpreter.h | 13 +-
js/src/irregexp/imported/regexp-macro-assembler.cc | 70 ++--
js/src/irregexp/imported/regexp-macro-assembler.h | 23 +-
js/src/irregexp/imported/regexp-nodes.h | 18 +-
js/src/irregexp/imported/regexp-parser.cc | 287 +++++++++++------
js/src/irregexp/imported/regexp.h | 12 +-
js/src/irregexp/imported/special-case.h | 10 -
js/src/irregexp/moz.yaml | 4 +-
18 files changed, 417 insertions(+), 339 deletions(-)

Duplicate of this bug: 1877785
No longer duplicate of this bug: 1877785
Status: NEW → RESOLVED
Closed: 8 months ago
Duplicate of bug: 1877785
Resolution: --- → DUPLICATE

All jobs completed, we found the following issues.

Known Issues (From Taskcluster):

  • spidermonkey-sm-asan-linux64/opt (PsFtIrWrTJul21qalkfUag) - new failure not classified
  • spidermonkey-sm-tsan-linux64/opt (Pi9gYabgR5iM3_kw6wtHTw) - new failure not classified
  • spidermonkey-sm-temporal-linux64/debug (SlgOWmnmR-mHcCMV3NDTPQ) - new failure not classified
  • spidermonkey-sm-fuzzilli-linux64/debug (T_7PHwBNRCCLbFH9HilYOA) - new failure not classified
  • spidermonkey-sm-nojit-linux64/opt (W8KjzTGaQ4OKWT9KiOFuXQ) - new failure not classified
  • spidermonkey-sm-nonunified-linux64/debug (VTQXn59lRrqonXVql3IGPg) - new failure not classified
  • spidermonkey-sm-linux64-wasi-pbl/opt (YXIePf9ESOClTLc6Tnt4Kw) - new failure not classified
  • spidermonkey-sm-plain-linux64/debug (ahkNh0MfScuIuvLCQ3jo6A) - new failure not classified
  • hazard-linux64-shell-haz/debug (Wrio3qsGR5uMGp2VU7qZKw) - new failure not classified
  • spidermonkey-sm-plain-linux32/debug (Ze2HDv-MQ7yShpKZDUSaHQ) - new failure not classified
  • spidermonkey-sm-linux64-wasi/opt (bl_Tm-FjSa2yhjOOmLPSlQ) - new failure not classified
  • spidermonkey-sm-wasm-no-experimental-linux64/debug (d7ugXHtOSriBhT-lYckHlA) - new failure not classified
  • spidermonkey-sm-compacting-linux64/debug (dfVBSEGOTOCP0xE_Dhpnag) - new failure not classified
  • spidermonkey-sm-rt-linux64/debug (eb7pAE_YQZ6rxGyOQPhhPg) - new failure not classified
  • spidermonkey-sm-rootanalysis-linux64/debug (ECIHJqqyQdKGUScx7-cGtg) - new failure not classified
  • spidermonkey-sm-arm64-sim-linux64/debug (eOHrJpn0RFOmMIm5etpbqA) - new failure not classified
  • spidermonkey-sm-fuzzing-linux64/opt (GCN5q7VeTX6iLbfLDwIAtw) - new failure not classified
  • spidermonkey-sm-gdb-linux64/debug (GgQKqOh8QXKyZUlKakVAyA) - new failure not classified
  • spidermonkey-sm-package-linux64/opt (IcjySo8MRGON1o9ApPW06A) - new failure not classified
  • spidermonkey-sm-pbl-linux64/opt (Id5xl_V4SqKwFf-vxi8E-Q) - new failure not classified
  • spidermonkey-sm-arm-sim-linux32/debug (JcFr-CruTPiO_8yMDnspJQ) - new failure not classified
  • spidermonkey-sm-linux64-wasi-intl/opt (NhUL54VMRy6th0OREeyjmA) - new failure not classified
  • spidermonkey-sm-plain-linux64/opt (KVYRnlawQmWMpr_7BHiC7g) - new failure not classified

These failures may mean that the library update succeeded; you'll need to review
them yourself and decide. If there are lint failures, you will need to fix them in
a follow-up patch. (Or ignore the patch I made, and recreate it yourself with
./mach vendor js/src/irregexp/moz.yaml.)

In either event, I have done all I can, so you will need to take it from here.
When reviewing, please note that this is external code, which needs a full and
careful inspection - not a rubberstamp.

This flag gates the V8 implementation of this stage 3 proposal: https://github.com/tc39/proposal-regexp-modifiers

I've left it turned off for now. We can expose it in a separate bug.

Assignee: nobody → iireland

V8 started doing more things using RegExpFlags as part of supporting regexp modifiers.

As part of this bug in which they move object definitions back from Torque to C++, V8 added a Tagged<T> wrapper, which stores a pointer that is low-bit tagged (V8's values are either a 0-tagged small integer or a 1-tagged pointer).

We don't have the same object representation, so we just need a transparent wrapper.

In this commit, V8 changed its IsFoo predicates from methods into free functions as part of the Tagged<T> work.

At first I was simply going to move the current implementation, but as I was writing a comment to explain why bool IsByteArray(Object obj) { return true; } was not as dumb as it looked, I decided that we could do better.

V8's ByteArrays are managed by the GC, and the typecheck can be done by looking at the map (shape). Our implementation of ByteArray is a length-prefixed array allocated by malloc, so we can't check the type the same way, but in debug builds we can stick a magic number in the header and validate that it hasn't been messed with.

We can use a dedicated MagicValue for the exception we throw when interrupting (which maps closely to V8's approach).

This is an auto-generated file in V8 that changes very rarely (see https://bugzilla.mozilla.org/show_bug.cgi?id=1624015#c3). I copied this version over from a local build of V8.

The RegExpCompiler stores the flags internally, so there isn't any need to pass them in here. Upstream V8 fixed the API.

This is necessary because of an awkward bit of code here in regexp-nodes.h that uses a struct initializer to create a RegExpFlags. C++ initializers do not do type conversions, so if we initialize RegExpFlags with an int, then the member field of RegExpFlags must also be an int. V8's RegExpFlags is backed by an int, but we use a uint8_t.

I based the clang/gcc flags on the #pragmas here.

Status: RESOLVED → REOPENED
No longer duplicate of bug: 1877785
Resolution: DUPLICATE → ---
Duplicate of this bug: 1877785
Blocks: sm-runtime
Severity: -- → N/A
Priority: -- → P3
Summary: Update irregexp to new version ec89cca93594ef6ae683d6608904cd5e30378115 from 2024-02-14 00:00:00 → Update irregexp to new version
Duplicate of this bug: 1880393

Question about update bot: Iain, do you feel it's worthwhile to have Update bot run on the irregexp changes, or should we look into getting that turned off to reduce the noise for you?

Flags: needinfo?(iireland)

I appreciate having updatebot around. I don't always (ever?) land non-trivial changes immediately, but updatebot cleans up after itself if I ignore it, so there's no backlog building up. I'm already watching the entire JS component, so it's not a significant increase in my bugmail.

Flags: needinfo?(iireland)
Blocks: 1826573
Pushed by iireland@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1b309a9c237b Update irregexp to ec89cca93594ef6ae683d6608904cd5e30378115 r=dminor https://hg.mozilla.org/integration/autoland/rev/6a96960cbfb0 Add stub JitOption for regexp modifiers r=dminor https://hg.mozilla.org/integration/autoland/rev/9db3b5ee9eb1 Add more irregexp support to RegExpFlags r=dminor https://hg.mozilla.org/integration/autoland/rev/4e39e690f2b8 Add Tagged wrapper r=dminor https://hg.mozilla.org/integration/autoland/rev/8efe813ab556 Refactor IsFoo methods r=dminor https://hg.mozilla.org/integration/autoland/rev/a0e12e764dab Update special-case.cc r=dminor https://hg.mozilla.org/integration/autoland/rev/e06159bc2d35 Rename ByteArray::GetDataStartAddress to ByteArray::begin r=dminor https://hg.mozilla.org/integration/autoland/rev/85a16b24ff70 Remove obsolete argument r=dminor https://hg.mozilla.org/integration/autoland/rev/589758807f24 Disable narrowing warning for irregexp r=dminor
Flags: needinfo?(iireland)

I disabled the narrowing warning for gcc and clang, but not clang-cl, which we use on Windows. Fixing and relanding.

Flags: needinfo?(iireland)
Pushed by iireland@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/fb35e3dc4f11 Update irregexp to ec89cca93594ef6ae683d6608904cd5e30378115 r=dminor https://hg.mozilla.org/integration/autoland/rev/cc4dfb967ba7 Add stub JitOption for regexp modifiers r=dminor https://hg.mozilla.org/integration/autoland/rev/aee1020e5dab Add more irregexp support to RegExpFlags r=dminor https://hg.mozilla.org/integration/autoland/rev/2c09b27de401 Add Tagged wrapper r=dminor https://hg.mozilla.org/integration/autoland/rev/02cbfa48ac5e Refactor IsFoo methods r=dminor https://hg.mozilla.org/integration/autoland/rev/3a403f55d5b9 Update special-case.cc r=dminor https://hg.mozilla.org/integration/autoland/rev/bd893ce35a99 Rename ByteArray::GetDataStartAddress to ByteArray::begin r=dminor https://hg.mozilla.org/integration/autoland/rev/d521718e5c3e Remove obsolete argument r=dminor https://hg.mozilla.org/integration/autoland/rev/a55d20473169 Disable narrowing warning for irregexp r=dminor
No longer blocks: 1826573
Blocks: Irregexp
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: