| 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/cpu.h" | 9 #include "vm/cpu.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 4920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4931 for (BlockIterator block_it = flow_graph->reverse_postorder_iterator(); | 4931 for (BlockIterator block_it = flow_graph->reverse_postorder_iterator(); |
| 4932 !block_it.Done(); | 4932 !block_it.Done(); |
| 4933 block_it.Advance()) { | 4933 block_it.Advance()) { |
| 4934 BlockEntryInstr* block = block_it.Current(); | 4934 BlockEntryInstr* block = block_it.Current(); |
| 4935 if (block->try_index() == catch_entry->catch_try_index()) { | 4935 if (block->try_index() == catch_entry->catch_try_index()) { |
| 4936 for (ForwardInstructionIterator instr_it(block); | 4936 for (ForwardInstructionIterator instr_it(block); |
| 4937 !instr_it.Done(); | 4937 !instr_it.Done(); |
| 4938 instr_it.Advance()) { | 4938 instr_it.Advance()) { |
| 4939 Instruction* current = instr_it.Current(); | 4939 Instruction* current = instr_it.Current(); |
| 4940 if (current->MayThrow()) { | 4940 if (current->MayThrow()) { |
| 4941 Environment* env = current->env(); | 4941 Environment* env = current->env()->Outermost(); |
| 4942 ASSERT(env != NULL); | 4942 ASSERT(env != NULL); |
| 4943 for (intptr_t env_idx = 0; env_idx < cdefs.length(); ++env_idx) { | 4943 for (intptr_t env_idx = 0; env_idx < cdefs.length(); ++env_idx) { |
| 4944 if (cdefs[env_idx] != NULL && | 4944 if (cdefs[env_idx] != NULL && |
| 4945 env->ValueAt(env_idx)->BindsToConstant()) { | 4945 env->ValueAt(env_idx)->BindsToConstant()) { |
| 4946 cdefs[env_idx] = env->ValueAt(env_idx)->definition(); | 4946 cdefs[env_idx] = env->ValueAt(env_idx)->definition(); |
| 4947 } | 4947 } |
| 4948 if (cdefs[env_idx] != env->ValueAt(env_idx)->definition()) { | 4948 if (cdefs[env_idx] != env->ValueAt(env_idx)->definition()) { |
| 4949 cdefs[env_idx] = NULL; | 4949 cdefs[env_idx] = NULL; |
| 4950 } | 4950 } |
| 4951 } | 4951 } |
| (...skipping 5110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10062 | 10062 |
| 10063 // Insert materializations at environment uses. | 10063 // Insert materializations at environment uses. |
| 10064 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) { | 10064 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) { |
| 10065 CreateMaterializationAt( | 10065 CreateMaterializationAt( |
| 10066 exits_collector_.exits()[i], alloc, *slots); | 10066 exits_collector_.exits()[i], alloc, *slots); |
| 10067 } | 10067 } |
| 10068 } | 10068 } |
| 10069 | 10069 |
| 10070 | 10070 |
| 10071 } // namespace dart | 10071 } // namespace dart |
| OLD | NEW |