Files
sdk/runtime/vm/regexp
Ryan Macnak 6c3cf9ea51 Roll Clang from a3f244e2d555 to deb6854eec93
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/clang-dart-sdk
Please CC dart-engprod@google.com,dart-vm-gardener@rotations.google.com,dart-vm-team@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Clang: https://bugs.fuchsia.dev/p/fuchsia/issues/list?q=component%3AToolchain
To file a bug in Dart SDK: https://github.com/dart-lang/sdk/issues

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

TEST=ci
Cq-Include-Trybots: luci.dart.try:dart-sdk-linux-try;luci.dart.try:dart-sdk-linux-arm64-try;luci.dart.try:dart-sdk-mac-try;luci.dart.try:dart-sdk-mac-arm64-try;luci.dart.try:dart-sdk-win-try;luci.dart.try:vm-asan-mac-release-arm64-try
Change-Id: Iddd7439c096af8c37076756330a067ccb7d10a35
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/510520
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-06-10 11:05:58 -07:00
..
2026-02-24 15:23:18 -08:00

RegExp

Dart RegExp is defined to have the same behavior as JS RegExp so that the JS implementations of Dart can directly use the host JS RegExp engine. The Dart VM's implementation is taken from V8, which is called Irregexp.

The following are disabled

  • the atom matching optimization
  • the experimental implementation
  • the bytecode peephole optimization
  • the machine code implementations
  • tiering up and statistics counters
  • caching of matches
  • caching of regexp (though we do this in the VM at an earlier place)

To update

  • copy the files from v8/src/{regexp,base,zone,strings}/* to runtime/vm/regexp
    • most of these will become unused
  • update the includes to account for the new location
  • add includes of vm/regexp/base.h to get shims mapping many V8-isms to Dart-isms
  • remove or comment-out anything listed as disabled above
    • hopefully these will mostly be obvious from the diff from the previous port
  • map any remaining compile time errors from V8 things to Dart things
    • Handle -> String&
    • Handle -> RegExp&
    • Handle -> TypedData&

Note that all Dart strings are what V8 calls "flat". We have no special String representations that delay concatenation or taking substrings. All Dart RegExp are also "unmodified": users can't add/remove slots or replace methods.

The most recent update used v8 commit 254cc758346f10be2a7e22e55d90d4defe9cad74, which might be helpful for looking at a diff on the V8 side.