| 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 <cstring> | 8 #include <cstring> |
| 9 #include <iosfwd> | 9 #include <iosfwd> |
| 10 | 10 |
| (...skipping 4895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4906 HAdd(HValue* context, HValue* left, HValue* right, Strength strength, | 4906 HAdd(HValue* context, HValue* left, HValue* right, Strength strength, |
| 4907 ExternalAddType external_add_type = NoExternalAdd) | 4907 ExternalAddType external_add_type = NoExternalAdd) |
| 4908 : HArithmeticBinaryOperation(context, left, right, strength), | 4908 : HArithmeticBinaryOperation(context, left, right, strength), |
| 4909 external_add_type_(external_add_type) { | 4909 external_add_type_(external_add_type) { |
| 4910 SetFlag(kCanOverflow); | 4910 SetFlag(kCanOverflow); |
| 4911 switch (external_add_type_) { | 4911 switch (external_add_type_) { |
| 4912 case AddOfExternalAndTagged: | 4912 case AddOfExternalAndTagged: |
| 4913 DCHECK(left->representation().IsExternal()); | 4913 DCHECK(left->representation().IsExternal()); |
| 4914 DCHECK(right->representation().IsTagged()); | 4914 DCHECK(right->representation().IsTagged()); |
| 4915 SetDependsOnFlag(kNewSpacePromotion); | 4915 SetDependsOnFlag(kNewSpacePromotion); |
| 4916 ClearFlag(HValue::kCanOverflow); |
| 4917 SetFlag(kHasNoObservableSideEffects); |
| 4916 break; | 4918 break; |
| 4917 | 4919 |
| 4918 case NoExternalAdd: | 4920 case NoExternalAdd: |
| 4919 // This is a bit of a hack: The call to this constructor is generated | 4921 // This is a bit of a hack: The call to this constructor is generated |
| 4920 // by a macro that also supports sub and mul, so it doesn't pass in | 4922 // by a macro that also supports sub and mul, so it doesn't pass in |
| 4921 // a value for external_add_type but uses the default. | 4923 // a value for external_add_type but uses the default. |
| 4922 if (left->representation().IsExternal()) { | 4924 if (left->representation().IsExternal()) { |
| 4923 external_add_type_ = AddOfExternalAndInt32; | 4925 external_add_type_ = AddOfExternalAndInt32; |
| 4924 } | 4926 } |
| 4925 break; | 4927 break; |
| (...skipping 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6021 kArrayLengths, | 6023 kArrayLengths, |
| 6022 FixedArray::kLengthOffset, | 6024 FixedArray::kLengthOffset, |
| 6023 Representation::Smi()); | 6025 Representation::Smi()); |
| 6024 } | 6026 } |
| 6025 | 6027 |
| 6026 static HObjectAccess ForFixedTypedArrayBaseBasePointer() { | 6028 static HObjectAccess ForFixedTypedArrayBaseBasePointer() { |
| 6027 return HObjectAccess(kInobject, FixedTypedArrayBase::kBasePointerOffset, | 6029 return HObjectAccess(kInobject, FixedTypedArrayBase::kBasePointerOffset, |
| 6028 Representation::Tagged()); | 6030 Representation::Tagged()); |
| 6029 } | 6031 } |
| 6030 | 6032 |
| 6033 static HObjectAccess ForFixedTypedArrayBaseExternalPointer() { |
| 6034 return HObjectAccess::ForObservableJSObjectOffset( |
| 6035 FixedTypedArrayBase::kExternalPointerOffset, |
| 6036 Representation::External()); |
| 6037 } |
| 6038 |
| 6031 static HObjectAccess ForStringHashField() { | 6039 static HObjectAccess ForStringHashField() { |
| 6032 return HObjectAccess(kInobject, | 6040 return HObjectAccess(kInobject, |
| 6033 String::kHashFieldOffset, | 6041 String::kHashFieldOffset, |
| 6034 Representation::Integer32()); | 6042 Representation::Integer32()); |
| 6035 } | 6043 } |
| 6036 | 6044 |
| 6037 static HObjectAccess ForStringLength() { | 6045 static HObjectAccess ForStringLength() { |
| 6038 STATIC_ASSERT(String::kMaxLength <= Smi::kMaxValue); | 6046 STATIC_ASSERT(String::kMaxLength <= Smi::kMaxValue); |
| 6039 return HObjectAccess( | 6047 return HObjectAccess( |
| 6040 kStringLengths, | 6048 kStringLengths, |
| (...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6641 ElementsKind elements_kind() const override { | 6649 ElementsKind elements_kind() const override { |
| 6642 return ElementsKindField::decode(bit_field_); | 6650 return ElementsKindField::decode(bit_field_); |
| 6643 } | 6651 } |
| 6644 LoadKeyedHoleMode hole_mode() const { | 6652 LoadKeyedHoleMode hole_mode() const { |
| 6645 return HoleModeField::decode(bit_field_); | 6653 return HoleModeField::decode(bit_field_); |
| 6646 } | 6654 } |
| 6647 | 6655 |
| 6648 Representation RequiredInputRepresentation(int index) override { | 6656 Representation RequiredInputRepresentation(int index) override { |
| 6649 // kind_fast: tagged[int32] (none) | 6657 // kind_fast: tagged[int32] (none) |
| 6650 // kind_double: tagged[int32] (none) | 6658 // kind_double: tagged[int32] (none) |
| 6651 // kind_fixed_typed_array: tagged[int32] (none) | 6659 // kind_fixed_typed_array: external[int32] (none) |
| 6652 // kind_external: external[int32] (none) | 6660 // kind_external: external[int32] (none) |
| 6653 if (index == 0) { | 6661 if (index == 0) { |
| 6654 return is_external() ? Representation::External() | 6662 return is_typed_elements() ? Representation::External() |
| 6655 : Representation::Tagged(); | 6663 : Representation::Tagged(); |
| 6656 } | 6664 } |
| 6657 if (index == 1) { | 6665 if (index == 1) { |
| 6658 return ArrayInstructionInterface::KeyedAccessIndexRequirement( | 6666 return ArrayInstructionInterface::KeyedAccessIndexRequirement( |
| 6659 OperandAt(1)->representation()); | 6667 OperandAt(1)->representation()); |
| 6660 } | 6668 } |
| 6661 return Representation::None(); | 6669 return Representation::None(); |
| 6662 } | 6670 } |
| 6663 | 6671 |
| 6664 Representation observed_input_representation(int index) override { | 6672 Representation observed_input_representation(int index) override { |
| 6665 return RequiredInputRepresentation(index); | 6673 return RequiredInputRepresentation(index); |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7106 DECLARE_INSTRUCTION_FACTORY_P6(HStoreKeyed, HValue*, HValue*, HValue*, | 7114 DECLARE_INSTRUCTION_FACTORY_P6(HStoreKeyed, HValue*, HValue*, HValue*, |
| 7107 ElementsKind, StoreFieldOrKeyedMode, int); | 7115 ElementsKind, StoreFieldOrKeyedMode, int); |
| 7108 | 7116 |
| 7109 Representation RequiredInputRepresentation(int index) override { | 7117 Representation RequiredInputRepresentation(int index) override { |
| 7110 // kind_fast: tagged[int32] = tagged | 7118 // kind_fast: tagged[int32] = tagged |
| 7111 // kind_double: tagged[int32] = double | 7119 // kind_double: tagged[int32] = double |
| 7112 // kind_smi : tagged[int32] = smi | 7120 // kind_smi : tagged[int32] = smi |
| 7113 // kind_fixed_typed_array: tagged[int32] = (double | int32) | 7121 // kind_fixed_typed_array: tagged[int32] = (double | int32) |
| 7114 // kind_external: external[int32] = (double | int32) | 7122 // kind_external: external[int32] = (double | int32) |
| 7115 if (index == 0) { | 7123 if (index == 0) { |
| 7116 return is_external() ? Representation::External() | 7124 return is_typed_elements() ? Representation::External() |
| 7117 : Representation::Tagged(); | 7125 : Representation::Tagged(); |
| 7118 } else if (index == 1) { | 7126 } else if (index == 1) { |
| 7119 return ArrayInstructionInterface::KeyedAccessIndexRequirement( | 7127 return ArrayInstructionInterface::KeyedAccessIndexRequirement( |
| 7120 OperandAt(1)->representation()); | 7128 OperandAt(1)->representation()); |
| 7121 } | 7129 } |
| 7122 | 7130 |
| 7123 DCHECK_EQ(index, 2); | 7131 DCHECK_EQ(index, 2); |
| 7124 return RequiredValueRepresentation(elements_kind(), store_mode()); | 7132 return RequiredValueRepresentation(elements_kind(), store_mode()); |
| 7125 } | 7133 } |
| 7126 | 7134 |
| 7127 static Representation RequiredValueRepresentation( | 7135 static Representation RequiredValueRepresentation( |
| (...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8085 }; | 8093 }; |
| 8086 | 8094 |
| 8087 | 8095 |
| 8088 | 8096 |
| 8089 #undef DECLARE_INSTRUCTION | 8097 #undef DECLARE_INSTRUCTION |
| 8090 #undef DECLARE_CONCRETE_INSTRUCTION | 8098 #undef DECLARE_CONCRETE_INSTRUCTION |
| 8091 | 8099 |
| 8092 } } // namespace v8::internal | 8100 } } // namespace v8::internal |
| 8093 | 8101 |
| 8094 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 8102 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |