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