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/dart_entry.h" | 9 #include "vm/dart_entry.h" |
10 #include "vm/flow_graph_builder.h" | 10 #include "vm/flow_graph_builder.h" |
(...skipping 4942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4953 // this value is stored in a field, escapes to another function or | 4953 // this value is stored in a field, escapes to another function or |
4954 // participates in a phi. | 4954 // participates in a phi. |
4955 static bool CanBeAliased(AllocateObjectInstr* alloc) { | 4955 static bool CanBeAliased(AllocateObjectInstr* alloc) { |
4956 if (alloc->identity() == AllocateObjectInstr::kUnknown) { | 4956 if (alloc->identity() == AllocateObjectInstr::kUnknown) { |
4957 bool escapes = false; | 4957 bool escapes = false; |
4958 for (Value* use = alloc->input_use_list(); | 4958 for (Value* use = alloc->input_use_list(); |
4959 use != NULL; | 4959 use != NULL; |
4960 use = use->next_use()) { | 4960 use = use->next_use()) { |
4961 Instruction* instr = use->instruction(); | 4961 Instruction* instr = use->instruction(); |
4962 if (instr->IsPushArgument() || | 4962 if (instr->IsPushArgument() || |
4963 (instr->IsStoreVMField() && (use->use_index() != 1)) || | 4963 (instr->IsStoreVMField() |
4964 (instr->IsStoreInstanceField() && (use->use_index() != 0)) || | 4964 && (use->use_index() != StoreVMFieldInstr::kObjectPos)) || |
| 4965 (instr->IsStoreInstanceField() |
| 4966 && (use->use_index() != StoreInstanceFieldInstr::kInstancePos)) || |
4965 instr->IsStoreStaticField() || | 4967 instr->IsStoreStaticField() || |
4966 instr->IsPhi() || | 4968 instr->IsPhi() || |
4967 instr->IsAssertAssignable() || | 4969 instr->IsAssertAssignable() || |
4968 instr->IsRedefinition()) { | 4970 instr->IsRedefinition()) { |
4969 escapes = true; | 4971 escapes = true; |
4970 break; | 4972 break; |
4971 } | 4973 } |
4972 } | 4974 } |
4973 | 4975 |
4974 alloc->set_identity(escapes ? AllocateObjectInstr::kAliased | 4976 alloc->set_identity(escapes ? AllocateObjectInstr::kAliased |
(...skipping 3171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8146 } | 8148 } |
8147 | 8149 |
8148 // Insert materializations at environment uses. | 8150 // Insert materializations at environment uses. |
8149 for (intptr_t i = 0; i < exits.length(); i++) { | 8151 for (intptr_t i = 0; i < exits.length(); i++) { |
8150 CreateMaterializationAt(exits[i], alloc, alloc->cls(), *fields); | 8152 CreateMaterializationAt(exits[i], alloc, alloc->cls(), *fields); |
8151 } | 8153 } |
8152 } | 8154 } |
8153 | 8155 |
8154 | 8156 |
8155 } // namespace dart | 8157 } // namespace dart |
OLD | NEW |