Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 26b192b1d62481cbc5ef9833d657cf3126cdf458
      
https://github.com/WebKit/WebKit/commit/26b192b1d62481cbc5ef9833d657cf3126cdf458
  Author: Yusuke Suzuki <[email protected]>
  Date:   2026-05-26 (Tue, 26 May 2026)

  Changed paths:
    A JSTests/stress/array-join-dfg-empty-separator.js
    A JSTests/stress/array-join-dfg-object-separator-tostring-once.js
    A JSTests/stress/array-join-dfg-string-separator.js
    A JSTests/stress/array-join-dfg-tostring-mutation.js
    A JSTests/stress/array-join-dfg-undefined-separator.js
    A JSTests/stress/array-join-dfg-untyped-separator.js
    M Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h
    M Source/JavaScriptCore/dfg/DFGBackwardsPropagationPhase.cpp
    M Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
    M Source/JavaScriptCore/dfg/DFGClobberize.h
    M Source/JavaScriptCore/dfg/DFGCloneHelper.h
    M Source/JavaScriptCore/dfg/DFGDoesGC.cpp
    M Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
    M Source/JavaScriptCore/dfg/DFGNode.h
    M Source/JavaScriptCore/dfg/DFGNodeType.h
    M Source/JavaScriptCore/dfg/DFGOperations.cpp
    M Source/JavaScriptCore/dfg/DFGOperations.h
    M Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp
    M Source/JavaScriptCore/dfg/DFGSafeToExecute.h
    M Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
    M Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
    M Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
    M Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
    M Source/JavaScriptCore/dfg/DFGStrengthReductionPhase.cpp
    M Source/JavaScriptCore/ftl/FTLCapabilities.cpp
    M Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
    M Source/JavaScriptCore/runtime/ArrayPrototype.cpp
    M Source/JavaScriptCore/runtime/Intrinsic.h

  Log Message:
  -----------
  [JSC] Add ArrayJoin DFG nodes
https://bugs.webkit.org/show_bug.cgi?id=315610
rdar://177988353

Reviewed by Sosuke Suzuki and Yijia Huang.

This patch implements ArrayJoin DFG node.

1. We add super fast path for join with empty string as it is very
   frequently happen (this is used when array is used for string
   builder).
2. We add DFG ArrayJoin node which optimize Array#join in general. We
   can use ArrayMode to reduce the kind of arrays we will see.

Tests: JSTests/stress/array-join-dfg-empty-separator.js
       JSTests/stress/array-join-dfg-string-separator.js
       JSTests/stress/array-join-dfg-undefined-separator.js
       JSTests/stress/array-join-dfg-untyped-separator.js

* JSTests/stress/array-join-dfg-empty-separator.js: Added.
(shouldBe):
(joinInt32):
(joinContiguous):
(joinDouble):
* JSTests/stress/array-join-dfg-object-separator-tostring-once.js: Added.
(shouldBe):
(join):
(noInline):
(shouldBe.call):
* JSTests/stress/array-join-dfg-string-separator.js: Added.
(shouldBe):
(joinComma):
(joinDash):
(joinMulti):
* JSTests/stress/array-join-dfg-tostring-mutation.js: Added.
(shouldBe):
(joinShrink):
(joinGrow):
(joinTransition):
(joinHolePunch):
(joinNonStringElement):
(joinShrinkEmpty):
(joinGrowEmpty):
* JSTests/stress/array-join-dfg-undefined-separator.js: Added.
(shouldBe):
(joinUndefinedLiteral):
(joinNoArg):
(joinViaVar):
(inner):
(outer):
* JSTests/stress/array-join-dfg-untyped-separator.js: Added.
(shouldBe):
(shouldThrow):
(join):
(customSep.toString):
(pick):
(joinPicked):
(throwingSep):
(i.catch):
* Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* Source/JavaScriptCore/dfg/DFGBackwardsPropagationPhase.cpp:
(JSC::DFG::BackwardsPropagationPhase::propagate):
* Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
* Source/JavaScriptCore/dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* Source/JavaScriptCore/dfg/DFGCloneHelper.h:
* Source/JavaScriptCore/dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* Source/JavaScriptCore/dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* Source/JavaScriptCore/dfg/DFGNode.h:
(JSC::DFG::Node::hasStorageChild const):
(JSC::DFG::Node::hasArrayMode):
* Source/JavaScriptCore/dfg/DFGNodeType.h:
* Source/JavaScriptCore/dfg/DFGOperations.cpp:
(JSC::DFG::arrayJoinWithStringSeparator):
(JSC::DFG::JSC_DEFINE_JIT_OPERATION):
* Source/JavaScriptCore/dfg/DFGOperations.h:
* Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp:
* Source/JavaScriptCore/dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:
* Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h:
* Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* Source/JavaScriptCore/dfg/DFGStrengthReductionPhase.cpp:
(JSC::DFG::StrengthReductionPhase::handleNode):
* Source/JavaScriptCore/ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileArrayJoin):
* Source/JavaScriptCore/runtime/ArrayPrototype.cpp:
(JSC::ArrayPrototype::finishCreation):
(JSC::JSC_DEFINE_HOST_FUNCTION):
* Source/JavaScriptCore/runtime/Intrinsic.h:

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



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

Reply via email to