OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 5859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5870 | 5870 |
5871 | 5871 |
5872 class HStoreKeyed | 5872 class HStoreKeyed |
5873 : public HTemplateInstruction<3>, public ArrayInstructionInterface { | 5873 : public HTemplateInstruction<3>, public ArrayInstructionInterface { |
5874 public: | 5874 public: |
5875 HStoreKeyed(HValue* obj, HValue* key, HValue* val, | 5875 HStoreKeyed(HValue* obj, HValue* key, HValue* val, |
5876 ElementsKind elements_kind) | 5876 ElementsKind elements_kind) |
5877 : elements_kind_(elements_kind), | 5877 : elements_kind_(elements_kind), |
5878 index_offset_(0), | 5878 index_offset_(0), |
5879 is_dehoisted_(false), | 5879 is_dehoisted_(false), |
| 5880 is_uninitialized_(false), |
5880 new_space_dominator_(NULL) { | 5881 new_space_dominator_(NULL) { |
5881 SetOperandAt(0, obj); | 5882 SetOperandAt(0, obj); |
5882 SetOperandAt(1, key); | 5883 SetOperandAt(1, key); |
5883 SetOperandAt(2, val); | 5884 SetOperandAt(2, val); |
5884 | 5885 |
5885 if (IsFastObjectElementsKind(elements_kind)) { | 5886 if (IsFastObjectElementsKind(elements_kind)) { |
5886 SetFlag(kTrackSideEffectDominators); | 5887 SetFlag(kTrackSideEffectDominators); |
5887 SetGVNFlag(kDependsOnNewSpacePromotion); | 5888 SetGVNFlag(kDependsOnNewSpacePromotion); |
5888 } | 5889 } |
5889 if (is_external()) { | 5890 if (is_external()) { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5930 return is_external() ? Representation::Integer32() | 5931 return is_external() ? Representation::Integer32() |
5931 : Representation::Tagged(); | 5932 : Representation::Tagged(); |
5932 } | 5933 } |
5933 | 5934 |
5934 bool is_external() const { | 5935 bool is_external() const { |
5935 return IsExternalArrayElementsKind(elements_kind()); | 5936 return IsExternalArrayElementsKind(elements_kind()); |
5936 } | 5937 } |
5937 | 5938 |
5938 virtual Representation observed_input_representation(int index) { | 5939 virtual Representation observed_input_representation(int index) { |
5939 if (index < 2) return RequiredInputRepresentation(index); | 5940 if (index < 2) return RequiredInputRepresentation(index); |
| 5941 if (IsUninitialized()) { |
| 5942 return Representation::None(); |
| 5943 } |
5940 if (IsFastSmiElementsKind(elements_kind())) { | 5944 if (IsFastSmiElementsKind(elements_kind())) { |
5941 return Representation::Smi(); | 5945 return Representation::Smi(); |
5942 } | 5946 } |
5943 if (IsDoubleOrFloatElementsKind(elements_kind())) { | 5947 if (IsDoubleOrFloatElementsKind(elements_kind())) { |
5944 return Representation::Double(); | 5948 return Representation::Double(); |
5945 } | 5949 } |
5946 if (is_external()) { | 5950 if (is_external()) { |
5947 return Representation::Integer32(); | 5951 return Representation::Integer32(); |
5948 } | 5952 } |
5949 // For fast object elements kinds, don't assume anything. | 5953 // For fast object elements kinds, don't assume anything. |
5950 return Representation::None(); | 5954 return Representation::None(); |
5951 } | 5955 } |
5952 | 5956 |
5953 HValue* elements() { return OperandAt(0); } | 5957 HValue* elements() { return OperandAt(0); } |
5954 HValue* key() { return OperandAt(1); } | 5958 HValue* key() { return OperandAt(1); } |
5955 HValue* value() { return OperandAt(2); } | 5959 HValue* value() { return OperandAt(2); } |
5956 bool value_is_smi() const { | 5960 bool value_is_smi() const { |
5957 return IsFastSmiElementsKind(elements_kind_); | 5961 return IsFastSmiElementsKind(elements_kind_); |
5958 } | 5962 } |
5959 ElementsKind elements_kind() const { return elements_kind_; } | 5963 ElementsKind elements_kind() const { return elements_kind_; } |
5960 uint32_t index_offset() { return index_offset_; } | 5964 uint32_t index_offset() { return index_offset_; } |
5961 void SetIndexOffset(uint32_t index_offset) { index_offset_ = index_offset; } | 5965 void SetIndexOffset(uint32_t index_offset) { index_offset_ = index_offset; } |
5962 HValue* GetKey() { return key(); } | 5966 HValue* GetKey() { return key(); } |
5963 void SetKey(HValue* key) { SetOperandAt(1, key); } | 5967 void SetKey(HValue* key) { SetOperandAt(1, key); } |
5964 bool IsDehoisted() { return is_dehoisted_; } | 5968 bool IsDehoisted() { return is_dehoisted_; } |
5965 void SetDehoisted(bool is_dehoisted) { is_dehoisted_ = is_dehoisted; } | 5969 void SetDehoisted(bool is_dehoisted) { is_dehoisted_ = is_dehoisted; } |
| 5970 bool IsUninitialized() { return is_uninitialized_; } |
| 5971 void SetUninitialized(bool is_uninitialized) { |
| 5972 is_uninitialized_ = is_uninitialized; |
| 5973 } |
5966 | 5974 |
5967 bool IsConstantHoleStore() { | 5975 bool IsConstantHoleStore() { |
5968 return value()->IsConstant() && HConstant::cast(value())->IsTheHole(); | 5976 return value()->IsConstant() && HConstant::cast(value())->IsTheHole(); |
5969 } | 5977 } |
5970 | 5978 |
5971 virtual void SetSideEffectDominator(GVNFlag side_effect, HValue* dominator) { | 5979 virtual void SetSideEffectDominator(GVNFlag side_effect, HValue* dominator) { |
5972 ASSERT(side_effect == kChangesNewSpacePromotion); | 5980 ASSERT(side_effect == kChangesNewSpacePromotion); |
5973 new_space_dominator_ = dominator; | 5981 new_space_dominator_ = dominator; |
5974 } | 5982 } |
5975 | 5983 |
(...skipping 10 matching lines...) Expand all Loading... |
5986 | 5994 |
5987 bool NeedsCanonicalization(); | 5995 bool NeedsCanonicalization(); |
5988 | 5996 |
5989 virtual void PrintDataTo(StringStream* stream); | 5997 virtual void PrintDataTo(StringStream* stream); |
5990 | 5998 |
5991 DECLARE_CONCRETE_INSTRUCTION(StoreKeyed) | 5999 DECLARE_CONCRETE_INSTRUCTION(StoreKeyed) |
5992 | 6000 |
5993 private: | 6001 private: |
5994 ElementsKind elements_kind_; | 6002 ElementsKind elements_kind_; |
5995 uint32_t index_offset_; | 6003 uint32_t index_offset_; |
5996 bool is_dehoisted_; | 6004 bool is_dehoisted_ : 1; |
| 6005 bool is_uninitialized_ : 1; |
5997 HValue* new_space_dominator_; | 6006 HValue* new_space_dominator_; |
5998 }; | 6007 }; |
5999 | 6008 |
6000 | 6009 |
6001 class HStoreKeyedGeneric: public HTemplateInstruction<4> { | 6010 class HStoreKeyedGeneric: public HTemplateInstruction<4> { |
6002 public: | 6011 public: |
6003 HStoreKeyedGeneric(HValue* context, | 6012 HStoreKeyedGeneric(HValue* context, |
6004 HValue* object, | 6013 HValue* object, |
6005 HValue* key, | 6014 HValue* key, |
6006 HValue* value, | 6015 HValue* value, |
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6651 virtual bool IsDeletable() const { return true; } | 6660 virtual bool IsDeletable() const { return true; } |
6652 }; | 6661 }; |
6653 | 6662 |
6654 | 6663 |
6655 #undef DECLARE_INSTRUCTION | 6664 #undef DECLARE_INSTRUCTION |
6656 #undef DECLARE_CONCRETE_INSTRUCTION | 6665 #undef DECLARE_CONCRETE_INSTRUCTION |
6657 | 6666 |
6658 } } // namespace v8::internal | 6667 } } // namespace v8::internal |
6659 | 6668 |
6660 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 6669 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |