[webkit-changes] [WebKit/WebKit] 3e50ae: Scan BidiRTL possibility via SIMD

Yusuke Suzuki noreply at github.com
Mon May 27 14:27:28 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 3e50aeaaa02169629761b2f64041cedd72c4fedd
      https://github.com/WebKit/WebKit/commit/3e50aeaaa02169629761b2f64041cedd72c4fedd
  Author: Yusuke Suzuki <ysuzuki at apple.com>
  Date:   2024-05-27 (Mon, 27 May 2024)

  Changed paths:
    M Source/JavaScriptCore/runtime/JSONObject.cpp
    M Source/JavaScriptCore/runtime/LiteralParser.cpp
    M Source/WTF/wtf/SIMDHelpers.h
    M Source/WTF/wtf/text/StringCommon.cpp
    M Source/WTF/wtf/text/StringCommon.h
    M Source/WebCore/html/parser/HTMLDocumentParserFastPath.cpp
    M Source/WebCore/layout/formattingContexts/inline/text/TextUtil.cpp

  Log Message:
  -----------
  Scan BidiRTL possibility via SIMD
https://bugs.webkit.org/show_bug.cgi?id=274705
rdar://128719350

Reviewed by Sam Weinig.

Deploy optimization for BidiRTL possibility scanning via SIMD.
We clean up SIMDHelpers more to make code simpler

1. Add variadic bitOr / bitAnd / merge to simplify existing implementations.
2. Add all comparisons (lessThan, lessThanOrEqual, greaterThan, greaterThanOrEqual).
3. Make splat more easy-to-use form.
4. Add SIMD::stride helper inline variable to compute stride easily.

For existing implementations, I just deployed this new form. But in the furture, we would like
to extract common pattern and further simplifies the implementations. But for now, let's just
make BidiRTL scanning fast.

* Source/JavaScriptCore/runtime/JSONObject.cpp:
(JSC::FastStringifier<CharType>::append):
* Source/JavaScriptCore/runtime/LiteralParser.cpp:
(JSC::LiteralParser<CharType>::Lexer::lexString):
* Source/WTF/wtf/SIMDHelpers.h:
(WTF::SIMD::splat8):
(WTF::SIMD::splat16):
(WTF::SIMD::splat32):
(WTF::SIMD::splat64):
(WTF::SIMD::splat):
(WTF::SIMD::merge2):
(WTF::SIMD::bitOr2):
(WTF::SIMD::bitAnd2):
(WTF::SIMD::merge):
(WTF::SIMD::bitOr):
(WTF::SIMD::bitAnd):
(WTF::SIMD::bitNot):
(WTF::SIMD::lessThanOrEqual):
(WTF::SIMD::greaterThan):
(WTF::SIMD::greaterThanOrEqual):
* Source/WTF/wtf/text/StringCommon.h:
(WTF::findImpl):
(WTF::charactersContain):
* Source/WebCore/html/parser/HTMLDocumentParserFastPath.cpp:
(WebCore::HTMLFastPathParser::scanText):
(WebCore::HTMLFastPathParser::scanAttributeValue):
* Source/WebCore/layout/formattingContexts/inline/text/TextUtil.cpp:
(WebCore::Layout::TextUtil::containsStrongDirectionalityText):

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