Repository navigation
[JSC] Spread call mixed with other arguments should not call operations when the callee is inlined - #80268
Merged
Conversation
Collaborator
|
EWS run on previous version of this PR (hash a96116a) Details |
sosukesuzuki
force-pushed
the
eng/JSC-Spread-call-mixed-with-other-arguments-should-not-call-operations-when-the-callee-is-inlined
branch
from
November 10, 2026 04:09
a96116a to
609f564
Compare
Collaborator
|
EWS run on current version of this PR (hash 609f564) Details |
sosukesuzuki
marked this pull request as ready for review
November 10, 2026 22:00
This was referenced Nov 12, 2026
tadeuzagallo
approved these changes
Nov 12, 2026
…ns when the callee is inlined https://bugs.webkit.org/show_bug.cgi?id=330851 Reviewed by Tadeu Zagallo. 325863@main removed the C++ calls from `f(...array)` when the callee is inlined, but `f(x, ...array)` still has them. VarargsLengthWithSpread and LoadVarargsWithSpread store every operand to a scratch buffer, flush the registers, and call an operation, so the call is slower than the one which is not inlined, for which CallVarargsWithSpread builds the callee frame without calling operations. Every spread operand is a JSCellButterfly which holds boxed values and has no holes, unless the FTL eliminated it. VarargsLengthWithSpread now adds the lengths up, and LoadVarargsWithSpread stores the operands directly to the frame. For the eliminated spreads, the FTL uses the code ForwardVarargs already has for them. This makes the four operations unused, so this patch removes them. Baseline Patched spread-call-with-prefix-small-arrays-inlined 97.9189+-6.9116 ^ 56.1247+-1.8942 ^ definitely 1.7447x faster Tests: JSTests/microbenchmarks/spread-call-with-prefix-small-arrays-inlined.js JSTests/stress/spread-call-with-prefix-inlined-callee-too-many-arguments.js JSTests/stress/spread-call-with-prefix-inlined-callee.js * JSTests/microbenchmarks/spread-call-with-prefix-small-arrays-inlined.js: Added. (listener): (notify): * JSTests/stress/spread-call-with-prefix-inlined-callee-too-many-arguments.js: Added. (shouldBe): (count): (prefix): (two): (prefixAndCatch): (rest): * JSTests/stress/spread-call-with-prefix-inlined-callee.js: Added. (shouldBe): (all): (last): (const.receiver.method): (prefix): (suffix): (both): (two): (interleaved): (same): (lastOfPrefix): (lastOfSuffix): (method): (constants): (constantPlainArguments): (unboxedPlainArguments): (constantDoublesAndMaterialized): (restAndMaterialized): (inlinedRestAndMaterialized): (callInlinedRest0): (callInlinedRest3): (callInlinedRestVarargs): (yieldBetweenSpreads): (callYieldBetweenSpreads): (generate): (createArguments): * Source/JavaScriptCore/dfg/DFGNode.h: * Source/JavaScriptCore/dfg/DFGOperations.cpp: * Source/JavaScriptCore/dfg/DFGOperations.h: * Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compileVarargsLengthWithSpread): (JSC::DFG::SpeculativeJIT::compileLoadVarargsWithSpread): (JSC::DFG::SpeculativeJIT::emitLoadVarargsFromContiguousStorage): (JSC::DFG::SpeculativeJIT::emitFillMissingVarargsWithUndefined): (JSC::DFG::SpeculativeJIT::emitCopyVarargs): * Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h: * Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compileVarargsLengthWithSpread): (JSC::FTL::DFG::LowerDFGToB3::compileLoadVarargsWithSpread): (JSC::FTL::DFG::LowerDFGToB3::compileForwardVarargsWithSpread): (JSC::FTL::DFG::LowerDFGToB3::forwardSpread): (JSC::FTL::DFG::LowerDFGToB3::copyVarargs): (JSC::FTL::DFG::LowerDFGToB3::fillMissingVarargsWithUndefined): (JSC::FTL::DFG::LowerDFGToB3::fillSpreadArgumentsBuffer): Deleted. Canonical link: https://commits.webkit.org/326594@main
webkit-commit-queue
force-pushed
the
eng/JSC-Spread-call-mixed-with-other-arguments-should-not-call-operations-when-the-callee-is-inlined
branch
from
November 13, 2026 01:26
609f564 to
33871e8
Compare
Collaborator
|
Committed 326594@main (33871e8): https://commits.webkit.org/326594@main Reviewed commits have been landed. Closing PR #80268 and removing active labels. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
33871e8
609f564