Index: runtime/vm/flow_graph_compiler_x64.cc |
diff --git a/runtime/vm/flow_graph_compiler_x64.cc b/runtime/vm/flow_graph_compiler_x64.cc |
index ad8c275914bc3d10a08eda0b34562c0a980229a0..e22e25d0277523b201ae99ef61213f123a1c9a5c 100644 |
--- a/runtime/vm/flow_graph_compiler_x64.cc |
+++ b/runtime/vm/flow_graph_compiler_x64.cc |
@@ -770,7 +770,8 @@ void FlowGraphCompiler::CopyParameters() { |
#ifdef DEBUG |
const bool check_correct_named_args = true; |
#else |
- const bool check_correct_named_args = function.IsClosureFunction(); |
+ const bool check_correct_named_args = |
+ function.IsClosureFunction() || function.IsConvertedClosureFunction(); |
#endif |
if (num_opt_named_params > 0) { |
// Start by alphabetically sorting the names of the optional parameters. |
@@ -876,7 +877,7 @@ void FlowGraphCompiler::CopyParameters() { |
} |
__ Bind(&wrong_num_arguments); |
- if (function.IsClosureFunction()) { |
+ if (function.IsClosureFunction() || function.IsConvertedClosureFunction()) { |
__ LeaveDartFrame(kKeepCalleePP); // The arguments are still on the stack. |
__ Jmp(*StubCode::CallClosureNoSuchMethod_entry()); |
// The noSuchMethod call may return to the caller, but not here. |
@@ -992,8 +993,9 @@ void FlowGraphCompiler::CompileGraph() { |
// No such checking code is generated if only fixed parameters are declared, |
// unless we are in debug mode or unless we are compiling a closure. |
if (num_copied_params == 0) { |
- const bool check_arguments = |
- function.IsClosureFunction() && !flow_graph().IsCompiledForOsr(); |
+ const bool check_arguments = (function.IsClosureFunction() || |
+ function.IsConvertedClosureFunction()) && |
+ !flow_graph().IsCompiledForOsr(); |
if (check_arguments) { |
__ Comment("Check argument count"); |
// Check that exactly num_fixed arguments are passed in. |