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