[webkit-changes] [WebKit/WebKit] 2178d7: [JSC] toUpperCase should check whether input strin...

Yusuke Suzuki noreply at github.com
Fri Aug 9 08:40:25 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2178d70f0416138b76c0419e8241a17d90beae0b
      https://github.com/WebKit/WebKit/commit/2178d70f0416138b76c0419e8241a17d90beae0b
  Author: Yusuke Suzuki <ysuzuki at apple.com>
  Date:   2024-08-09 (Fri, 09 Aug 2024)

  Changed paths:
    M Source/WTF/wtf/text/StringImpl.cpp
    M Source/WTF/wtf/text/StringImpl.h

  Log Message:
  -----------
  [JSC] toUpperCase should check whether input string is already UpperCase
https://bugs.webkit.org/show_bug.cgi?id=277845
rdar://problem/133513177

Reviewed by Alexey Shvayka.

Previously we thought toUpperCase against already-upper-cased-string is rare. So we had optimization for toLowerCase,
but didn't do that for toUpperCase. But in fact it is not rare, and there are many cases which does this. (e.g. tagName for example).

We should have a path not creating a new StringImpl for already UpperCase-ed string. This also allows JSC not to create a new JSString
around it since it can detect that new StringImpl is not created.

* Source/WTF/wtf/text/StringImpl.cpp:
(WTF::StringImpl::convertToUppercaseWithoutLocale):
(WTF::StringImpl::convertToUppercaseWithoutLocaleStartingAtFailingIndex8Bit):
(WTF::StringImpl::convertToUppercaseWithoutLocaleUpconvert):
* Source/WTF/wtf/text/StringImpl.h:

Canonical link: https://commits.webkit.org/282046@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