| Index: src/hydrogen-instructions.h
|
| ===================================================================
|
| --- src/hydrogen-instructions.h (revision 6904)
|
| +++ src/hydrogen-instructions.h (working copy)
|
| @@ -77,6 +77,7 @@
|
| // HLoadKeyedFastElement
|
| // HLoadKeyedGeneric
|
| // HLoadNamedGeneric
|
| +// HPower
|
| // HStoreNamed
|
| // HStoreNamedField
|
| // HStoreNamedGeneric
|
| @@ -93,13 +94,13 @@
|
| // HCallStub
|
| // HConstant
|
| // HControlInstruction
|
| +// HDeoptimize
|
| // HGoto
|
| // HUnaryControlInstruction
|
| // HBranch
|
| // HCompareMapAndBranch
|
| // HReturn
|
| // HThrow
|
| -// HDeoptimize
|
| // HEnterInlined
|
| // HFunctionLiteral
|
| // HGlobalObject
|
| @@ -139,6 +140,7 @@
|
| // HHasCachedArrayIndex
|
| // HHasInstanceType
|
| // HIsNull
|
| +// HIsObject
|
| // HIsSmi
|
| // HValueOf
|
| // HUnknownOSRValue
|
| @@ -207,6 +209,7 @@
|
| V(Goto) \
|
| V(InstanceOf) \
|
| V(IsNull) \
|
| + V(IsObject) \
|
| V(IsSmi) \
|
| V(HasInstanceType) \
|
| V(HasCachedArrayIndex) \
|
| @@ -223,6 +226,7 @@
|
| V(ObjectLiteral) \
|
| V(OsrEntry) \
|
| V(Parameter) \
|
| + V(Power) \
|
| V(PushArgument) \
|
| V(RegExpLiteral) \
|
| V(Return) \
|
| @@ -330,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;
|
| @@ -349,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);
|
| @@ -897,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")
|
| @@ -1365,7 +1375,7 @@
|
|
|
| class HUnaryMathOperation: public HUnaryOperation {
|
| public:
|
| - HUnaryMathOperation(HValue* value, MathFunctionId op)
|
| + HUnaryMathOperation(HValue* value, BuiltinFunctionId op)
|
| : HUnaryOperation(value), op_(op) {
|
| switch (op) {
|
| case kMathFloor:
|
| @@ -1378,8 +1388,14 @@
|
| SetFlag(kFlexibleRepresentation);
|
| break;
|
| case kMathSqrt:
|
| + case kMathPowHalf:
|
| + case kMathLog:
|
| + case kMathSin:
|
| + case kMathCos:
|
| + set_representation(Representation::Double());
|
| + break;
|
| default:
|
| - set_representation(Representation::Double());
|
| + UNREACHABLE();
|
| }
|
| SetFlag(kUseGVN);
|
| }
|
| @@ -1396,6 +1412,10 @@
|
| case kMathRound:
|
| case kMathCeil:
|
| case kMathSqrt:
|
| + case kMathPowHalf:
|
| + case kMathLog:
|
| + case kMathSin:
|
| + case kMathCos:
|
| return Representation::Double();
|
| break;
|
| case kMathAbs:
|
| @@ -1416,13 +1436,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_;
|
| };
|
|
|
|
|
| @@ -2088,11 +2114,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) { }
|
| @@ -2117,6 +2157,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.
|
| @@ -2142,6 +2188,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_;
|
| };
|
| @@ -2185,6 +2237,22 @@
|
| };
|
|
|
|
|
| +class HPower: public HBinaryOperation {
|
| + public:
|
| + HPower(HValue* left, HValue* right)
|
| + : HBinaryOperation(left, right) {
|
| + set_representation(Representation::Double());
|
| + SetFlag(kUseGVN);
|
| + }
|
| +
|
| + virtual Representation RequiredInputRepresentation(int index) const {
|
| + return (index == 1) ? Representation::None() : Representation::Double();
|
| + }
|
| +
|
| + DECLARE_CONCRETE_INSTRUCTION(Power, "power")
|
| +};
|
| +
|
| +
|
| class HAdd: public HArithmeticBinaryOperation {
|
| public:
|
| HAdd(HValue* left, HValue* right) : HArithmeticBinaryOperation(left, right) {
|
|
|