Chromium Code Reviews| 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_optimizer.h" | 5 #include "vm/flow_graph_optimizer.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/cha.h" | 8 #include "vm/cha.h" |
| 9 #include "vm/flow_graph_builder.h" | 9 #include "vm/flow_graph_builder.h" |
| 10 #include "vm/hash_map.h" | 10 #include "vm/hash_map.h" |
| (...skipping 1285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1296 for (BlockIterator block_it = flow_graph_->reverse_postorder_iterator(); | 1296 for (BlockIterator block_it = flow_graph_->reverse_postorder_iterator(); |
| 1297 !block_it.Done(); | 1297 !block_it.Done(); |
| 1298 block_it.Advance()) { | 1298 block_it.Advance()) { |
| 1299 BlockEntryInstr* block = block_it.Current(); | 1299 BlockEntryInstr* block = block_it.Current(); |
| 1300 for (ForwardInstructionIterator instr_it(block); | 1300 for (ForwardInstructionIterator instr_it(block); |
| 1301 !instr_it.Done(); | 1301 !instr_it.Done(); |
| 1302 instr_it.Advance()) { | 1302 instr_it.Advance()) { |
| 1303 Instruction* current = instr_it.Current(); | 1303 Instruction* current = instr_it.Current(); |
| 1304 Definition* defn = current->AsDefinition(); | 1304 Definition* defn = current->AsDefinition(); |
| 1305 if (defn != NULL) { | 1305 if (defn != NULL) { |
| 1306 if (defn->GetPropagatedCid() == kSmiCid) smi_values_.Add(defn); | 1306 if ((defn->GetPropagatedCid() == kSmiCid) && |
| 1307 (defn->ssa_temp_index() != -1)) { | |
|
Florian Schneider
2012/09/24 08:54:30
ssa_temp_index != -1 should be equivalent to defn-
| |
| 1308 smi_values_.Add(defn); | |
| 1309 } | |
| 1307 } else if (current->IsCheckSmi()) { | 1310 } else if (current->IsCheckSmi()) { |
| 1308 smi_checks_.Add(current->AsCheckSmi()); | 1311 smi_checks_.Add(current->AsCheckSmi()); |
| 1309 } | 1312 } |
| 1310 } | 1313 } |
| 1311 | 1314 |
| 1312 JoinEntryInstr* join = block->AsJoinEntry(); | 1315 JoinEntryInstr* join = block->AsJoinEntry(); |
| 1313 if (join != NULL) { | 1316 if (join != NULL) { |
| 1314 for (PhiIterator phi_it(join); !phi_it.Done(); phi_it.Advance()) { | 1317 for (PhiIterator phi_it(join); !phi_it.Done(); phi_it.Advance()) { |
| 1315 PhiInstr* current = phi_it.Current(); | 1318 PhiInstr* current = phi_it.Current(); |
| 1316 if (current->GetPropagatedCid() == kSmiCid) { | 1319 if (current->GetPropagatedCid() == kSmiCid) { |
| (...skipping 1619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2936 it.Advance()) { | 2939 it.Advance()) { |
| 2937 JoinEntryInstr* join = it.Current()->AsJoinEntry(); | 2940 JoinEntryInstr* join = it.Current()->AsJoinEntry(); |
| 2938 if (join != NULL) join->EliminateUnreachablePhiInputs(); | 2941 if (join != NULL) join->EliminateUnreachablePhiInputs(); |
| 2939 } | 2942 } |
| 2940 | 2943 |
| 2941 graph_->ComputeUseLists(); | 2944 graph_->ComputeUseLists(); |
| 2942 } | 2945 } |
| 2943 | 2946 |
| 2944 | 2947 |
| 2945 } // namespace dart | 2948 } // namespace dart |
| OLD | NEW |