@@ -1207,8 +1207,7 @@ static void TrySwitchInstanceCall(const ICData& ic_data,
12071207 // A call site in the monomorphic state does not load the arguments
12081208 // descriptor, so do not allow transition to this state if the callee
12091209 // needs it.
1210- if (target_function.HasOptionalParameters () ||
1211- target_function.IsGeneric ()) {
1210+ if (target_function.PrologueNeedsArgumentsDescriptor ()) {
12121211 return ;
12131212 }
12141213
@@ -1643,8 +1642,8 @@ void SwitchableCallHandler::DoUnlinkedCall(const UnlinkedCall& unlinked,
16431642 //
16441643 // Because of this we also don't generate monomorphic checks for those
16451644 // functions.
1646- if (!target_function.IsNull () && !target_function. HasOptionalParameters () &&
1647- !target_function.IsGeneric ()) {
1645+ if (!target_function.IsNull () &&
1646+ !target_function.PrologueNeedsArgumentsDescriptor ()) {
16481647 // Patch to monomorphic call.
16491648 ASSERT (target_function.HasCode ());
16501649 const Code& target_code =
@@ -1896,8 +1895,7 @@ void SwitchableCallHandler::DoICDataMiss(const ICData& ic_data,
18961895
18971896 if ((number_of_checks == 0 ) &&
18981897 (!FLAG_precompiled_mode || ic_data.receiver_cannot_be_smi ()) &&
1899- !target_function.HasOptionalParameters () &&
1900- !target_function.IsGeneric ()) {
1898+ !target_function.PrologueNeedsArgumentsDescriptor ()) {
19011899 // This call site is unlinked: transition to a monomorphic direct call.
19021900 // Note we cannot do this if the target has optional parameters because
19031901 // the monomorphic direct call does not load the arguments descriptor.
0 commit comments