| 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 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 for (intptr_t i = 0; i < calls.length(); ++i) { | 620 for (intptr_t i = 0; i < calls.length(); ++i) { |
| 621 ClosureCallInstr* call = calls[i]; | 621 ClosureCallInstr* call = calls[i]; |
| 622 // Find the closure of the callee. | 622 // Find the closure of the callee. |
| 623 ASSERT(call->ArgumentCount() > 0); | 623 ASSERT(call->ArgumentCount() > 0); |
| 624 const CreateClosureInstr* closure = | 624 const CreateClosureInstr* closure = |
| 625 call->ArgumentAt(0)->value()->definition()->AsCreateClosure(); | 625 call->ArgumentAt(0)->value()->definition()->AsCreateClosure(); |
| 626 if (closure == NULL) { | 626 if (closure == NULL) { |
| 627 TRACE_INLINING(OS::Print(" Bailout: non-closure operator\n")); | 627 TRACE_INLINING(OS::Print(" Bailout: non-closure operator\n")); |
| 628 continue; | 628 continue; |
| 629 } | 629 } |
| 630 GrowableArray<Value*> arguments(call->ArgumentCount() - 1); | 630 GrowableArray<Value*> arguments(call->ArgumentCount()); |
| 631 for (int i = 1; i < call->ArgumentCount(); ++i) { | 631 for (int i = 0; i < call->ArgumentCount(); ++i) { |
| 632 arguments.Add(call->ArgumentAt(i)->value()); | 632 arguments.Add(call->ArgumentAt(i)->value()); |
| 633 } | 633 } |
| 634 TryInlining(closure->function(), | 634 TryInlining(closure->function(), |
| 635 call->argument_names(), | 635 call->argument_names(), |
| 636 &arguments, | 636 &arguments, |
| 637 call); | 637 call); |
| 638 } | 638 } |
| 639 } | 639 } |
| 640 | 640 |
| 641 void InlineInstanceCalls() { | 641 void InlineInstanceCalls() { |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 800 OS::Print("After Inlining of %s\n", flow_graph_-> | 800 OS::Print("After Inlining of %s\n", flow_graph_-> |
| 801 parsed_function().function().ToFullyQualifiedCString()); | 801 parsed_function().function().ToFullyQualifiedCString()); |
| 802 FlowGraphPrinter printer(*flow_graph_); | 802 FlowGraphPrinter printer(*flow_graph_); |
| 803 printer.PrintBlocks(); | 803 printer.PrintBlocks(); |
| 804 } | 804 } |
| 805 } | 805 } |
| 806 } | 806 } |
| 807 } | 807 } |
| 808 | 808 |
| 809 } // namespace dart | 809 } // namespace dart |
| OLD | NEW |