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