| 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/intermediate_language.h" | 9 #include "vm/intermediate_language.h" |
| 10 #include "vm/longjump.h" | 10 #include "vm/longjump.h" |
| (...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 913 ReorderPhis(caller_entry); | 913 ReorderPhis(caller_entry); |
| 914 // Adjust pre/post orders and update the dominator tree. | 914 // Adjust pre/post orders and update the dominator tree. |
| 915 DiscoverBlocks(); | 915 DiscoverBlocks(); |
| 916 // TODO(zerny): Compute the dominator frontier locally. | 916 // TODO(zerny): Compute the dominator frontier locally. |
| 917 GrowableArray<BitVector*> dominance_frontier; | 917 GrowableArray<BitVector*> dominance_frontier; |
| 918 ComputeDominators(&dominance_frontier); | 918 ComputeDominators(&dominance_frontier); |
| 919 } | 919 } |
| 920 } | 920 } |
| 921 | 921 |
| 922 | 922 |
| 923 intptr_t FlowGraph::InstructionCount() const { |
| 924 intptr_t size = 0; |
| 925 // Iterate each block, skipping the graph entry. |
| 926 for (intptr_t i = 1; i < preorder_.length(); ++i) { |
| 927 for (ForwardInstructionIterator it(preorder_[i]); |
| 928 !it.Done(); |
| 929 it.Advance()) { |
| 930 ++size; |
| 931 } |
| 932 } |
| 933 return size; |
| 934 } |
| 935 |
| 936 |
| 923 } // namespace dart | 937 } // namespace dart |
| OLD | NEW |