| 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/flow_graph_builder.h" | 9 #include "vm/flow_graph_builder.h" |
| 10 #include "vm/flow_graph_compiler.h" | 10 #include "vm/flow_graph_compiler.h" |
| (...skipping 4569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4580 SetValue(instr, non_constant_); | 4580 SetValue(instr, non_constant_); |
| 4581 return; | 4581 return; |
| 4582 } | 4582 } |
| 4583 if (IsConstant(object)) { | 4583 if (IsConstant(object)) { |
| 4584 const intptr_t len = instr->type_arguments().Length(); | 4584 const intptr_t len = instr->type_arguments().Length(); |
| 4585 if (instr->type_arguments().IsRawInstantiatedRaw(len) && | 4585 if (instr->type_arguments().IsRawInstantiatedRaw(len) && |
| 4586 object.IsNull()) { | 4586 object.IsNull()) { |
| 4587 SetValue(instr, object); | 4587 SetValue(instr, object); |
| 4588 return; | 4588 return; |
| 4589 } | 4589 } |
| 4590 if (instr->type_arguments().IsUninstantiatedIdentity()) { | 4590 if (instr->type_arguments().IsUninstantiatedIdentity() || |
| 4591 instr->type_arguments().CanShareInstantiatorTypeArguments( |
| 4592 instr->instantiator_class())) { |
| 4591 SetValue(instr, object); | 4593 SetValue(instr, object); |
| 4592 return; | 4594 return; |
| 4593 } | 4595 } |
| 4594 SetValue(instr, non_constant_); | 4596 SetValue(instr, non_constant_); |
| 4595 } | 4597 } |
| 4596 } | 4598 } |
| 4597 | 4599 |
| 4598 | 4600 |
| 4599 void ConstantPropagator::VisitExtractConstructorTypeArguments( | 4601 void ConstantPropagator::VisitExtractConstructorTypeArguments( |
| 4600 ExtractConstructorTypeArgumentsInstr* instr) { | 4602 ExtractConstructorTypeArgumentsInstr* instr) { |
| (...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5447 if (changed) { | 5449 if (changed) { |
| 5448 // We may have changed the block order and the dominator tree. | 5450 // We may have changed the block order and the dominator tree. |
| 5449 flow_graph->DiscoverBlocks(); | 5451 flow_graph->DiscoverBlocks(); |
| 5450 GrowableArray<BitVector*> dominance_frontier; | 5452 GrowableArray<BitVector*> dominance_frontier; |
| 5451 flow_graph->ComputeDominators(&dominance_frontier); | 5453 flow_graph->ComputeDominators(&dominance_frontier); |
| 5452 } | 5454 } |
| 5453 } | 5455 } |
| 5454 | 5456 |
| 5455 | 5457 |
| 5456 } // namespace dart | 5458 } // namespace dart |
| OLD | NEW |