| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 // If the callee has optional parameters, rebuild the argument and stub | 423 // If the callee has optional parameters, rebuild the argument and stub |
| 424 // arrays so that actual arguments are in one-to-one with the formal | 424 // arrays so that actual arguments are in one-to-one with the formal |
| 425 // parameters. | 425 // parameters. |
| 426 if (function.HasOptionalParameters()) { | 426 if (function.HasOptionalParameters()) { |
| 427 TRACE_INLINING(OS::Print(" adjusting for optional parameters\n")); | 427 TRACE_INLINING(OS::Print(" adjusting for optional parameters\n")); |
| 428 AdjustForOptionalParameters(*parsed_function, | 428 AdjustForOptionalParameters(*parsed_function, |
| 429 argument_names, | 429 argument_names, |
| 430 arguments, | 430 arguments, |
| 431 ¶m_stubs, | 431 ¶m_stubs, |
| 432 callee_graph); | 432 callee_graph); |
| 433 // Add a bogus parameter at the end for the (unused) argument descriptor | 433 // Add a bogus parameter at the end for the (unused) arguments |
| 434 // slot. The parser allocates an extra slot between locals and | 434 // descriptor slot. The parser allocates an extra slot between |
| 435 // parameters to hold the argument descriptor in case it escapes. We | 435 // locals and parameters to hold the arguments descriptor in case it |
| 436 // currently bailout if there are argument test expressions or escaping | 436 // escapes. We currently bailout if there are argument test |
| 437 // variables so this parameter and the stack slot are not used. | 437 // expressions or escaping variables so this parameter and the stack |
| 438 // slot are not used. |
| 438 if (parsed_function->GetSavedArgumentsDescriptorVar() != NULL) { | 439 if (parsed_function->GetSavedArgumentsDescriptorVar() != NULL) { |
| 439 param_stubs.Add(new ParameterInstr( | 440 param_stubs.Add(new ParameterInstr( |
| 440 function.NumParameters(), callee_graph->graph_entry())); | 441 function.NumParameters(), callee_graph->graph_entry())); |
| 441 } | 442 } |
| 442 } | 443 } |
| 443 | 444 |
| 444 // After treating optional parameters the actual/formal count must match. | 445 // After treating optional parameters the actual/formal count must match. |
| 445 ASSERT(arguments->length() == function.NumParameters()); | 446 ASSERT(arguments->length() == function.NumParameters()); |
| 446 ASSERT(param_stubs.length() == callee_graph->parameter_count()); | 447 ASSERT(param_stubs.length() == callee_graph->parameter_count()); |
| 447 | 448 |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 798 OS::Print("After Inlining of %s\n", flow_graph_-> | 799 OS::Print("After Inlining of %s\n", flow_graph_-> |
| 799 parsed_function().function().ToFullyQualifiedCString()); | 800 parsed_function().function().ToFullyQualifiedCString()); |
| 800 FlowGraphPrinter printer(*flow_graph_); | 801 FlowGraphPrinter printer(*flow_graph_); |
| 801 printer.PrintBlocks(); | 802 printer.PrintBlocks(); |
| 802 } | 803 } |
| 803 } | 804 } |
| 804 } | 805 } |
| 805 } | 806 } |
| 806 | 807 |
| 807 } // namespace dart | 808 } // namespace dart |
| OLD | NEW |