| 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/block_scheduler.h" | 7 #include "vm/block_scheduler.h" |
| 8 #include "vm/compiler.h" | 8 #include "vm/compiler.h" |
| 9 #include "vm/flags.h" | 9 #include "vm/flags.h" |
| 10 #include "vm/flow_graph.h" | 10 #include "vm/flow_graph.h" |
| (...skipping 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1156 return second; | 1156 return second; |
| 1157 } | 1157 } |
| 1158 | 1158 |
| 1159 | 1159 |
| 1160 bool PolymorphicInliner::TryInlineRecognizedMethod(const Function& target) { | 1160 bool PolymorphicInliner::TryInlineRecognizedMethod(const Function& target) { |
| 1161 FlowGraphOptimizer optimizer(owner_->caller_graph()); | 1161 FlowGraphOptimizer optimizer(owner_->caller_graph()); |
| 1162 TargetEntryInstr* entry; | 1162 TargetEntryInstr* entry; |
| 1163 Definition* last; | 1163 Definition* last; |
| 1164 if (optimizer.TryInlineRecognizedMethod(target, | 1164 if (optimizer.TryInlineRecognizedMethod(target, |
| 1165 call_, | 1165 call_, |
| 1166 call_->ic_data(), | 1166 call_->instance_call()->token_pos(), |
| 1167 *call_->instance_call()->ic_data(), |
| 1167 &entry, &last)) { | 1168 &entry, &last)) { |
| 1168 // Create a graph fragment. | 1169 // Create a graph fragment. |
| 1169 InlineExitCollector* exit_collector = | 1170 InlineExitCollector* exit_collector = |
| 1170 new InlineExitCollector(owner_->caller_graph(), call_); | 1171 new InlineExitCollector(owner_->caller_graph(), call_); |
| 1171 | 1172 |
| 1172 ReturnInstr* result = | 1173 ReturnInstr* result = |
| 1173 new ReturnInstr(call_->instance_call()->token_pos(), | 1174 new ReturnInstr(call_->instance_call()->token_pos(), |
| 1174 new Value(last)); | 1175 new Value(last)); |
| 1175 owner_->caller_graph()->AppendTo( | 1176 owner_->caller_graph()->AppendTo( |
| 1176 last, | 1177 last, |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1490 OS::Print("After Inlining of %s\n", flow_graph_-> | 1491 OS::Print("After Inlining of %s\n", flow_graph_-> |
| 1491 parsed_function().function().ToFullyQualifiedCString()); | 1492 parsed_function().function().ToFullyQualifiedCString()); |
| 1492 FlowGraphPrinter printer(*flow_graph_); | 1493 FlowGraphPrinter printer(*flow_graph_); |
| 1493 printer.PrintBlocks(); | 1494 printer.PrintBlocks(); |
| 1494 } | 1495 } |
| 1495 } | 1496 } |
| 1496 } | 1497 } |
| 1497 } | 1498 } |
| 1498 | 1499 |
| 1499 } // namespace dart | 1500 } // namespace dart |
| OLD | NEW |