Skip to content

Commit e120f36

Browse files
committed
[JSC] FTL direct calls should not link to the arity-checking entrypoint when they pass enough arguments
https://bugs.webkit.org/show_bug.cgi?id=327759 rdar://190174711 Reviewed by Sosuke Suzuki. setMaxArgumentCountIncludingThis is set in FTL only when `numAllocatedArgs > numPassedArgs` is true, but it is not the right use since setMaxArgumentCountIncludingThis is just telling how many arguments we passed to this CallLinkInfo. Right now, when the condition is false, it is left 0, and always using arity-fixup calls. As the same to DFG, we should just always set numAllocatedArgs as we already allocated this number of args. * Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compileCompareStrictEq): Canonical link: https://commits.webkit.org/323924@main
1 parent 49740e9 commit e120f36

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

‎Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14218,8 +14218,7 @@ IGNORE_CLANG_WARNINGS_END
1421814218

1421914219
auto* callLinkInfo = state->jitCode->common.m_directCallLinkInfos.add(semanticNodeOrigin, CallLinkInfo::UseDataIC::No, state->graph.m_codeBlock, executable);
1422014220
callLinkInfo->setCallType(CallLinkInfo::DirectTailCall);
14221-
if (numAllocatedArgs > numPassedArgs)
14222-
callLinkInfo->setMaxArgumentCountIncludingThis(numAllocatedArgs);
14221+
callLinkInfo->setMaxArgumentCountIncludingThis(numAllocatedArgs);
1422314222

1422414223
CCallHelpers::Label mainPath = jit.label();
1422514224
jit.store32(
@@ -14263,9 +14262,7 @@ IGNORE_CLANG_WARNINGS_END
1426314262

1426414263
auto* callLinkInfo = state->jitCode->common.m_directCallLinkInfos.add(semanticNodeOrigin, CallLinkInfo::UseDataIC::No, state->graph.m_codeBlock, executable);
1426514264
callLinkInfo->setCallType(isConstruct ? CallLinkInfo::DirectConstruct : CallLinkInfo::DirectCall);
14266-
14267-
if (numAllocatedArgs > numPassedArgs)
14268-
callLinkInfo->setMaxArgumentCountIncludingThis(numAllocatedArgs);
14265+
callLinkInfo->setMaxArgumentCountIncludingThis(numAllocatedArgs);
1426914266

1427014267
CCallHelpers::Label mainPath = jit.label();
1427114268
jit.store32(

0 commit comments

Comments
 (0)