| 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 4921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4932 BitVector* killed = aliased_set_->Get(alias); | 4932 BitVector* killed = aliased_set_->Get(alias); |
| 4933 | 4933 |
| 4934 if (killed != NULL) { | 4934 if (killed != NULL) { |
| 4935 kill->AddAll(killed); | 4935 kill->AddAll(killed); |
| 4936 // There is no need to clear out_values when clearing GEN set | 4936 // There is no need to clear out_values when clearing GEN set |
| 4937 // because only those values that are in the GEN set | 4937 // because only those values that are in the GEN set |
| 4938 // will ever be used. | 4938 // will ever be used. |
| 4939 gen->RemoveAll(killed); | 4939 gen->RemoveAll(killed); |
| 4940 } | 4940 } |
| 4941 | 4941 |
| 4942 // Only forward stores to normal arrays and float64 arrays | 4942 // Only forward stores to normal arrays, float64, and simd arrays |
| 4943 // to loads because other array stores (intXX/uintXX/float32) | 4943 // to loads because other array stores (intXX/uintXX/float32) |
| 4944 // may implicitly convert the value stored. | 4944 // may implicitly convert the value stored. |
| 4945 StoreIndexedInstr* array_store = instr->AsStoreIndexed(); | 4945 StoreIndexedInstr* array_store = instr->AsStoreIndexed(); |
| 4946 if (array_store == NULL || | 4946 if ((array_store == NULL) || |
| 4947 array_store->class_id() == kArrayCid || | 4947 (array_store->class_id() == kArrayCid) || |
| 4948 array_store->class_id() == kTypedDataFloat64ArrayCid) { | 4948 (array_store->class_id() == kTypedDataFloat64ArrayCid) || |
| 4949 (array_store->class_id() == kTypedDataFloat32x4ArrayCid)) { |
| 4949 bool is_load = false; | 4950 bool is_load = false; |
| 4950 Place store_place(instr, &is_load); | 4951 Place store_place(instr, &is_load); |
| 4951 ASSERT(!is_load); | 4952 ASSERT(!is_load); |
| 4952 Place* place = map_->Lookup(&store_place); | 4953 Place* place = map_->Lookup(&store_place); |
| 4953 if (place != NULL) { | 4954 if (place != NULL) { |
| 4954 // Store has a corresponding numbered place that might have a | 4955 // Store has a corresponding numbered place that might have a |
| 4955 // load. Try forwarding stored value to it. | 4956 // load. Try forwarding stored value to it. |
| 4956 gen->Add(place->id()); | 4957 gen->Add(place->id()); |
| 4957 if (out_values == NULL) out_values = CreateBlockOutValues(); | 4958 if (out_values == NULL) out_values = CreateBlockOutValues(); |
| 4958 (*out_values)[place->id()] = GetStoredValue(instr); | 4959 (*out_values)[place->id()] = GetStoredValue(instr); |
| (...skipping 2808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7767 } | 7768 } |
| 7768 | 7769 |
| 7769 // Insert materializations at environment uses. | 7770 // Insert materializations at environment uses. |
| 7770 for (intptr_t i = 0; i < exits.length(); i++) { | 7771 for (intptr_t i = 0; i < exits.length(); i++) { |
| 7771 CreateMaterializationAt(exits[i], alloc, alloc->cls(), *fields); | 7772 CreateMaterializationAt(exits[i], alloc, alloc->cls(), *fields); |
| 7772 } | 7773 } |
| 7773 } | 7774 } |
| 7774 | 7775 |
| 7775 | 7776 |
| 7776 } // namespace dart | 7777 } // namespace dart |
| OLD | NEW |