| 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 907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 918 caller_entry->ClearDominatedBlocks(); | 918 caller_entry->ClearDominatedBlocks(); |
| 919 for (intptr_t i = 0; i < callee_entry->dominated_blocks().length(); ++i) { | 919 for (intptr_t i = 0; i < callee_entry->dominated_blocks().length(); ++i) { |
| 920 BlockEntryInstr* block = callee_entry->dominated_blocks()[i]; | 920 BlockEntryInstr* block = callee_entry->dominated_blocks()[i]; |
| 921 block->set_dominator(caller_entry); | 921 block->set_dominator(caller_entry); |
| 922 caller_entry->AddDominatedBlock(block); | 922 caller_entry->AddDominatedBlock(block); |
| 923 } | 923 } |
| 924 } | 924 } |
| 925 } else { | 925 } else { |
| 926 // Create a join of the returns. | 926 // Create a join of the returns. |
| 927 JoinEntryInstr* join = | 927 JoinEntryInstr* join = |
| 928 new JoinEntryInstr(++max_block_id_, | 928 new JoinEntryInstr(++max_block_id_, CatchClauseNode::kInvalidTryIndex); |
| 929 CatchClauseNode::kInvalidTryIndex, | |
| 930 caller_entry->loop_depth()); | |
| 931 intptr_t count = inlining_context->NumExits(); | 929 intptr_t count = inlining_context->NumExits(); |
| 932 for (intptr_t i = 0; i < count; ++i) { | 930 for (intptr_t i = 0; i < count; ++i) { |
| 933 inlining_context->LastInstructionAt(i)->Goto(join); | 931 inlining_context->LastInstructionAt(i)->Goto(join); |
| 934 // Directly add the predecessors of the join in ascending block id order. | 932 // Directly add the predecessors of the join in ascending block id order. |
| 935 join->predecessors_.Add(inlining_context->ExitBlockAt(i)); | 933 join->predecessors_.Add(inlining_context->ExitBlockAt(i)); |
| 936 } | 934 } |
| 937 // If the call has uses, create a phi of the returns. | 935 // If the call has uses, create a phi of the returns. |
| 938 if (call->HasUses()) { | 936 if (call->HasUses()) { |
| 939 // Environment count: length before call - argument count (+ return) | 937 // Environment count: length before call - argument count (+ return) |
| 940 intptr_t env_count = call->env()->Length() - call->ArgumentCount(); | 938 intptr_t env_count = call->env()->Length() - call->ArgumentCount(); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 987 !it.Done(); | 985 !it.Done(); |
| 988 it.Advance()) { | 986 it.Advance()) { |
| 989 ++size; | 987 ++size; |
| 990 } | 988 } |
| 991 } | 989 } |
| 992 return size; | 990 return size; |
| 993 } | 991 } |
| 994 | 992 |
| 995 | 993 |
| 996 } // namespace dart | 994 } // namespace dart |
| OLD | NEW |