| 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 922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 933 } | 933 } |
| 934 } else { | 934 } else { |
| 935 // Sort the list of exits by block id. | 935 // Sort the list of exits by block id. |
| 936 GrowableArray<BlockEntryInstr*> exits(callee_exits->length()); | 936 GrowableArray<BlockEntryInstr*> exits(callee_exits->length()); |
| 937 for (intptr_t i = 0; i < callee_exits->length(); ++i) { | 937 for (intptr_t i = 0; i < callee_exits->length(); ++i) { |
| 938 exits.Add((*callee_exits)[i]->GetBlock()); | 938 exits.Add((*callee_exits)[i]->GetBlock()); |
| 939 } | 939 } |
| 940 exits.Sort(LowestBlockIdFirst); | 940 exits.Sort(LowestBlockIdFirst); |
| 941 // Create a join of the returns. | 941 // Create a join of the returns. |
| 942 JoinEntryInstr* join = | 942 JoinEntryInstr* join = |
| 943 new JoinEntryInstr(++max_block_id_, CatchClauseNode::kInvalidTryIndex); | 943 new JoinEntryInstr(++max_block_id_, |
| 944 CatchClauseNode::kInvalidTryIndex, |
| 945 caller_entry->loop_depth()); |
| 944 for (intptr_t i = 0; i < exits.length(); ++i) { | 946 for (intptr_t i = 0; i < exits.length(); ++i) { |
| 945 ReturnInstr* exit_instr = exits[i]->last_instruction()->AsReturn(); | 947 ReturnInstr* exit_instr = exits[i]->last_instruction()->AsReturn(); |
| 946 ASSERT(exit_instr != NULL); | 948 ASSERT(exit_instr != NULL); |
| 947 exit_instr->previous()->Goto(join); | 949 exit_instr->previous()->Goto(join); |
| 948 // Directly add the predecessors of the join in ascending block id order. | 950 // Directly add the predecessors of the join in ascending block id order. |
| 949 join->predecessors_.Add(exits[i]); | 951 join->predecessors_.Add(exits[i]); |
| 950 } | 952 } |
| 951 // If the call has uses, create a phi of the returns. | 953 // If the call has uses, create a phi of the returns. |
| 952 if ((call->input_use_list() != NULL) || | 954 if ((call->input_use_list() != NULL) || |
| 953 (call->env_use_list() != NULL)) { | 955 (call->env_use_list() != NULL)) { |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1004 !it.Done(); | 1006 !it.Done(); |
| 1005 it.Advance()) { | 1007 it.Advance()) { |
| 1006 ++size; | 1008 ++size; |
| 1007 } | 1009 } |
| 1008 } | 1010 } |
| 1009 return size; | 1011 return size; |
| 1010 } | 1012 } |
| 1011 | 1013 |
| 1012 | 1014 |
| 1013 } // namespace dart | 1015 } // namespace dart |
| OLD | NEW |