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/flags.h" | 7 #include "vm/flags.h" |
8 #include "vm/flow_graph.h" | 8 #include "vm/flow_graph.h" |
9 #include "vm/flow_graph_builder.h" | 9 #include "vm/flow_graph_builder.h" |
10 #include "vm/il_printer.h" | 10 #include "vm/il_printer.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 : FlowGraphVisitor(flow_graph->postorder()), | 24 : FlowGraphVisitor(flow_graph->postorder()), |
25 caller_graph_(flow_graph), | 25 caller_graph_(flow_graph), |
26 next_ssa_temp_index_(flow_graph->max_virtual_register_number()), | 26 next_ssa_temp_index_(flow_graph->max_virtual_register_number()), |
27 inlined_(false) { } | 27 inlined_(false) { } |
28 | 28 |
29 void TryInlining(const Function& function, | 29 void TryInlining(const Function& function, |
30 GrowableArray<Value*>* arguments, | 30 GrowableArray<Value*>* arguments, |
31 StaticCallInstr* call) { | 31 StaticCallInstr* call) { |
32 // TODO(zerny): Generalize to all calls. | 32 // TODO(zerny): Generalize to all calls. |
33 | 33 |
34 // Abort if the callee has named parameters. | 34 // Abort if the callee has optional parameters. |
35 if (function.num_optional_parameters() > 0) { | 35 if (function.HasOptionalParameters()) { |
36 if (FLAG_trace_inlining) { | 36 if (FLAG_trace_inlining) { |
37 OS::Print("Inline aborted %s\nReason: optional parameters\n", | 37 OS::Print("Inline aborted %s\nReason: optional parameters\n", |
38 function.ToFullyQualifiedCString()); | 38 function.ToFullyQualifiedCString()); |
39 } | 39 } |
40 return; | 40 return; |
41 } | 41 } |
42 | 42 |
43 // Assuming no optional parameters the actual/formal count should match. | 43 // Assuming no optional parameters the actual/formal count should match. |
44 ASSERT(arguments->length() == function.num_fixed_parameters()); | 44 ASSERT(arguments->length() == function.num_fixed_parameters()); |
45 | 45 |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 if (FLAG_trace_inlining && FLAG_print_flow_graph) { | 171 if (FLAG_trace_inlining && FLAG_print_flow_graph) { |
172 OS::Print("After Inlining of %s\n", flow_graph_-> | 172 OS::Print("After Inlining of %s\n", flow_graph_-> |
173 parsed_function().function().ToFullyQualifiedCString()); | 173 parsed_function().function().ToFullyQualifiedCString()); |
174 FlowGraphPrinter printer(*flow_graph_); | 174 FlowGraphPrinter printer(*flow_graph_); |
175 printer.PrintBlocks(); | 175 printer.PrintBlocks(); |
176 } | 176 } |
177 } | 177 } |
178 } | 178 } |
179 | 179 |
180 } // namespace dart | 180 } // namespace dart |
OLD | NEW |