Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1023)

Unified Diff: runtime/vm/flow_graph_compiler_arm.cc

Issue 2129043004: Don't load arguments descriptor for optimized static calls. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/flow_graph_compiler_arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler_arm.cc
diff --git a/runtime/vm/flow_graph_compiler_arm.cc b/runtime/vm/flow_graph_compiler_arm.cc
index 7c3334c479eaf733d10d28a41f90e40768f0c179..8d8626c7699cbec248d17e08365c6582c55ad904 100644
--- a/runtime/vm/flow_graph_compiler_arm.cc
+++ b/runtime/vm/flow_graph_compiler_arm.cc
@@ -1055,13 +1055,8 @@ 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) {
-#ifdef DEBUG
- ASSERT(!parsed_function().function().HasOptionalParameters());
- const bool check_arguments = !flow_graph().IsCompiledForOsr();
-#else
const bool check_arguments =
function.IsClosureFunction() && !flow_graph().IsCompiledForOsr();
-#endif
if (check_arguments) {
__ Comment("Check argument count");
// Check that exactly num_fixed arguments are passed in.
@@ -1074,14 +1069,10 @@ void FlowGraphCompiler::CompileGraph() {
__ cmp(R0, Operand(R1));
__ b(&correct_num_arguments, EQ);
__ Bind(&wrong_num_arguments);
- if (function.IsClosureFunction()) {
- ASSERT(assembler()->constant_pool_allowed());
- __ LeaveDartFrame(kKeepCalleePP); // Arguments are still on the stack.
- __ Branch(*StubCode::CallClosureNoSuchMethod_entry());
- // The noSuchMethod call may return to the caller, but not here.
- } else {
- __ Stop("Wrong number of arguments");
- }
+ ASSERT(assembler()->constant_pool_allowed());
+ __ LeaveDartFrame(kKeepCalleePP); // Arguments are still on the stack.
+ __ Branch(*StubCode::CallClosureNoSuchMethod_entry());
+ // The noSuchMethod call may return to the caller, but not here.
__ Bind(&correct_num_arguments);
}
} else if (!flow_graph().IsCompiledForOsr()) {
@@ -1428,7 +1419,12 @@ void FlowGraphCompiler::EmitOptimizedStaticCall(
intptr_t deopt_id,
TokenPosition token_pos,
LocationSummary* locs) {
- __ LoadObject(R4, arguments_descriptor);
+ ASSERT(!function.IsClosureFunction());
+ if (function.HasOptionalParameters()) {
+ __ LoadObject(R4, arguments_descriptor);
+ } else {
+ __ LoadImmediate(R4, 0); // GC safe smi zero because of stub.
+ }
// Do not use the code from the function, but let the code be patched so that
// we can record the outgoing edges to other code.
GenerateStaticDartCall(deopt_id,
« no previous file with comments | « no previous file | runtime/vm/flow_graph_compiler_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698