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/cpu.h" | 9 #include "vm/cpu.h" |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 4952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4963 } | 4963 } |
4964 } | 4964 } |
4965 | 4965 |
4966 | 4966 |
4967 RangeAnalysis::Direction RangeAnalysis::ToDirection(Value* val) { | 4967 RangeAnalysis::Direction RangeAnalysis::ToDirection(Value* val) { |
4968 if (val->BindsToConstant()) { | 4968 if (val->BindsToConstant()) { |
4969 return (Smi::Cast(val->BoundConstant()).Value() >= 0) ? kPositive | 4969 return (Smi::Cast(val->BoundConstant()).Value() >= 0) ? kPositive |
4970 : kNegative; | 4970 : kNegative; |
4971 } else if (val->definition()->range() != NULL) { | 4971 } else if (val->definition()->range() != NULL) { |
4972 Range* range = val->definition()->range(); | 4972 Range* range = val->definition()->range(); |
4973 if (Range::ConstantMin(range).value() >= 0) { | 4973 if (Range::ConstantMin(range).Value() >= 0) { |
4974 return kPositive; | 4974 return kPositive; |
4975 } else if (Range::ConstantMax(range).value() <= 0) { | 4975 } else if (Range::ConstantMax(range).Value() <= 0) { |
4976 return kNegative; | 4976 return kNegative; |
4977 } | 4977 } |
4978 } | 4978 } |
4979 return kUnknown; | 4979 return kUnknown; |
4980 } | 4980 } |
4981 | 4981 |
4982 | 4982 |
4983 Range* RangeAnalysis::InferInductionVariableRange(JoinEntryInstr* loop_header, | 4983 Range* RangeAnalysis::InferInductionVariableRange(JoinEntryInstr* loop_header, |
4984 PhiInstr* var) { | 4984 PhiInstr* var) { |
4985 BitVector* loop_info = loop_header->loop_info(); | 4985 BitVector* loop_info = loop_header->loop_info(); |
(...skipping 4871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9857 } | 9857 } |
9858 | 9858 |
9859 // Insert materializations at environment uses. | 9859 // Insert materializations at environment uses. |
9860 for (intptr_t i = 0; i < exits.length(); i++) { | 9860 for (intptr_t i = 0; i < exits.length(); i++) { |
9861 CreateMaterializationAt(exits[i], alloc, alloc->cls(), *slots); | 9861 CreateMaterializationAt(exits[i], alloc, alloc->cls(), *slots); |
9862 } | 9862 } |
9863 } | 9863 } |
9864 | 9864 |
9865 | 9865 |
9866 } // namespace dart | 9866 } // namespace dart |
OLD | NEW |