| Index: runtime/vm/intermediate_language.h
|
| ===================================================================
|
| --- runtime/vm/intermediate_language.h (revision 20842)
|
| +++ runtime/vm/intermediate_language.h (working copy)
|
| @@ -1825,6 +1825,14 @@
|
| return constrained_type_;
|
| }
|
|
|
| + void set_constant_target(TargetEntryInstr* target) {
|
| + ASSERT(target == true_successor() || target == false_successor());
|
| + constant_target_ = target;
|
| + }
|
| + TargetEntryInstr* constant_target() const {
|
| + return constant_target_;
|
| + }
|
| +
|
| private:
|
| virtual void RawSetInputAt(intptr_t i, Value* value);
|
|
|
| @@ -1833,6 +1841,8 @@
|
|
|
| ConstrainedCompileType* constrained_type_;
|
|
|
| + TargetEntryInstr* constant_target_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(BranchInstr);
|
| };
|
|
|
| @@ -2029,12 +2039,12 @@
|
| return min_.Equals(other->min_) && max_.Equals(other->max_);
|
| }
|
|
|
| - static RangeBoundary ConstantMin(Range* range) {
|
| + static RangeBoundary ConstantMin(const Range* range) {
|
| if (range == NULL) return RangeBoundary::MinSmi();
|
| return range->min().LowerBound().Clamp();
|
| }
|
|
|
| - static RangeBoundary ConstantMax(Range* range) {
|
| + static RangeBoundary ConstantMax(const Range* range) {
|
| if (range == NULL) return RangeBoundary::MaxSmi();
|
| return range->max().UpperBound().Clamp();
|
| }
|
| @@ -2042,6 +2052,8 @@
|
| // Inclusive.
|
| bool IsWithin(intptr_t min_int, intptr_t max_int) const;
|
|
|
| + bool IsUnsatisfiable() const;
|
| +
|
| private:
|
| RangeBoundary min_;
|
| RangeBoundary max_;
|
| @@ -2051,7 +2063,8 @@
|
| class ConstraintInstr : public TemplateDefinition<2> {
|
| public:
|
| ConstraintInstr(Value* value, Range* constraint)
|
| - : constraint_(constraint) {
|
| + : constraint_(constraint),
|
| + target_(NULL) {
|
| SetInputAt(0, value);
|
| }
|
|
|
| @@ -2085,12 +2098,23 @@
|
| SetInputAt(1, val);
|
| }
|
|
|
| + // Constraints for branches have their target block stored in order
|
| + // to find the the comparsion that generated the constraint:
|
| + // target->predecessor->last_instruction->comparison.
|
| + void set_target(TargetEntryInstr* target) {
|
| + target_ = target;
|
| + }
|
| + TargetEntryInstr* target() const {
|
| + return target_;
|
| + }
|
| +
|
| private:
|
| Value* dependency() {
|
| return inputs_[1];
|
| }
|
|
|
| Range* constraint_;
|
| + TargetEntryInstr* target_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(ConstraintInstr);
|
| };
|
|
|