| 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/constant_propagator.h" | 5 #include "vm/constant_propagator.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/flow_graph_builder.h" | 8 #include "vm/flow_graph_builder.h" |
| 9 #include "vm/flow_graph_compiler.h" | 9 #include "vm/flow_graph_compiler.h" |
| 10 #include "vm/flow_graph_range_analysis.h" | 10 #include "vm/flow_graph_range_analysis.h" |
| (...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 860 void ConstantPropagator::VisitInstantiateType(InstantiateTypeInstr* instr) { | 860 void ConstantPropagator::VisitInstantiateType(InstantiateTypeInstr* instr) { |
| 861 const Object& object = | 861 const Object& object = |
| 862 instr->instantiator()->definition()->constant_value(); | 862 instr->instantiator()->definition()->constant_value(); |
| 863 if (IsNonConstant(object)) { | 863 if (IsNonConstant(object)) { |
| 864 SetValue(instr, non_constant_); | 864 SetValue(instr, non_constant_); |
| 865 return; | 865 return; |
| 866 } | 866 } |
| 867 if (IsConstant(object)) { | 867 if (IsConstant(object)) { |
| 868 if (instr->type().IsTypeParameter()) { | 868 if (instr->type().IsTypeParameter()) { |
| 869 if (object.IsNull()) { | 869 if (object.IsNull()) { |
| 870 SetValue(instr, Type::ZoneHandle(Z, Type::DynamicType())); | 870 SetValue(instr, Object::dynamic_type()); |
| 871 return; | 871 return; |
| 872 } | 872 } |
| 873 // We could try to instantiate the type parameter and return it if no | 873 // We could try to instantiate the type parameter and return it if no |
| 874 // malformed error is reported. | 874 // malformed error is reported. |
| 875 } | 875 } |
| 876 SetValue(instr, non_constant_); | 876 SetValue(instr, non_constant_); |
| 877 } | 877 } |
| 878 } | 878 } |
| 879 | 879 |
| 880 | 880 |
| (...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1683 graph_->MergeBlocks(); | 1683 graph_->MergeBlocks(); |
| 1684 GrowableArray<BitVector*> dominance_frontier; | 1684 GrowableArray<BitVector*> dominance_frontier; |
| 1685 graph_->ComputeDominators(&dominance_frontier); | 1685 graph_->ComputeDominators(&dominance_frontier); |
| 1686 | 1686 |
| 1687 if (FLAG_trace_constant_propagation) { | 1687 if (FLAG_trace_constant_propagation) { |
| 1688 FlowGraphPrinter::PrintGraph("After CP", graph_); | 1688 FlowGraphPrinter::PrintGraph("After CP", graph_); |
| 1689 } | 1689 } |
| 1690 } | 1690 } |
| 1691 | 1691 |
| 1692 } // namespace dart | 1692 } // namespace dart |
| OLD | NEW |