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 4380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4391 bool inputs_loop_invariant = true; | 4391 bool inputs_loop_invariant = true; |
4392 for (int i = 0; i < current->InputCount(); ++i) { | 4392 for (int i = 0; i < current->InputCount(); ++i) { |
4393 Definition* input_def = current->InputAt(i)->definition(); | 4393 Definition* input_def = current->InputAt(i)->definition(); |
4394 if (!input_def->GetBlock()->Dominates(pre_header)) { | 4394 if (!input_def->GetBlock()->Dominates(pre_header)) { |
4395 inputs_loop_invariant = false; | 4395 inputs_loop_invariant = false; |
4396 break; | 4396 break; |
4397 } | 4397 } |
4398 } | 4398 } |
4399 if (inputs_loop_invariant && | 4399 if (inputs_loop_invariant && |
4400 !current->IsAssertAssignable() && | 4400 !current->IsAssertAssignable() && |
4401 !current->IsAssertBoolean()) { | 4401 !current->IsAssertBoolean() && |
| 4402 !current->IsGuardField()) { |
4402 // TODO(fschneider): Enable hoisting of Assert-instructions | 4403 // TODO(fschneider): Enable hoisting of Assert-instructions |
4403 // if it safe to do. | 4404 // if it safe to do. |
| 4405 // TODO(15652): Hoisting guard-field instructions causes the |
| 4406 // optimizing compiler to crash. |
4404 Hoist(&it, pre_header, current); | 4407 Hoist(&it, pre_header, current); |
4405 } else if (current->IsCheckSmi() && | 4408 } else if (current->IsCheckSmi() && |
4406 current->InputAt(0)->definition()->IsPhi()) { | 4409 current->InputAt(0)->definition()->IsPhi()) { |
4407 TryHoistCheckSmiThroughPhi( | 4410 TryHoistCheckSmiThroughPhi( |
4408 &it, header, pre_header, current->AsCheckSmi()); | 4411 &it, header, pre_header, current->AsCheckSmi()); |
4409 } | 4412 } |
4410 } | 4413 } |
4411 } | 4414 } |
4412 } | 4415 } |
4413 } | 4416 } |
(...skipping 3658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8072 } | 8075 } |
8073 | 8076 |
8074 // Insert materializations at environment uses. | 8077 // Insert materializations at environment uses. |
8075 for (intptr_t i = 0; i < exits.length(); i++) { | 8078 for (intptr_t i = 0; i < exits.length(); i++) { |
8076 CreateMaterializationAt(exits[i], alloc, alloc->cls(), *fields); | 8079 CreateMaterializationAt(exits[i], alloc, alloc->cls(), *fields); |
8077 } | 8080 } |
8078 } | 8081 } |
8079 | 8082 |
8080 | 8083 |
8081 } // namespace dart | 8084 } // namespace dart |
OLD | NEW |