[webkit-changes] [WebKit/WebKit] 725639: [JSC] Use MakeRope for StrCat(ToPrimitive(x), ...)

Yusuke Suzuki noreply at github.com
Thu Jun 29 17:08:13 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 72563917d14964eb3146a7dbe32ef0448d1fac98
      https://github.com/WebKit/WebKit/commit/72563917d14964eb3146a7dbe32ef0448d1fac98
  Author: Yusuke Suzuki <ysuzuki at apple.com>
  Date:   2023-06-29 (Thu, 29 Jun 2023)

  Changed paths:
    A JSTests/microbenchmarks/array-string-concat.js
    M Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h
    M Source/JavaScriptCore/dfg/DFGClobberize.h
    M Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
    M Source/JavaScriptCore/dfg/DFGMayExit.cpp
    M Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
    M Source/JavaScriptCore/dfg/DFGStrengthReductionPhase.cpp
    M Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp

  Log Message:
  -----------
  [JSC] Use MakeRope for StrCat(ToPrimitive(x), ...)
https://bugs.webkit.org/show_bug.cgi?id=258656
rdar://111491662

Reviewed by Keith Miller.

Let's convert StrCat(ToPrimitive(@x), ...) to MakeRope(ToString(KnownPrimitiveUse:ToPrimitive(@x), ...))
to leverage MakeRope instead of StrCat since it is much faster.

                                ToT                     Patched

array-string-concat       55.2465+-0.1687     ^     49.8739+-0.2824        ^ definitely 1.1077x faster

* JSTests/microbenchmarks/array-string-concat.js: Added.
(shouldBe):
(test):
* Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* Source/JavaScriptCore/dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* Source/JavaScriptCore/dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::attemptToMakeFastStringAdd):
* Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:
* Source/JavaScriptCore/dfg/DFGStrengthReductionPhase.cpp:
(JSC::DFG::StrengthReductionPhase::handleNode):
* Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileToStringOrCallStringConstructorOrStringValueOf):

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




More information about the webkit-changes mailing list