| Index: src/hydrogen-instructions.h
|
| ===================================================================
|
| --- src/hydrogen-instructions.h (revision 6095)
|
| +++ src/hydrogen-instructions.h (working copy)
|
| @@ -94,13 +94,13 @@
|
| // HCallStub
|
| // HConstant
|
| // HControlInstruction
|
| +// HDeoptimize
|
| // HGoto
|
| // HUnaryControlInstruction
|
| // HBranch
|
| // HCompareMapAndBranch
|
| // HReturn
|
| // HThrow
|
| -// HDeoptimize
|
| // HEnterInlined
|
| // HFunctionLiteral
|
| // HGlobalObject
|
| @@ -140,6 +140,7 @@
|
| // HHasCachedArrayIndex
|
| // HHasInstanceType
|
| // HIsNull
|
| +// HIsObject
|
| // HIsSmi
|
| // HValueOf
|
| // HUnknownOSRValue
|
| @@ -208,6 +209,7 @@
|
| V(Goto) \
|
| V(InstanceOf) \
|
| V(IsNull) \
|
| + V(IsObject) \
|
| V(IsSmi) \
|
| V(HasInstanceType) \
|
| V(HasCachedArrayIndex) \
|
| @@ -332,6 +334,9 @@
|
| set_can_be_minus_zero(false);
|
| }
|
|
|
| + // Adds a constant to the lower and upper bound of the range.
|
| + void AddConstant(int32_t value);
|
| +
|
| void StackUpon(Range* other) {
|
| Intersect(other);
|
| next_ = other;
|
| @@ -351,7 +356,8 @@
|
| set_can_be_minus_zero(b);
|
| }
|
|
|
| - void Add(int32_t value);
|
| + // Compute a new result range and return true, if the operation
|
| + // can overflow.
|
| bool AddAndCheckOverflow(Range* other);
|
| bool SubAndCheckOverflow(Range* other);
|
| bool MulAndCheckOverflow(Range* other);
|
| @@ -899,6 +905,8 @@
|
| virtual HBasicBlock* FirstSuccessor() const { return true_destination_; }
|
| virtual HBasicBlock* SecondSuccessor() const { return false_destination_; }
|
|
|
| + virtual void PrintDataTo(StringStream* stream) const;
|
| +
|
| Handle<Map> map() const { return map_; }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(CompareMapAndBranch, "compare_map_and_branch")
|
| @@ -1366,7 +1374,7 @@
|
|
|
| class HUnaryMathOperation: public HUnaryOperation {
|
| public:
|
| - HUnaryMathOperation(HValue* value, MathFunctionId op)
|
| + HUnaryMathOperation(HValue* value, BuiltinFunctionId op)
|
| : HUnaryOperation(value), op_(op) {
|
| switch (op) {
|
| case kMathFloor:
|
| @@ -1380,8 +1388,13 @@
|
| break;
|
| case kMathSqrt:
|
| case kMathPowHalf:
|
| + case kMathLog:
|
| + case kMathSin:
|
| + case kMathCos:
|
| + set_representation(Representation::Double());
|
| + break;
|
| default:
|
| - set_representation(Representation::Double());
|
| + UNREACHABLE();
|
| }
|
| SetFlag(kUseGVN);
|
| }
|
| @@ -1399,6 +1412,9 @@
|
| case kMathCeil:
|
| case kMathSqrt:
|
| case kMathPowHalf:
|
| + case kMathLog:
|
| + case kMathSin:
|
| + case kMathCos:
|
| return Representation::Double();
|
| break;
|
| case kMathAbs:
|
| @@ -1419,13 +1435,19 @@
|
| return this;
|
| }
|
|
|
| - MathFunctionId op() const { return op_; }
|
| + BuiltinFunctionId op() const { return op_; }
|
| const char* OpName() const;
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(UnaryMathOperation, "unary_math_operation")
|
|
|
| + protected:
|
| + virtual bool DataEquals(HValue* other) const {
|
| + HUnaryMathOperation* b = HUnaryMathOperation::cast(other);
|
| + return op_ == b->op();
|
| + }
|
| +
|
| private:
|
| - MathFunctionId op_;
|
| + BuiltinFunctionId op_;
|
| };
|
|
|
|
|
| @@ -2091,11 +2113,25 @@
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(IsNull, "is_null")
|
|
|
| + protected:
|
| + virtual bool DataEquals(HValue* other) const {
|
| + HIsNull* b = HIsNull::cast(other);
|
| + return is_strict_ == b->is_strict();
|
| + }
|
| +
|
| private:
|
| bool is_strict_;
|
| };
|
|
|
|
|
| +class HIsObject: public HUnaryPredicate {
|
| + public:
|
| + explicit HIsObject(HValue* value) : HUnaryPredicate(value) { }
|
| +
|
| + DECLARE_CONCRETE_INSTRUCTION(IsObject, "is_object")
|
| +};
|
| +
|
| +
|
| class HIsSmi: public HUnaryPredicate {
|
| public:
|
| explicit HIsSmi(HValue* value) : HUnaryPredicate(value) { }
|
| @@ -2120,6 +2156,12 @@
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(HasInstanceType, "has_instance_type")
|
|
|
| + protected:
|
| + virtual bool DataEquals(HValue* other) const {
|
| + HHasInstanceType* b = HHasInstanceType::cast(other);
|
| + return (from_ == b->from()) && (to_ == b->to());
|
| + }
|
| +
|
| private:
|
| InstanceType from_;
|
| InstanceType to_; // Inclusive range, not all combinations work.
|
| @@ -2145,6 +2187,12 @@
|
|
|
| Handle<String> class_name() const { return class_name_; }
|
|
|
| + protected:
|
| + virtual bool DataEquals(HValue* other) const {
|
| + HClassOfTest* b = HClassOfTest::cast(other);
|
| + return class_name_.is_identical_to(b->class_name_);
|
| + }
|
| +
|
| private:
|
| Handle<String> class_name_;
|
| };
|
|
|