| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 V(IsSmiAndBranch) \ | 124 V(IsSmiAndBranch) \ |
| 125 V(IsUndetectableAndBranch) \ | 125 V(IsUndetectableAndBranch) \ |
| 126 V(JSArrayLength) \ | 126 V(JSArrayLength) \ |
| 127 V(LeaveInlined) \ | 127 V(LeaveInlined) \ |
| 128 V(LoadContextSlot) \ | 128 V(LoadContextSlot) \ |
| 129 V(LoadElements) \ | 129 V(LoadElements) \ |
| 130 V(LoadExternalArrayPointer) \ | 130 V(LoadExternalArrayPointer) \ |
| 131 V(LoadFunctionPrototype) \ | 131 V(LoadFunctionPrototype) \ |
| 132 V(LoadGlobalCell) \ | 132 V(LoadGlobalCell) \ |
| 133 V(LoadGlobalGeneric) \ | 133 V(LoadGlobalGeneric) \ |
| 134 V(LoadKeyedFastDoubleElement) \ |
| 134 V(LoadKeyedFastElement) \ | 135 V(LoadKeyedFastElement) \ |
| 135 V(LoadKeyedGeneric) \ | 136 V(LoadKeyedGeneric) \ |
| 136 V(LoadKeyedSpecializedArrayElement) \ | 137 V(LoadKeyedSpecializedArrayElement) \ |
| 137 V(LoadNamedField) \ | 138 V(LoadNamedField) \ |
| 138 V(LoadNamedFieldPolymorphic) \ | 139 V(LoadNamedFieldPolymorphic) \ |
| 139 V(LoadNamedGeneric) \ | 140 V(LoadNamedGeneric) \ |
| 140 V(Mod) \ | 141 V(Mod) \ |
| 141 V(Mul) \ | 142 V(Mul) \ |
| 142 V(ObjectLiteral) \ | 143 V(ObjectLiteral) \ |
| 143 V(OsrEntry) \ | 144 V(OsrEntry) \ |
| 144 V(OuterContext) \ | 145 V(OuterContext) \ |
| 145 V(Parameter) \ | 146 V(Parameter) \ |
| 146 V(Power) \ | 147 V(Power) \ |
| 147 V(PushArgument) \ | 148 V(PushArgument) \ |
| 148 V(RegExpLiteral) \ | 149 V(RegExpLiteral) \ |
| 149 V(Return) \ | 150 V(Return) \ |
| 150 V(Sar) \ | 151 V(Sar) \ |
| 151 V(Shl) \ | 152 V(Shl) \ |
| 152 V(Shr) \ | 153 V(Shr) \ |
| 153 V(Simulate) \ | 154 V(Simulate) \ |
| 154 V(SoftDeoptimize) \ | 155 V(SoftDeoptimize) \ |
| 155 V(StackCheck) \ | 156 V(StackCheck) \ |
| 156 V(StoreContextSlot) \ | 157 V(StoreContextSlot) \ |
| 157 V(StoreGlobalCell) \ | 158 V(StoreGlobalCell) \ |
| 158 V(StoreGlobalGeneric) \ | 159 V(StoreGlobalGeneric) \ |
| 160 V(StoreKeyedFastDoubleElement) \ |
| 159 V(StoreKeyedFastElement) \ | 161 V(StoreKeyedFastElement) \ |
| 160 V(StoreKeyedGeneric) \ | 162 V(StoreKeyedGeneric) \ |
| 161 V(StoreKeyedSpecializedArrayElement) \ | 163 V(StoreKeyedSpecializedArrayElement) \ |
| 162 V(StoreNamedField) \ | 164 V(StoreNamedField) \ |
| 163 V(StoreNamedGeneric) \ | 165 V(StoreNamedGeneric) \ |
| 164 V(StringAdd) \ | 166 V(StringAdd) \ |
| 165 V(StringCharCodeAt) \ | 167 V(StringCharCodeAt) \ |
| 166 V(StringCharFromCode) \ | 168 V(StringCharFromCode) \ |
| 167 V(StringLength) \ | 169 V(StringLength) \ |
| 168 V(Sub) \ | 170 V(Sub) \ |
| (...skipping 3343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3512 | 3514 |
| 3513 bool RequiresHoleCheck() const; | 3515 bool RequiresHoleCheck() const; |
| 3514 | 3516 |
| 3515 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastElement) | 3517 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastElement) |
| 3516 | 3518 |
| 3517 protected: | 3519 protected: |
| 3518 virtual bool DataEquals(HValue* other) { return true; } | 3520 virtual bool DataEquals(HValue* other) { return true; } |
| 3519 }; | 3521 }; |
| 3520 | 3522 |
| 3521 | 3523 |
| 3524 class HLoadKeyedFastDoubleElement: public HTemplateInstruction<2> { |
| 3525 public: |
| 3526 HLoadKeyedFastDoubleElement(HValue* elements, HValue* key) { |
| 3527 SetOperandAt(0, elements); |
| 3528 SetOperandAt(1, key); |
| 3529 set_representation(Representation::Double()); |
| 3530 SetFlag(kDependsOnArrayElements); |
| 3531 SetFlag(kUseGVN); |
| 3532 } |
| 3533 |
| 3534 HValue* elements() { return OperandAt(0); } |
| 3535 HValue* key() { return OperandAt(1); } |
| 3536 |
| 3537 virtual Representation RequiredInputRepresentation(int index) const { |
| 3538 // The key is supposed to be Integer32. |
| 3539 return index == 0 |
| 3540 ? Representation::Tagged() |
| 3541 : Representation::Integer32(); |
| 3542 } |
| 3543 |
| 3544 virtual void PrintDataTo(StringStream* stream); |
| 3545 |
| 3546 bool RequiresHoleCheck() const; |
| 3547 |
| 3548 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastDoubleElement) |
| 3549 |
| 3550 protected: |
| 3551 virtual bool DataEquals(HValue* other) { return true; } |
| 3552 }; |
| 3553 |
| 3554 |
| 3522 class HLoadKeyedSpecializedArrayElement: public HTemplateInstruction<2> { | 3555 class HLoadKeyedSpecializedArrayElement: public HTemplateInstruction<2> { |
| 3523 public: | 3556 public: |
| 3524 HLoadKeyedSpecializedArrayElement(HValue* external_elements, | 3557 HLoadKeyedSpecializedArrayElement(HValue* external_elements, |
| 3525 HValue* key, | 3558 HValue* key, |
| 3526 JSObject::ElementsKind elements_kind) | 3559 JSObject::ElementsKind elements_kind) |
| 3527 : elements_kind_(elements_kind) { | 3560 : elements_kind_(elements_kind) { |
| 3528 SetOperandAt(0, external_elements); | 3561 SetOperandAt(0, external_elements); |
| 3529 SetOperandAt(1, key); | 3562 SetOperandAt(1, key); |
| 3530 if (elements_kind == JSObject::EXTERNAL_FLOAT_ELEMENTS || | 3563 if (elements_kind == JSObject::EXTERNAL_FLOAT_ELEMENTS || |
| 3531 elements_kind == JSObject::EXTERNAL_DOUBLE_ELEMENTS) { | 3564 elements_kind == JSObject::EXTERNAL_DOUBLE_ELEMENTS) { |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3697 bool NeedsWriteBarrier() { | 3730 bool NeedsWriteBarrier() { |
| 3698 return StoringValueNeedsWriteBarrier(value()); | 3731 return StoringValueNeedsWriteBarrier(value()); |
| 3699 } | 3732 } |
| 3700 | 3733 |
| 3701 virtual void PrintDataTo(StringStream* stream); | 3734 virtual void PrintDataTo(StringStream* stream); |
| 3702 | 3735 |
| 3703 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement) | 3736 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement) |
| 3704 }; | 3737 }; |
| 3705 | 3738 |
| 3706 | 3739 |
| 3740 class HStoreKeyedFastDoubleElement: public HTemplateInstruction<3> { |
| 3741 public: |
| 3742 HStoreKeyedFastDoubleElement(HValue* elements, |
| 3743 HValue* key, |
| 3744 HValue* val) { |
| 3745 SetOperandAt(0, elements); |
| 3746 SetOperandAt(1, key); |
| 3747 SetOperandAt(2, val); |
| 3748 SetFlag(kChangesArrayElements); |
| 3749 } |
| 3750 |
| 3751 virtual Representation RequiredInputRepresentation(int index) const { |
| 3752 if (index == 1) { |
| 3753 return Representation::Integer32(); |
| 3754 } else if (index == 2) { |
| 3755 return Representation::Double(); |
| 3756 } else { |
| 3757 return Representation::Tagged(); |
| 3758 } |
| 3759 } |
| 3760 |
| 3761 HValue* elements() { return OperandAt(0); } |
| 3762 HValue* key() { return OperandAt(1); } |
| 3763 HValue* value() { return OperandAt(2); } |
| 3764 |
| 3765 bool NeedsWriteBarrier() { |
| 3766 return StoringValueNeedsWriteBarrier(value()); |
| 3767 } |
| 3768 |
| 3769 virtual void PrintDataTo(StringStream* stream); |
| 3770 |
| 3771 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastDoubleElement) |
| 3772 }; |
| 3773 |
| 3774 |
| 3707 class HStoreKeyedSpecializedArrayElement: public HTemplateInstruction<3> { | 3775 class HStoreKeyedSpecializedArrayElement: public HTemplateInstruction<3> { |
| 3708 public: | 3776 public: |
| 3709 HStoreKeyedSpecializedArrayElement(HValue* external_elements, | 3777 HStoreKeyedSpecializedArrayElement(HValue* external_elements, |
| 3710 HValue* key, | 3778 HValue* key, |
| 3711 HValue* val, | 3779 HValue* val, |
| 3712 JSObject::ElementsKind elements_kind) | 3780 JSObject::ElementsKind elements_kind) |
| 3713 : elements_kind_(elements_kind) { | 3781 : elements_kind_(elements_kind) { |
| 3714 SetFlag(kChangesSpecializedArrayElements); | 3782 SetFlag(kChangesSpecializedArrayElements); |
| 3715 SetOperandAt(0, external_elements); | 3783 SetOperandAt(0, external_elements); |
| 3716 SetOperandAt(1, key); | 3784 SetOperandAt(1, key); |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4125 | 4193 |
| 4126 DECLARE_CONCRETE_INSTRUCTION(In) | 4194 DECLARE_CONCRETE_INSTRUCTION(In) |
| 4127 }; | 4195 }; |
| 4128 | 4196 |
| 4129 #undef DECLARE_INSTRUCTION | 4197 #undef DECLARE_INSTRUCTION |
| 4130 #undef DECLARE_CONCRETE_INSTRUCTION | 4198 #undef DECLARE_CONCRETE_INSTRUCTION |
| 4131 | 4199 |
| 4132 } } // namespace v8::internal | 4200 } } // namespace v8::internal |
| 4133 | 4201 |
| 4134 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 4202 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |