| 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 976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 987 if (target.raw() == non_inlined_variants_[i].target->raw()) { | 987 if (target.raw() == non_inlined_variants_[i].target->raw()) { |
| 988 return true; | 988 return true; |
| 989 } | 989 } |
| 990 } | 990 } |
| 991 | 991 |
| 992 return false; | 992 return false; |
| 993 } | 993 } |
| 994 | 994 |
| 995 | 995 |
| 996 bool PolymorphicInliner::TryInlining(const Function& target) { | 996 bool PolymorphicInliner::TryInlining(const Function& target) { |
| 997 if (!target.is_optimizable()) { |
| 998 return false; |
| 999 } |
| 997 GrowableArray<Value*> arguments(call_->ArgumentCount()); | 1000 GrowableArray<Value*> arguments(call_->ArgumentCount()); |
| 998 for (int i = 0; i < call_->ArgumentCount(); ++i) { | 1001 for (int i = 0; i < call_->ArgumentCount(); ++i) { |
| 999 arguments.Add(call_->PushArgumentAt(i)->value()); | 1002 arguments.Add(call_->PushArgumentAt(i)->value()); |
| 1000 } | 1003 } |
| 1001 InlinedCallData call_data(call_, &arguments); | 1004 InlinedCallData call_data(call_, &arguments); |
| 1002 if (!owner_->TryInlining(target, | 1005 if (!owner_->TryInlining(target, |
| 1003 call_->instance_call()->argument_names(), | 1006 call_->instance_call()->argument_names(), |
| 1004 &call_data)) { | 1007 &call_data)) { |
| 1005 return false; | 1008 return false; |
| 1006 } | 1009 } |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1343 OS::Print("After Inlining of %s\n", flow_graph_-> | 1346 OS::Print("After Inlining of %s\n", flow_graph_-> |
| 1344 parsed_function().function().ToFullyQualifiedCString()); | 1347 parsed_function().function().ToFullyQualifiedCString()); |
| 1345 FlowGraphPrinter printer(*flow_graph_); | 1348 FlowGraphPrinter printer(*flow_graph_); |
| 1346 printer.PrintBlocks(); | 1349 printer.PrintBlocks(); |
| 1347 } | 1350 } |
| 1348 } | 1351 } |
| 1349 } | 1352 } |
| 1350 } | 1353 } |
| 1351 | 1354 |
| 1352 } // namespace dart | 1355 } // namespace dart |
| OLD | NEW |