| 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 8178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8189 } | 8189 } |
| 8190 | 8190 |
| 8191 // Process materializations and unbox their arguments: materializations | 8191 // Process materializations and unbox their arguments: materializations |
| 8192 // are part of the environment and can materialize boxes for double/mint/simd | 8192 // are part of the environment and can materialize boxes for double/mint/simd |
| 8193 // values when needed. | 8193 // values when needed. |
| 8194 // TODO(vegorov): handle all box types here. | 8194 // TODO(vegorov): handle all box types here. |
| 8195 for (intptr_t i = 0; i < materializations_.length(); i++) { | 8195 for (intptr_t i = 0; i < materializations_.length(); i++) { |
| 8196 MaterializeObjectInstr* mat = materializations_[i]; | 8196 MaterializeObjectInstr* mat = materializations_[i]; |
| 8197 for (intptr_t j = 0; j < mat->InputCount(); j++) { | 8197 for (intptr_t j = 0; j < mat->InputCount(); j++) { |
| 8198 Definition* defn = mat->InputAt(j)->definition(); | 8198 Definition* defn = mat->InputAt(j)->definition(); |
| 8199 if (defn->IsBoxDouble()) { | 8199 if (defn->IsBoxDouble() || |
| 8200 defn->IsBoxFloat32x4() || |
| 8201 defn->IsBoxInt32x4()) { |
| 8200 mat->InputAt(j)->BindTo(defn->InputAt(0)->definition()); | 8202 mat->InputAt(j)->BindTo(defn->InputAt(0)->definition()); |
| 8201 } | 8203 } |
| 8202 } | 8204 } |
| 8203 } | 8205 } |
| 8204 } | 8206 } |
| 8205 | 8207 |
| 8206 | 8208 |
| 8207 // Remove materializations from the graph. Register allocator will treat them | 8209 // Remove materializations from the graph. Register allocator will treat them |
| 8208 // as part of the environment not as a real instruction. | 8210 // as part of the environment not as a real instruction. |
| 8209 void AllocationSinking::DetachMaterializations() { | 8211 void AllocationSinking::DetachMaterializations() { |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8321 } | 8323 } |
| 8322 | 8324 |
| 8323 // Insert materializations at environment uses. | 8325 // Insert materializations at environment uses. |
| 8324 for (intptr_t i = 0; i < exits.length(); i++) { | 8326 for (intptr_t i = 0; i < exits.length(); i++) { |
| 8325 CreateMaterializationAt(exits[i], alloc, alloc->cls(), *fields); | 8327 CreateMaterializationAt(exits[i], alloc, alloc->cls(), *fields); |
| 8326 } | 8328 } |
| 8327 } | 8329 } |
| 8328 | 8330 |
| 8329 | 8331 |
| 8330 } // namespace dart | 8332 } // namespace dart |
| OLD | NEW |