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.h" | 5 #include "vm/flow_graph.h" |
6 | 6 |
7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
8 #include "vm/flow_graph_builder.h" | 8 #include "vm/flow_graph_builder.h" |
9 #include "vm/il_printer.h" | 9 #include "vm/il_printer.h" |
10 #include "vm/intermediate_language.h" | 10 #include "vm/intermediate_language.h" |
(...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
914 GrowableArray<PhiInstr*>* live_phis, | 914 GrowableArray<PhiInstr*>* live_phis, |
915 VariableLivenessAnalysis* variable_liveness) { | 915 VariableLivenessAnalysis* variable_liveness) { |
916 // 1. Process phis first. | 916 // 1. Process phis first. |
917 if (block_entry->IsJoinEntry()) { | 917 if (block_entry->IsJoinEntry()) { |
918 JoinEntryInstr* join = block_entry->AsJoinEntry(); | 918 JoinEntryInstr* join = block_entry->AsJoinEntry(); |
919 if (join->phis() != NULL) { | 919 if (join->phis() != NULL) { |
920 for (intptr_t i = 0; i < join->phis()->length(); ++i) { | 920 for (intptr_t i = 0; i < join->phis()->length(); ++i) { |
921 PhiInstr* phi = (*join->phis())[i]; | 921 PhiInstr* phi = (*join->phis())[i]; |
922 if (phi != NULL) { | 922 if (phi != NULL) { |
923 (*env)[i] = phi; | 923 (*env)[i] = phi; |
924 phi->set_ssa_temp_index(alloc_ssa_temp_index()); // New SSA temp. | 924 AllocateSSAIndexes(phi); // New SSA temp. |
925 if (block_entry->InsideTryBlock() && !phi->is_alive()) { | 925 if (block_entry->InsideTryBlock() && !phi->is_alive()) { |
926 // This is a safe approximation. Inside try{} all locals are | 926 // This is a safe approximation. Inside try{} all locals are |
927 // used at every call implicitly, so we mark all phis as live | 927 // used at every call implicitly, so we mark all phis as live |
928 // from the start. | 928 // from the start. |
929 // TODO(fschneider): Improve this approximation to eliminate | 929 // TODO(fschneider): Improve this approximation to eliminate |
930 // more redundant phis. | 930 // more redundant phis. |
931 phi->mark_alive(); | 931 phi->mark_alive(); |
932 live_phis->Add(phi); | 932 live_phis->Add(phi); |
933 } | 933 } |
934 } | 934 } |
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1390 } | 1390 } |
1391 | 1391 |
1392 | 1392 |
1393 bool BlockEffects::IsSideEffectFreePath(BlockEntryInstr* from, | 1393 bool BlockEffects::IsSideEffectFreePath(BlockEntryInstr* from, |
1394 BlockEntryInstr* to) const { | 1394 BlockEntryInstr* to) const { |
1395 return available_at_[to->postorder_number()]->Contains( | 1395 return available_at_[to->postorder_number()]->Contains( |
1396 from->postorder_number()); | 1396 from->postorder_number()); |
1397 } | 1397 } |
1398 | 1398 |
1399 } // namespace dart | 1399 } // namespace dart |
OLD | NEW |