[webkit-changes] [WebKit/WebKit] 4e7092: [JSC] Avoid resolving strings for RegExp operations

Yusuke Suzuki noreply at github.com
Tue Dec 31 15:17:02 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 4e709281fa18a6baf6a284e990a75256dd3ea7bf
      https://github.com/WebKit/WebKit/commit/4e709281fa18a6baf6a284e990a75256dd3ea7bf
  Author: Yusuke Suzuki <ysuzuki at apple.com>
  Date:   2024-12-31 (Tue, 31 Dec 2024)

  Changed paths:
    M Source/JavaScriptCore/dfg/DFGOperations.cpp
    M Source/JavaScriptCore/runtime/JSStringInlines.h
    M Source/JavaScriptCore/runtime/RegExpMatchesArray.h
    M Source/JavaScriptCore/runtime/RegExpObject.cpp
    M Source/JavaScriptCore/runtime/RegExpObjectInlines.h
    M Source/JavaScriptCore/runtime/RegExpPrototype.cpp

  Log Message:
  -----------
  [JSC] Avoid resolving strings for RegExp operations
https://bugs.webkit.org/show_bug.cgi?id=285263
rdar://142204992

Reviewed by Yijia Huang.

We resolve too many substrings just because we are running RegExp
against that. But we do not need to resolve them if it is just a
substring.
Let's just use `view(JSGlobalObject*)` instead of
`value(JSGlobalObject*)`.

* Source/JavaScriptCore/dfg/DFGOperations.cpp:
(JSC::DFG::JSC_DEFINE_JIT_OPERATION):
* Source/JavaScriptCore/runtime/JSStringInlines.h:
(JSC::jsSubstringOfResolved):
* Source/JavaScriptCore/runtime/RegExpMatchesArray.h:
(JSC::createRegExpMatchesArray):
* Source/JavaScriptCore/runtime/RegExpObject.cpp:
(JSC::RegExpObject::matchGlobal):
* Source/JavaScriptCore/runtime/RegExpObjectInlines.h:
(JSC::getRegExpObjectLastIndexAsUnsigned):
(JSC::RegExpObject::execInline):
(JSC::RegExpObject::matchInline):
(JSC::advanceStringUnicode):
(JSC::collectMatches):
(JSC::collectGlobalAtomMatches):
* Source/JavaScriptCore/runtime/RegExpPrototype.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
(JSC::advanceStringIndex):
(JSC::genericSplit):

Canonical link: https://commits.webkit.org/288349@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list