| Index: src/hydrogen-instructions.h
|
| diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
|
| index ff68bc2887f540c5f85d1842773aba4270ed147b..d20696dd7207f9fe2c042139187500c4da5befda 100644
|
| --- a/src/hydrogen-instructions.h
|
| +++ b/src/hydrogen-instructions.h
|
| @@ -717,7 +717,12 @@ class HValue: public ZoneObject {
|
| #endif
|
|
|
| protected:
|
| - virtual bool DataEquals(HValue* other) const { return true; }
|
| + // This function must be overridden for instructions with flag kUseGVN, to
|
| + // compare the non-Operand parts of the instruction.
|
| + virtual bool DataEquals(HValue* other) const {
|
| + UNREACHABLE();
|
| + return false;
|
| + }
|
| virtual void RepresentationChanged(Representation to) { }
|
| virtual Range* InferRange();
|
| virtual void DeleteFromGraph() = 0;
|
| @@ -1158,6 +1163,9 @@ class HGlobalObject: public HInstruction {
|
| }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(GlobalObject, "global_object")
|
| +
|
| + protected:
|
| + virtual bool DataEquals(HValue* other) const { return true; }
|
| };
|
|
|
|
|
| @@ -1170,6 +1178,9 @@ class HGlobalReceiver: public HInstruction {
|
| }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(GlobalReceiver, "global_receiver")
|
| +
|
| + protected:
|
| + virtual bool DataEquals(HValue* other) const { return true; }
|
| };
|
|
|
|
|
| @@ -1360,6 +1371,9 @@ class HJSArrayLength: public HUnaryOperation {
|
| }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(JSArrayLength, "js_array_length")
|
| +
|
| + protected:
|
| + virtual bool DataEquals(HValue* other) const { return true; }
|
| };
|
|
|
|
|
| @@ -1376,6 +1390,9 @@ class HFixedArrayLength: public HUnaryOperation {
|
| }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(FixedArrayLength, "fixed_array_length")
|
| +
|
| + protected:
|
| + virtual bool DataEquals(HValue* other) const { return true; }
|
| };
|
|
|
|
|
| @@ -1393,6 +1410,9 @@ class HBitNot: public HUnaryOperation {
|
| virtual HType CalculateInferredType() const;
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(BitNot, "bit_not")
|
| +
|
| + protected:
|
| + virtual bool DataEquals(HValue* other) const { return true; }
|
| };
|
|
|
|
|
| @@ -1488,6 +1508,9 @@ class HLoadElements: public HUnaryOperation {
|
| }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(LoadElements, "load-elements")
|
| +
|
| + protected:
|
| + virtual bool DataEquals(HValue* other) const { return true; }
|
| };
|
|
|
|
|
| @@ -1631,6 +1654,9 @@ class HCheckNonSmi: public HUnaryOperation {
|
| #endif
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi, "check_non_smi")
|
| +
|
| + protected:
|
| + virtual bool DataEquals(HValue* other) const { return true; }
|
| };
|
|
|
|
|
| @@ -1692,6 +1718,9 @@ class HCheckSmi: public HUnaryOperation {
|
| #endif
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(CheckSmi, "check_smi")
|
| +
|
| + protected:
|
| + virtual bool DataEquals(HValue* other) const { return true; }
|
| };
|
|
|
|
|
| @@ -1951,6 +1980,9 @@ class HArgumentsElements: public HInstruction {
|
| }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(ArgumentsElements, "arguments_elements")
|
| +
|
| + protected:
|
| + virtual bool DataEquals(HValue* other) const { return true; }
|
| };
|
|
|
|
|
| @@ -1962,6 +1994,9 @@ class HArgumentsLength: public HUnaryOperation {
|
| }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(ArgumentsLength, "arguments_length")
|
| +
|
| + protected:
|
| + virtual bool DataEquals(HValue* other) const { return true; }
|
| };
|
|
|
|
|
| @@ -1998,6 +2033,8 @@ class HAccessArgumentsAt: public HInstruction {
|
| operands_[index] = value;
|
| }
|
|
|
| + virtual bool DataEquals(HValue* other) const { return true; }
|
| +
|
| private:
|
| HOperandVector<3> operands_;
|
| };
|
| @@ -2024,6 +2061,9 @@ class HBoundsCheck: public HBinaryOperation {
|
| HValue* length() const { return right(); }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(BoundsCheck, "bounds_check")
|
| +
|
| + protected:
|
| + virtual bool DataEquals(HValue* other) const { return true; }
|
| };
|
|
|
|
|
| @@ -2141,6 +2181,9 @@ class HCompareJSObjectEq: public HBinaryOperation {
|
| virtual HType CalculateInferredType() const;
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(CompareJSObjectEq, "compare-js-object-eq")
|
| +
|
| + protected:
|
| + virtual bool DataEquals(HValue* other) const { return true; }
|
| };
|
|
|
|
|
| @@ -2183,6 +2226,9 @@ class HIsObject: public HUnaryPredicate {
|
| explicit HIsObject(HValue* value) : HUnaryPredicate(value) { }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(IsObject, "is_object")
|
| +
|
| + protected:
|
| + virtual bool DataEquals(HValue* other) const { return true; }
|
| };
|
|
|
|
|
| @@ -2191,6 +2237,9 @@ class HIsSmi: public HUnaryPredicate {
|
| explicit HIsSmi(HValue* value) : HUnaryPredicate(value) { }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(IsSmi, "is_smi")
|
| +
|
| + protected:
|
| + virtual bool DataEquals(HValue* other) const { return true; }
|
| };
|
|
|
|
|
| @@ -2227,6 +2276,9 @@ class HHasCachedArrayIndex: public HUnaryPredicate {
|
| explicit HHasCachedArrayIndex(HValue* value) : HUnaryPredicate(value) { }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndex, "has_cached_array_index")
|
| +
|
| + protected:
|
| + virtual bool DataEquals(HValue* other) const { return true; }
|
| };
|
|
|
|
|
| @@ -2325,6 +2377,9 @@ class HPower: public HBinaryOperation {
|
| }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(Power, "power")
|
| +
|
| + protected:
|
| + virtual bool DataEquals(HValue* other) const { return true; }
|
| };
|
|
|
|
|
| @@ -2347,6 +2402,8 @@ class HAdd: public HArithmeticBinaryOperation {
|
| DECLARE_CONCRETE_INSTRUCTION(Add, "add")
|
|
|
| protected:
|
| + virtual bool DataEquals(HValue* other) const { return true; }
|
| +
|
| virtual Range* InferRange();
|
| };
|
|
|
| @@ -2362,6 +2419,8 @@ class HSub: public HArithmeticBinaryOperation {
|
| DECLARE_CONCRETE_INSTRUCTION(Sub, "sub")
|
|
|
| protected:
|
| + virtual bool DataEquals(HValue* other) const { return true; }
|
| +
|
| virtual Range* InferRange();
|
| };
|
|
|
| @@ -2382,6 +2441,8 @@ class HMul: public HArithmeticBinaryOperation {
|
| DECLARE_CONCRETE_INSTRUCTION(Mul, "mul")
|
|
|
| protected:
|
| + virtual bool DataEquals(HValue* other) const { return true; }
|
| +
|
| virtual Range* InferRange();
|
| };
|
|
|
| @@ -2397,6 +2458,8 @@ class HMod: public HArithmeticBinaryOperation {
|
| DECLARE_CONCRETE_INSTRUCTION(Mod, "mod")
|
|
|
| protected:
|
| + virtual bool DataEquals(HValue* other) const { return true; }
|
| +
|
| virtual Range* InferRange();
|
| };
|
|
|
| @@ -2413,6 +2476,8 @@ class HDiv: public HArithmeticBinaryOperation {
|
| DECLARE_CONCRETE_INSTRUCTION(Div, "div")
|
|
|
| protected:
|
| + virtual bool DataEquals(HValue* other) const { return true; }
|
| +
|
| virtual Range* InferRange();
|
| };
|
|
|
| @@ -2428,6 +2493,8 @@ class HBitAnd: public HBitwiseBinaryOperation {
|
| DECLARE_CONCRETE_INSTRUCTION(BitAnd, "bit_and")
|
|
|
| protected:
|
| + virtual bool DataEquals(HValue* other) const { return true; }
|
| +
|
| virtual Range* InferRange();
|
| };
|
|
|
| @@ -2441,6 +2508,9 @@ class HBitXor: public HBitwiseBinaryOperation {
|
| virtual HType CalculateInferredType() const;
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(BitXor, "bit_xor")
|
| +
|
| + protected:
|
| + virtual bool DataEquals(HValue* other) const { return true; }
|
| };
|
|
|
|
|
| @@ -2455,6 +2525,8 @@ class HBitOr: public HBitwiseBinaryOperation {
|
| DECLARE_CONCRETE_INSTRUCTION(BitOr, "bit_or")
|
|
|
| protected:
|
| + virtual bool DataEquals(HValue* other) const { return true; }
|
| +
|
| virtual Range* InferRange();
|
| };
|
|
|
| @@ -2468,6 +2540,9 @@ class HShl: public HBitwiseBinaryOperation {
|
| virtual HType CalculateInferredType() const;
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(Shl, "shl")
|
| +
|
| + protected:
|
| + virtual bool DataEquals(HValue* other) const { return true; }
|
| };
|
|
|
|
|
| @@ -2479,6 +2554,9 @@ class HShr: public HBitwiseBinaryOperation {
|
| virtual HType CalculateInferredType() const;
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(Shr, "shr")
|
| +
|
| + protected:
|
| + virtual bool DataEquals(HValue* other) const { return true; }
|
| };
|
|
|
|
|
| @@ -2491,6 +2569,9 @@ class HSar: public HBitwiseBinaryOperation {
|
| virtual HType CalculateInferredType() const;
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(Sar, "sar")
|
| +
|
| + protected:
|
| + virtual bool DataEquals(HValue* other) const { return true; }
|
| };
|
|
|
|
|
| @@ -2715,12 +2796,6 @@ class HLoadNamedGeneric: public HUnaryOperation {
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load_named_generic")
|
|
|
| - protected:
|
| - virtual bool DataEquals(HValue* other) const {
|
| - HLoadNamedGeneric* b = HLoadNamedGeneric::cast(other);
|
| - return name_.is_identical_to(b->name_);
|
| - }
|
| -
|
| private:
|
| Handle<Object> name_;
|
| };
|
| @@ -2742,6 +2817,9 @@ class HLoadFunctionPrototype: public HUnaryOperation {
|
| }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load_function_prototype")
|
| +
|
| + protected:
|
| + virtual bool DataEquals(HValue* other) const { return true; }
|
| };
|
|
|
|
|
| @@ -2778,6 +2856,9 @@ class HLoadKeyedFastElement: public HLoadKeyed {
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastElement,
|
| "load_keyed_fast_element")
|
| +
|
| + protected:
|
| + virtual bool DataEquals(HValue* other) const { return true; }
|
| };
|
|
|
|
|
| @@ -2957,14 +3038,14 @@ class HStringCharCodeAt: public HBinaryOperation {
|
| : Representation::Tagged();
|
| }
|
|
|
| - virtual bool DataEquals(HValue* other) const { return true; }
|
| -
|
| HValue* string() const { return OperandAt(0); }
|
| HValue* index() const { return OperandAt(1); }
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt, "string_char_code_at")
|
|
|
| protected:
|
| + virtual bool DataEquals(HValue* other) const { return true; }
|
| +
|
| virtual Range* InferRange() {
|
| return new Range(0, String::kMaxUC16CharCode);
|
| }
|
| @@ -2987,11 +3068,11 @@ class HStringLength: public HUnaryOperation {
|
| return HType::Smi();
|
| }
|
|
|
| - virtual bool DataEquals(HValue* other) const { return true; }
|
| -
|
| DECLARE_CONCRETE_INSTRUCTION(StringLength, "string_length")
|
|
|
| protected:
|
| + virtual bool DataEquals(HValue* other) const { return true; }
|
| +
|
| virtual Range* InferRange() {
|
| return new Range(0, String::kMaxLength);
|
| }
|
|
|