| 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_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/flow_graph_compiler.h" | 10 #include "vm/flow_graph_compiler.h" |
| (...skipping 3363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3374 | 3374 |
| 3375 return true; | 3375 return true; |
| 3376 } | 3376 } |
| 3377 | 3377 |
| 3378 // Phis have not yet been inserted into the graph but they have uses of | 3378 // Phis have not yet been inserted into the graph but they have uses of |
| 3379 // their inputs. Insert the non-redundant ones and clear the input uses | 3379 // their inputs. Insert the non-redundant ones and clear the input uses |
| 3380 // of the redundant ones. | 3380 // of the redundant ones. |
| 3381 void EmitPhis() { | 3381 void EmitPhis() { |
| 3382 for (intptr_t i = 0; i < phis_.length(); i++) { | 3382 for (intptr_t i = 0; i < phis_.length(); i++) { |
| 3383 PhiInstr* phi = phis_[i]; | 3383 PhiInstr* phi = phis_[i]; |
| 3384 if ((phi->input_use_list() != NULL) && !EliminateRedundantPhi(phi)) { | 3384 if (phi->HasUses() && !EliminateRedundantPhi(phi)) { |
| 3385 phi->mark_alive(); | 3385 phi->mark_alive(); |
| 3386 phi->block()->InsertPhi(phi); | 3386 phi->block()->InsertPhi(phi); |
| 3387 } else { | 3387 } else { |
| 3388 for (intptr_t j = phi->InputCount() - 1; j >= 0; --j) { | 3388 for (intptr_t j = phi->InputCount() - 1; j >= 0; --j) { |
| 3389 phi->InputAt(j)->RemoveFromUseList(); | 3389 phi->InputAt(j)->RemoveFromUseList(); |
| 3390 } | 3390 } |
| 3391 } | 3391 } |
| 3392 } | 3392 } |
| 3393 } | 3393 } |
| 3394 | 3394 |
| (...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4368 | 4368 |
| 4369 if (FLAG_trace_constant_propagation) { | 4369 if (FLAG_trace_constant_propagation) { |
| 4370 OS::Print("\n==== After constant propagation ====\n"); | 4370 OS::Print("\n==== After constant propagation ====\n"); |
| 4371 FlowGraphPrinter printer(*graph_); | 4371 FlowGraphPrinter printer(*graph_); |
| 4372 printer.PrintBlocks(); | 4372 printer.PrintBlocks(); |
| 4373 } | 4373 } |
| 4374 } | 4374 } |
| 4375 | 4375 |
| 4376 | 4376 |
| 4377 } // namespace dart | 4377 } // namespace dart |
| OLD | NEW |