Chromium Code Reviews| 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 993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1004 // The call target is shared with a previous inlined variant. Share | 1004 // The call target is shared with a previous inlined variant. Share |
| 1005 // the graph. This requires a join block at the entry, and edge-split | 1005 // the graph. This requires a join block at the entry, and edge-split |
| 1006 // form requires a target for each branch. | 1006 // form requires a target for each branch. |
| 1007 // | 1007 // |
| 1008 // Represent the sharing by recording a fresh target for the first | 1008 // Represent the sharing by recording a fresh target for the first |
| 1009 // variant and the shared join for all later variants. | 1009 // variant and the shared join for all later variants. |
| 1010 if (inlined_entries_[i]->IsGraphEntry()) { | 1010 if (inlined_entries_[i]->IsGraphEntry()) { |
| 1011 // Convert the old target entry to a new join entry. | 1011 // Convert the old target entry to a new join entry. |
| 1012 TargetEntryInstr* old_target = | 1012 TargetEntryInstr* old_target = |
| 1013 inlined_entries_[i]->AsGraphEntry()->normal_entry(); | 1013 inlined_entries_[i]->AsGraphEntry()->normal_entry(); |
| 1014 // Unuse all inputs in the the old graph entry since it is not part of | |
| 1015 // the graph anymore. A new target be created instead. | |
|
srdjan
2014/02/01 00:47:36
Fix last sentence in the comment.
Florian Schneider
2014/02/03 09:47:42
Oops. Will fix this my next CL.
| |
| 1016 inlined_entries_[i]->AsGraphEntry()->UnuseAllInputs(); | |
| 1017 | |
| 1014 JoinEntryInstr* new_join = BranchSimplifier::ToJoinEntry(old_target); | 1018 JoinEntryInstr* new_join = BranchSimplifier::ToJoinEntry(old_target); |
| 1015 old_target->ReplaceAsPredecessorWith(new_join); | 1019 old_target->ReplaceAsPredecessorWith(new_join); |
| 1016 for (intptr_t j = 0; j < old_target->dominated_blocks().length(); ++j) { | 1020 for (intptr_t j = 0; j < old_target->dominated_blocks().length(); ++j) { |
| 1017 BlockEntryInstr* block = old_target->dominated_blocks()[j]; | 1021 BlockEntryInstr* block = old_target->dominated_blocks()[j]; |
| 1018 new_join->AddDominatedBlock(block); | 1022 new_join->AddDominatedBlock(block); |
| 1019 } | 1023 } |
| 1020 // Create a new target with the join as unconditional successor. | 1024 // Create a new target with the join as unconditional successor. |
| 1021 TargetEntryInstr* new_target = | 1025 TargetEntryInstr* new_target = |
| 1022 new TargetEntryInstr(owner_->caller_graph()->allocate_block_id(), | 1026 new TargetEntryInstr(owner_->caller_graph()->allocate_block_id(), |
| 1023 old_target->try_index()); | 1027 old_target->try_index()); |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1477 OS::Print("After Inlining of %s\n", flow_graph_-> | 1481 OS::Print("After Inlining of %s\n", flow_graph_-> |
| 1478 parsed_function().function().ToFullyQualifiedCString()); | 1482 parsed_function().function().ToFullyQualifiedCString()); |
| 1479 FlowGraphPrinter printer(*flow_graph_); | 1483 FlowGraphPrinter printer(*flow_graph_); |
| 1480 printer.PrintBlocks(); | 1484 printer.PrintBlocks(); |
| 1481 } | 1485 } |
| 1482 } | 1486 } |
| 1483 } | 1487 } |
| 1484 } | 1488 } |
| 1485 | 1489 |
| 1486 } // namespace dart | 1490 } // namespace dart |
| OLD | NEW |