| 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 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 728 if (IsNonConstant(value)) { | 728 if (IsNonConstant(value)) { |
| 729 SetValue(instr, non_constant_); | 729 SetValue(instr, non_constant_); |
| 730 } else if (IsConstant(value)) { | 730 } else if (IsConstant(value)) { |
| 731 bool val = value.raw() != Bool::True().raw(); | 731 bool val = value.raw() != Bool::True().raw(); |
| 732 SetValue(instr, Bool::Get(val)); | 732 SetValue(instr, Bool::Get(val)); |
| 733 } | 733 } |
| 734 } | 734 } |
| 735 | 735 |
| 736 | 736 |
| 737 void ConstantPropagator::VisitInstanceOf(InstanceOfInstr* instr) { | 737 void ConstantPropagator::VisitInstanceOf(InstanceOfInstr* instr) { |
| 738 const Definition* def = instr->value()->definition(); | 738 Definition* def = instr->value()->definition(); |
| 739 const Object& value = def->constant_value(); | 739 const Object& value = def->constant_value(); |
| 740 if (IsNonConstant(value)) { | 740 if (IsNonConstant(value)) { |
| 741 const AbstractType& checked_type = instr->type(); | 741 const AbstractType& checked_type = instr->type(); |
| 742 intptr_t value_cid = instr->value()->Type()->ToCid(); | 742 intptr_t value_cid = instr->value()->Type()->ToCid(); |
| 743 Representation rep = def->representation(); | 743 Representation rep = def->representation(); |
| 744 if ((checked_type.IsFloat32x4Type() && (rep == kUnboxedFloat32x4)) || | 744 if ((checked_type.IsFloat32x4Type() && (rep == kUnboxedFloat32x4)) || |
| 745 (checked_type.IsInt32x4Type() && (rep == kUnboxedInt32x4)) || | 745 (checked_type.IsInt32x4Type() && (rep == kUnboxedInt32x4)) || |
| 746 (checked_type.IsDoubleType() && (rep == kUnboxedDouble) && | 746 (checked_type.IsDoubleType() && (rep == kUnboxedDouble) && |
| 747 FlowGraphCompiler::SupportsUnboxedDoubles()) || | 747 FlowGraphCompiler::SupportsUnboxedDoubles()) || |
| 748 (checked_type.IsIntType() && (rep == kUnboxedMint))) { | 748 (checked_type.IsIntType() && (rep == kUnboxedMint))) { |
| (...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1679 graph_->MergeBlocks(); | 1679 graph_->MergeBlocks(); |
| 1680 GrowableArray<BitVector*> dominance_frontier; | 1680 GrowableArray<BitVector*> dominance_frontier; |
| 1681 graph_->ComputeDominators(&dominance_frontier); | 1681 graph_->ComputeDominators(&dominance_frontier); |
| 1682 | 1682 |
| 1683 if (FLAG_trace_constant_propagation) { | 1683 if (FLAG_trace_constant_propagation) { |
| 1684 FlowGraphPrinter::PrintGraph("After CP", graph_); | 1684 FlowGraphPrinter::PrintGraph("After CP", graph_); |
| 1685 } | 1685 } |
| 1686 } | 1686 } |
| 1687 | 1687 |
| 1688 } // namespace dart | 1688 } // namespace dart |
| OLD | NEW |