| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 V(ClassOfTestAndBranch) \ | 76 V(ClassOfTestAndBranch) \ |
| 77 V(CompareNumericAndBranch) \ | 77 V(CompareNumericAndBranch) \ |
| 78 V(CompareHoleAndBranch) \ | 78 V(CompareHoleAndBranch) \ |
| 79 V(CompareGeneric) \ | 79 V(CompareGeneric) \ |
| 80 V(CompareMinusZeroAndBranch) \ | 80 V(CompareMinusZeroAndBranch) \ |
| 81 V(CompareObjectEqAndBranch) \ | 81 V(CompareObjectEqAndBranch) \ |
| 82 V(CompareMap) \ | 82 V(CompareMap) \ |
| 83 V(Constant) \ | 83 V(Constant) \ |
| 84 V(ConstructDouble) \ | 84 V(ConstructDouble) \ |
| 85 V(Context) \ | 85 V(Context) \ |
| 86 V(CopyElements) \ |
| 86 V(DateField) \ | 87 V(DateField) \ |
| 87 V(DebugBreak) \ | 88 V(DebugBreak) \ |
| 88 V(DeclareGlobals) \ | 89 V(DeclareGlobals) \ |
| 89 V(Deoptimize) \ | 90 V(Deoptimize) \ |
| 90 V(Div) \ | 91 V(Div) \ |
| 91 V(DoubleBits) \ | 92 V(DoubleBits) \ |
| 92 V(DummyUse) \ | 93 V(DummyUse) \ |
| 93 V(EnterInlined) \ | 94 V(EnterInlined) \ |
| 94 V(EnvironmentMarker) \ | 95 V(EnvironmentMarker) \ |
| 96 V(FillElements) \ |
| 95 V(ForceRepresentation) \ | 97 V(ForceRepresentation) \ |
| 96 V(ForInCacheArray) \ | 98 V(ForInCacheArray) \ |
| 97 V(ForInPrepareMap) \ | 99 V(ForInPrepareMap) \ |
| 98 V(FunctionLiteral) \ | 100 V(FunctionLiteral) \ |
| 99 V(GetCachedArrayIndex) \ | 101 V(GetCachedArrayIndex) \ |
| 100 V(Goto) \ | 102 V(Goto) \ |
| 101 V(HasCachedArrayIndexAndBranch) \ | 103 V(HasCachedArrayIndexAndBranch) \ |
| 102 V(HasInstanceTypeAndBranch) \ | 104 V(HasInstanceTypeAndBranch) \ |
| 103 V(InnerAllocatedObject) \ | 105 V(InnerAllocatedObject) \ |
| 104 V(InstanceOf) \ | 106 V(InstanceOf) \ |
| (...skipping 5601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5706 // Stores to external references require no write barriers | 5708 // Stores to external references require no write barriers |
| 5707 return false; | 5709 return false; |
| 5708 } | 5710 } |
| 5709 // We definitely need a write barrier unless the object is the allocation | 5711 // We definitely need a write barrier unless the object is the allocation |
| 5710 // dominator. | 5712 // dominator. |
| 5711 if (object == dominator && object->IsAllocate()) { | 5713 if (object == dominator && object->IsAllocate()) { |
| 5712 // Stores to new space allocations require no write barriers. | 5714 // Stores to new space allocations require no write barriers. |
| 5713 if (HAllocate::cast(object)->IsNewSpaceAllocation()) { | 5715 if (HAllocate::cast(object)->IsNewSpaceAllocation()) { |
| 5714 return false; | 5716 return false; |
| 5715 } | 5717 } |
| 5716 // Stores to old space allocations require no write barriers if the value is | 5718 if (value != NULL) { |
| 5717 // a constant provably not in new space. | 5719 // Stores to old space allocations require no write barriers if the value |
| 5718 if (value->IsConstant() && HConstant::cast(value)->NotInNewSpace()) { | 5720 // is a constant provably not in new space. |
| 5719 return false; | 5721 if (value->IsConstant() && HConstant::cast(value)->NotInNewSpace()) { |
| 5720 } | 5722 return false; |
| 5721 // Stores to old space allocations require no write barriers if the value is | 5723 } |
| 5722 // an old space allocation. | 5724 // Stores to old space allocations require no write barriers if the value |
| 5723 while (value->IsInnerAllocatedObject()) { | 5725 // is an old space allocation. |
| 5724 value = HInnerAllocatedObject::cast(value)->base_object(); | 5726 while (value->IsInnerAllocatedObject()) { |
| 5725 } | 5727 value = HInnerAllocatedObject::cast(value)->base_object(); |
| 5726 if (value->IsAllocate() && | 5728 } |
| 5727 !HAllocate::cast(value)->IsNewSpaceAllocation()) { | 5729 if (value->IsAllocate() && |
| 5728 return false; | 5730 !HAllocate::cast(value)->IsNewSpaceAllocation()) { |
| 5731 return false; |
| 5732 } |
| 5729 } | 5733 } |
| 5730 } | 5734 } |
| 5731 return true; | 5735 return true; |
| 5732 } | 5736 } |
| 5733 | 5737 |
| 5734 | 5738 |
| 5735 inline PointersToHereCheck PointersToHereCheckForObject(HValue* object, | 5739 inline PointersToHereCheck PointersToHereCheckForObject(HValue* object, |
| 5736 HValue* dominator) { | 5740 HValue* dominator) { |
| 5737 while (object->IsInnerAllocatedObject()) { | 5741 while (object->IsInnerAllocatedObject()) { |
| 5738 object = HInnerAllocatedObject::cast(object)->base_object(); | 5742 object = HInnerAllocatedObject::cast(object)->base_object(); |
| (...skipping 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6874 SetOperandAt(1, value); | 6878 SetOperandAt(1, value); |
| 6875 SetOperandAt(2, context); | 6879 SetOperandAt(2, context); |
| 6876 SetAllSideEffects(); | 6880 SetAllSideEffects(); |
| 6877 } | 6881 } |
| 6878 | 6882 |
| 6879 Handle<String> name_; | 6883 Handle<String> name_; |
| 6880 StrictMode strict_mode_; | 6884 StrictMode strict_mode_; |
| 6881 }; | 6885 }; |
| 6882 | 6886 |
| 6883 | 6887 |
| 6888 class HFillElements V8_FINAL : public HTemplateInstruction<4> { |
| 6889 public: |
| 6890 DECLARE_INSTRUCTION_FACTORY_P4(HFillElements, HValue*, HValue*, |
| 6891 HValue*, HValue*); |
| 6892 |
| 6893 HValue* elements() { return OperandAt(0); } |
| 6894 HValue* from() { return OperandAt(1); } |
| 6895 HValue* to() { return OperandAt(2); } |
| 6896 HValue* value() { return OperandAt(3); } |
| 6897 |
| 6898 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
| 6899 |
| 6900 DECLARE_CONCRETE_INSTRUCTION(FillElements) |
| 6901 |
| 6902 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { |
| 6903 return OperandAt(index)->representation(); |
| 6904 } |
| 6905 |
| 6906 private: |
| 6907 HFillElements(HValue* obj, HValue* from, HValue* to, HValue* val) { |
| 6908 SetOperandAt(0, obj); |
| 6909 SetOperandAt(1, from); |
| 6910 SetOperandAt(2, to); |
| 6911 SetOperandAt(3, val); |
| 6912 } |
| 6913 }; |
| 6914 |
| 6915 |
| 6916 class HCopyElements V8_FINAL : public HTemplateInstruction<3> { |
| 6917 public: |
| 6918 DECLARE_INSTRUCTION_FACTORY_P4(HCopyElements, HValue*, HValue*, HValue*, |
| 6919 ElementsKind); |
| 6920 |
| 6921 HValue* src() { return OperandAt(0); } |
| 6922 HValue* dst() { return OperandAt(1); } |
| 6923 HValue* length() { return OperandAt(2); } |
| 6924 ElementsKind elements_kind() const { return elements_kind_; } |
| 6925 |
| 6926 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
| 6927 |
| 6928 DECLARE_CONCRETE_INSTRUCTION(CopyElements) |
| 6929 |
| 6930 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { |
| 6931 return OperandAt(index)->representation(); |
| 6932 } |
| 6933 |
| 6934 private: |
| 6935 HCopyElements(HValue* src, HValue* dst, HValue* length, |
| 6936 ElementsKind elements_kind) |
| 6937 : elements_kind_(elements_kind) { |
| 6938 SetOperandAt(0, src); |
| 6939 SetOperandAt(1, dst); |
| 6940 SetOperandAt(2, length); |
| 6941 } |
| 6942 |
| 6943 ElementsKind elements_kind_; |
| 6944 }; |
| 6945 |
| 6946 |
| 6884 class HStoreKeyed V8_FINAL | 6947 class HStoreKeyed V8_FINAL |
| 6885 : public HTemplateInstruction<3>, public ArrayInstructionInterface { | 6948 : public HTemplateInstruction<3>, public ArrayInstructionInterface { |
| 6886 public: | 6949 public: |
| 6887 DECLARE_INSTRUCTION_FACTORY_P4(HStoreKeyed, HValue*, HValue*, HValue*, | 6950 DECLARE_INSTRUCTION_FACTORY_P4(HStoreKeyed, HValue*, HValue*, HValue*, |
| 6888 ElementsKind); | 6951 ElementsKind); |
| 6889 DECLARE_INSTRUCTION_FACTORY_P5(HStoreKeyed, HValue*, HValue*, HValue*, | 6952 DECLARE_INSTRUCTION_FACTORY_P5(HStoreKeyed, HValue*, HValue*, HValue*, |
| 6890 ElementsKind, StoreFieldOrKeyedMode); | 6953 ElementsKind, StoreFieldOrKeyedMode); |
| 6891 DECLARE_INSTRUCTION_FACTORY_P6(HStoreKeyed, HValue*, HValue*, HValue*, | 6954 DECLARE_INSTRUCTION_FACTORY_P6(HStoreKeyed, HValue*, HValue*, HValue*, |
| 6892 ElementsKind, StoreFieldOrKeyedMode, int); | 6955 ElementsKind, StoreFieldOrKeyedMode, int); |
| 6893 | 6956 |
| (...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7802 }; | 7865 }; |
| 7803 | 7866 |
| 7804 | 7867 |
| 7805 | 7868 |
| 7806 #undef DECLARE_INSTRUCTION | 7869 #undef DECLARE_INSTRUCTION |
| 7807 #undef DECLARE_CONCRETE_INSTRUCTION | 7870 #undef DECLARE_CONCRETE_INSTRUCTION |
| 7808 | 7871 |
| 7809 } } // namespace v8::internal | 7872 } } // namespace v8::internal |
| 7810 | 7873 |
| 7811 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7874 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |