OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_ | 5 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_ |
6 #define V8_HYDROGEN_INSTRUCTIONS_H_ | 6 #define V8_HYDROGEN_INSTRUCTIONS_H_ |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 5697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5708 } | 5708 } |
5709 if (value->IsAllocate() && | 5709 if (value->IsAllocate() && |
5710 !HAllocate::cast(value)->IsNewSpaceAllocation()) { | 5710 !HAllocate::cast(value)->IsNewSpaceAllocation()) { |
5711 return false; | 5711 return false; |
5712 } | 5712 } |
5713 } | 5713 } |
5714 return true; | 5714 return true; |
5715 } | 5715 } |
5716 | 5716 |
5717 | 5717 |
| 5718 inline PointersToHereCheck PointersToHereCheckForObject(HValue* object, |
| 5719 HValue* dominator) { |
| 5720 while (object->IsInnerAllocatedObject()) { |
| 5721 object = HInnerAllocatedObject::cast(object)->base_object(); |
| 5722 } |
| 5723 if (object == dominator && |
| 5724 object->IsAllocate() && |
| 5725 HAllocate::cast(object)->IsNewSpaceAllocation()) { |
| 5726 return kPointersToHereAreAlwaysInteresting; |
| 5727 } |
| 5728 return kPointersToHereMaybeInteresting; |
| 5729 } |
| 5730 |
| 5731 |
5718 class HStoreGlobalCell V8_FINAL : public HUnaryOperation { | 5732 class HStoreGlobalCell V8_FINAL : public HUnaryOperation { |
5719 public: | 5733 public: |
5720 DECLARE_INSTRUCTION_FACTORY_P3(HStoreGlobalCell, HValue*, | 5734 DECLARE_INSTRUCTION_FACTORY_P3(HStoreGlobalCell, HValue*, |
5721 Handle<PropertyCell>, PropertyDetails); | 5735 Handle<PropertyCell>, PropertyDetails); |
5722 | 5736 |
5723 Unique<PropertyCell> cell() const { return cell_; } | 5737 Unique<PropertyCell> cell() const { return cell_; } |
5724 bool RequiresHoleCheck() { | 5738 bool RequiresHoleCheck() { |
5725 return !details_.IsDontDelete() || details_.IsReadOnly(); | 5739 return !details_.IsDontDelete() || details_.IsReadOnly(); |
5726 } | 5740 } |
5727 bool NeedsWriteBarrier() { | 5741 bool NeedsWriteBarrier() { |
(...skipping 997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6725 return ReceiverObjectNeedsWriteBarrier(object(), transition(), | 6739 return ReceiverObjectNeedsWriteBarrier(object(), transition(), |
6726 dominator()); | 6740 dominator()); |
6727 } | 6741 } |
6728 | 6742 |
6729 SmiCheck SmiCheckForWriteBarrier() const { | 6743 SmiCheck SmiCheckForWriteBarrier() const { |
6730 if (field_representation().IsHeapObject()) return OMIT_SMI_CHECK; | 6744 if (field_representation().IsHeapObject()) return OMIT_SMI_CHECK; |
6731 if (value()->type().IsHeapObject()) return OMIT_SMI_CHECK; | 6745 if (value()->type().IsHeapObject()) return OMIT_SMI_CHECK; |
6732 return INLINE_SMI_CHECK; | 6746 return INLINE_SMI_CHECK; |
6733 } | 6747 } |
6734 | 6748 |
| 6749 PointersToHereCheck PointersToHereCheckForValue() const { |
| 6750 return PointersToHereCheckForObject(value(), dominator()); |
| 6751 } |
| 6752 |
6735 Representation field_representation() const { | 6753 Representation field_representation() const { |
6736 return access_.representation(); | 6754 return access_.representation(); |
6737 } | 6755 } |
6738 | 6756 |
6739 void UpdateValue(HValue* value) { | 6757 void UpdateValue(HValue* value) { |
6740 SetOperandAt(1, value); | 6758 SetOperandAt(1, value); |
6741 } | 6759 } |
6742 | 6760 |
6743 bool CanBeReplacedWith(HStoreNamedField* that) const { | 6761 bool CanBeReplacedWith(HStoreNamedField* that) const { |
6744 if (!this->access().Equals(that->access())) return false; | 6762 if (!this->access().Equals(that->access())) return false; |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6883 if (IsFastSmiElementsKind(elements_kind())) { | 6901 if (IsFastSmiElementsKind(elements_kind())) { |
6884 return Representation::Smi(); | 6902 return Representation::Smi(); |
6885 } | 6903 } |
6886 if (is_typed_elements()) { | 6904 if (is_typed_elements()) { |
6887 return Representation::Integer32(); | 6905 return Representation::Integer32(); |
6888 } | 6906 } |
6889 // For fast object elements kinds, don't assume anything. | 6907 // For fast object elements kinds, don't assume anything. |
6890 return Representation::None(); | 6908 return Representation::None(); |
6891 } | 6909 } |
6892 | 6910 |
6893 HValue* elements() { return OperandAt(0); } | 6911 HValue* elements() const { return OperandAt(0); } |
6894 HValue* key() { return OperandAt(1); } | 6912 HValue* key() const { return OperandAt(1); } |
6895 HValue* value() { return OperandAt(2); } | 6913 HValue* value() const { return OperandAt(2); } |
6896 bool value_is_smi() const { | 6914 bool value_is_smi() const { |
6897 return IsFastSmiElementsKind(elements_kind_); | 6915 return IsFastSmiElementsKind(elements_kind_); |
6898 } | 6916 } |
6899 StoreFieldOrKeyedMode store_mode() const { return store_mode_; } | 6917 StoreFieldOrKeyedMode store_mode() const { return store_mode_; } |
6900 ElementsKind elements_kind() const { return elements_kind_; } | 6918 ElementsKind elements_kind() const { return elements_kind_; } |
6901 uint32_t base_offset() { return base_offset_; } | 6919 uint32_t base_offset() { return base_offset_; } |
6902 void IncreaseBaseOffset(uint32_t base_offset) { | 6920 void IncreaseBaseOffset(uint32_t base_offset) { |
6903 base_offset_ += base_offset; | 6921 base_offset_ += base_offset; |
6904 } | 6922 } |
6905 virtual int MaxBaseOffsetBits() { | 6923 virtual int MaxBaseOffsetBits() { |
(...skipping 23 matching lines...) Expand all Loading... |
6929 | 6947 |
6930 bool NeedsWriteBarrier() { | 6948 bool NeedsWriteBarrier() { |
6931 if (value_is_smi()) { | 6949 if (value_is_smi()) { |
6932 return false; | 6950 return false; |
6933 } else { | 6951 } else { |
6934 return StoringValueNeedsWriteBarrier(value()) && | 6952 return StoringValueNeedsWriteBarrier(value()) && |
6935 ReceiverObjectNeedsWriteBarrier(elements(), value(), dominator()); | 6953 ReceiverObjectNeedsWriteBarrier(elements(), value(), dominator()); |
6936 } | 6954 } |
6937 } | 6955 } |
6938 | 6956 |
| 6957 PointersToHereCheck PointersToHereCheckForValue() const { |
| 6958 return PointersToHereCheckForObject(value(), dominator()); |
| 6959 } |
| 6960 |
6939 bool NeedsCanonicalization(); | 6961 bool NeedsCanonicalization(); |
6940 | 6962 |
6941 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 6963 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
6942 | 6964 |
6943 DECLARE_CONCRETE_INSTRUCTION(StoreKeyed) | 6965 DECLARE_CONCRETE_INSTRUCTION(StoreKeyed) |
6944 | 6966 |
6945 private: | 6967 private: |
6946 HStoreKeyed(HValue* obj, HValue* key, HValue* val, | 6968 HStoreKeyed(HValue* obj, HValue* key, HValue* val, |
6947 ElementsKind elements_kind, | 6969 ElementsKind elements_kind, |
6948 StoreFieldOrKeyedMode store_mode = INITIALIZING_STORE, | 6970 StoreFieldOrKeyedMode store_mode = INITIALIZING_STORE, |
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7679 virtual bool IsDeletable() const V8_OVERRIDE { return true; } | 7701 virtual bool IsDeletable() const V8_OVERRIDE { return true; } |
7680 }; | 7702 }; |
7681 | 7703 |
7682 | 7704 |
7683 #undef DECLARE_INSTRUCTION | 7705 #undef DECLARE_INSTRUCTION |
7684 #undef DECLARE_CONCRETE_INSTRUCTION | 7706 #undef DECLARE_CONCRETE_INSTRUCTION |
7685 | 7707 |
7686 } } // namespace v8::internal | 7708 } } // namespace v8::internal |
7687 | 7709 |
7688 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7710 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |