| Index: src/hydrogen-instructions.h
|
| ===================================================================
|
| --- src/hydrogen-instructions.h (revision 9006)
|
| +++ src/hydrogen-instructions.h (working copy)
|
| @@ -104,8 +104,7 @@
|
| V(Div) \
|
| V(ElementsKind) \
|
| V(EnterInlined) \
|
| - V(ExternalArrayLength) \
|
| - V(FixedArrayLength) \
|
| + V(FixedArrayBaseLength) \
|
| V(ForceRepresentation) \
|
| V(FunctionLiteral) \
|
| V(GetCachedArrayIndex) \
|
| @@ -228,14 +227,20 @@
|
| Range* next() const { return next_; }
|
| Range* CopyClearLower() const { return new Range(kMinInt, upper_); }
|
| Range* CopyClearUpper() const { return new Range(lower_, kMaxInt); }
|
| - Range* Copy() const { return new Range(lower_, upper_); }
|
| + Range* Copy() const {
|
| + Range* result = new Range(lower_, upper_);
|
| + result->set_can_be_minus_zero(CanBeMinusZero());
|
| + return result;
|
| + }
|
| int32_t Mask() const;
|
| void set_can_be_minus_zero(bool b) { can_be_minus_zero_ = b; }
|
| bool CanBeMinusZero() const { return CanBeZero() && can_be_minus_zero_; }
|
| bool CanBeZero() const { return upper_ >= 0 && lower_ <= 0; }
|
| bool CanBeNegative() const { return lower_ < 0; }
|
| bool Includes(int value) const { return lower_ <= value && upper_ >= value; }
|
| - bool IsMostGeneric() const { return lower_ == kMinInt && upper_ == kMaxInt; }
|
| + bool IsMostGeneric() const {
|
| + return lower_ == kMinInt && upper_ == kMaxInt && CanBeMinusZero();
|
| + }
|
| bool IsInSmiRange() const {
|
| return lower_ >= Smi::kMinValue && upper_ <= Smi::kMaxValue;
|
| }
|
| @@ -579,9 +584,9 @@
|
| virtual bool IsConvertibleToInteger() const { return true; }
|
|
|
| HType type() const { return type_; }
|
| - void set_type(HType type) {
|
| - ASSERT(HasNoUses());
|
| - type_ = type;
|
| + void set_type(HType new_type) {
|
| + ASSERT(new_type.IsSubtypeOf(type_));
|
| + type_ = new_type;
|
| }
|
|
|
| // An operation needs to override this function iff:
|
| @@ -1101,10 +1106,6 @@
|
| set_representation(to);
|
| SetFlag(kUseGVN);
|
| if (is_truncating) SetFlag(kTruncatingToInt32);
|
| - if (from.IsInteger32() && to.IsTagged() && value->range() != NULL &&
|
| - value->range()->IsInSmiRange()) {
|
| - set_type(HType::Smi());
|
| - }
|
| }
|
|
|
| virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited);
|
| @@ -1116,6 +1117,8 @@
|
| return from_;
|
| }
|
|
|
| + virtual Range* InferRange();
|
| +
|
| virtual void PrintDataTo(StringStream* stream);
|
|
|
| DECLARE_CONCRETE_INSTRUCTION(Change)
|
| @@ -1702,9 +1705,9 @@
|
| };
|
|
|
|
|
| -class HFixedArrayLength: public HUnaryOperation {
|
| +class HFixedArrayBaseLength: public HUnaryOperation {
|
| public:
|
| - explicit HFixedArrayLength(HValue* value) : HUnaryOperation(value) {
|
| + explicit HFixedArrayBaseLength(HValue* value) : HUnaryOperation(value) {
|
| set_representation(Representation::Tagged());
|
| SetFlag(kUseGVN);
|
| SetFlag(kDependsOnArrayLengths);
|
| @@ -1714,34 +1717,13 @@
|
| return Representation::Tagged();
|
| }
|
|
|
| - DECLARE_CONCRETE_INSTRUCTION(FixedArrayLength)
|
| + DECLARE_CONCRETE_INSTRUCTION(FixedArrayBaseLength)
|
|
|
| protected:
|
| virtual bool DataEquals(HValue* other) { return true; }
|
| };
|
|
|
|
|
| -class HExternalArrayLength: public HUnaryOperation {
|
| - public:
|
| - explicit HExternalArrayLength(HValue* value) : HUnaryOperation(value) {
|
| - set_representation(Representation::Integer32());
|
| - // The result of this instruction is idempotent as long as its inputs don't
|
| - // change. The length of a pixel array cannot change once set, so it's not
|
| - // necessary to introduce a kDependsOnArrayLengths or any other dependency.
|
| - SetFlag(kUseGVN);
|
| - }
|
| -
|
| - virtual Representation RequiredInputRepresentation(int index) const {
|
| - return Representation::Tagged();
|
| - }
|
| -
|
| - DECLARE_CONCRETE_INSTRUCTION(ExternalArrayLength)
|
| -
|
| - protected:
|
| - virtual bool DataEquals(HValue* other) { return true; }
|
| -};
|
| -
|
| -
|
| class HElementsKind: public HUnaryOperation {
|
| public:
|
| explicit HElementsKind(HValue* value) : HUnaryOperation(value) {
|
| @@ -2471,6 +2453,8 @@
|
| return Representation::Integer32();
|
| }
|
|
|
| + virtual void PrintDataTo(StringStream* stream);
|
| +
|
| HValue* index() { return OperandAt(0); }
|
| HValue* length() { return OperandAt(1); }
|
|
|
| @@ -3426,12 +3410,12 @@
|
| public:
|
| HLoadNamedFieldPolymorphic(HValue* context,
|
| HValue* object,
|
| - ZoneMapList* types,
|
| + SmallMapList* types,
|
| Handle<String> name);
|
|
|
| HValue* context() { return OperandAt(0); }
|
| HValue* object() { return OperandAt(1); }
|
| - ZoneMapList* types() { return &types_; }
|
| + SmallMapList* types() { return &types_; }
|
| Handle<String> name() { return name_; }
|
| bool need_generic() { return need_generic_; }
|
|
|
| @@ -3439,6 +3423,8 @@
|
| return Representation::Tagged();
|
| }
|
|
|
| + virtual void PrintDataTo(StringStream* stream);
|
| +
|
| DECLARE_CONCRETE_INSTRUCTION(LoadNamedFieldPolymorphic)
|
|
|
| static const int kMaxLoadPolymorphism = 4;
|
| @@ -3447,7 +3433,7 @@
|
| virtual bool DataEquals(HValue* value);
|
|
|
| private:
|
| - ZoneMapList types_;
|
| + SmallMapList types_;
|
| Handle<String> name_;
|
| bool need_generic_;
|
| };
|
| @@ -3472,6 +3458,8 @@
|
| return Representation::Tagged();
|
| }
|
|
|
| + virtual void PrintDataTo(StringStream* stream);
|
| +
|
| DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric)
|
|
|
| private:
|
|
|