| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/flow_graph_inliner.h" | 5 #include "vm/flow_graph_inliner.h" |
| 6 | 6 |
| 7 #include "vm/compiler.h" | 7 #include "vm/compiler.h" |
| 8 #include "vm/flags.h" | 8 #include "vm/flags.h" |
| 9 #include "vm/flow_graph.h" | 9 #include "vm/flow_graph.h" |
| 10 #include "vm/flow_graph_builder.h" | 10 #include "vm/flow_graph_builder.h" |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 // If the callee has optional parameters, rebuild the argument and stub | 536 // If the callee has optional parameters, rebuild the argument and stub |
| 537 // arrays so that actual arguments are in one-to-one with the formal | 537 // arrays so that actual arguments are in one-to-one with the formal |
| 538 // parameters. | 538 // parameters. |
| 539 if (function.HasOptionalParameters()) { | 539 if (function.HasOptionalParameters()) { |
| 540 TRACE_INLINING(OS::Print(" adjusting for optional parameters\n")); | 540 TRACE_INLINING(OS::Print(" adjusting for optional parameters\n")); |
| 541 AdjustForOptionalParameters(*parsed_function, | 541 AdjustForOptionalParameters(*parsed_function, |
| 542 argument_names, | 542 argument_names, |
| 543 arguments, | 543 arguments, |
| 544 param_stubs, | 544 param_stubs, |
| 545 callee_graph); | 545 callee_graph); |
| 546 // Add a bogus parameter at the end for the (unused) arguments | |
| 547 // descriptor slot. The parser allocates an extra slot between | |
| 548 // locals and parameters to hold the arguments descriptor in case it | |
| 549 // escapes. We currently bailout if there are argument test | |
| 550 // expressions or escaping variables so this parameter and the stack | |
| 551 // slot are not used. | |
| 552 if (parsed_function->GetSavedArgumentsDescriptorVar() != NULL) { | |
| 553 param_stubs->Add(new ParameterInstr( | |
| 554 function.NumParameters(), callee_graph->graph_entry())); | |
| 555 } | |
| 556 } | 546 } |
| 557 | 547 |
| 558 // After treating optional parameters the actual/formal count must match. | 548 // After treating optional parameters the actual/formal count must match. |
| 559 ASSERT(arguments->length() == function.NumParameters()); | 549 ASSERT(arguments->length() == function.NumParameters()); |
| 560 ASSERT(param_stubs->length() == callee_graph->parameter_count()); | 550 ASSERT(param_stubs->length() == callee_graph->parameter_count()); |
| 561 | 551 |
| 562 { | 552 { |
| 563 TimerScope timer(FLAG_compiler_stats, | 553 TimerScope timer(FLAG_compiler_stats, |
| 564 &CompilerStats::graphinliner_ssa_timer, | 554 &CompilerStats::graphinliner_ssa_timer, |
| 565 isolate); | 555 isolate); |
| (...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1366 OS::Print("After Inlining of %s\n", flow_graph_-> | 1356 OS::Print("After Inlining of %s\n", flow_graph_-> |
| 1367 parsed_function().function().ToFullyQualifiedCString()); | 1357 parsed_function().function().ToFullyQualifiedCString()); |
| 1368 FlowGraphPrinter printer(*flow_graph_); | 1358 FlowGraphPrinter printer(*flow_graph_); |
| 1369 printer.PrintBlocks(); | 1359 printer.PrintBlocks(); |
| 1370 } | 1360 } |
| 1371 } | 1361 } |
| 1372 } | 1362 } |
| 1373 } | 1363 } |
| 1374 | 1364 |
| 1375 } // namespace dart | 1365 } // namespace dart |
| OLD | NEW |