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 6954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6965 // kind_external: external[int32] = (double | int32) | 6965 // kind_external: external[int32] = (double | int32) |
6966 if (index == 0) { | 6966 if (index == 0) { |
6967 return is_external() ? Representation::External() | 6967 return is_external() ? Representation::External() |
6968 : Representation::Tagged(); | 6968 : Representation::Tagged(); |
6969 } else if (index == 1) { | 6969 } else if (index == 1) { |
6970 return ArrayInstructionInterface::KeyedAccessIndexRequirement( | 6970 return ArrayInstructionInterface::KeyedAccessIndexRequirement( |
6971 OperandAt(1)->representation()); | 6971 OperandAt(1)->representation()); |
6972 } | 6972 } |
6973 | 6973 |
6974 ASSERT_EQ(index, 2); | 6974 ASSERT_EQ(index, 2); |
6975 if (IsDoubleOrFloatElementsKind(elements_kind())) { | 6975 return RequiredValueRepresentation(elements_kind_, store_mode_); |
| 6976 } |
| 6977 |
| 6978 static Representation RequiredValueRepresentation( |
| 6979 ElementsKind kind, StoreFieldOrKeyedMode mode) { |
| 6980 if (IsDoubleOrFloatElementsKind(kind)) { |
6976 return Representation::Double(); | 6981 return Representation::Double(); |
6977 } | 6982 } |
6978 if (SmiValuesAre32Bits() && store_mode_ == STORE_TO_INITIALIZED_ENTRY) { | 6983 |
6979 return Representation::Integer32(); | 6984 if (IsFastSmiElementsKind(kind)) { |
6980 } | 6985 if (SmiValuesAre32Bits() && mode == STORE_TO_INITIALIZED_ENTRY) { |
6981 if (IsFastSmiElementsKind(elements_kind())) { | 6986 return Representation::Integer32(); |
| 6987 } |
6982 return Representation::Smi(); | 6988 return Representation::Smi(); |
6983 } | 6989 } |
6984 | 6990 |
6985 return is_external() || is_fixed_typed_array() | 6991 return IsExternalArrayElementsKind(kind) || |
6986 ? Representation::Integer32() | 6992 IsFixedTypedArrayElementsKind(kind) |
6987 : Representation::Tagged(); | 6993 ? Representation::Integer32() |
| 6994 : Representation::Tagged(); |
6988 } | 6995 } |
6989 | 6996 |
6990 bool is_external() const { | 6997 bool is_external() const { |
6991 return IsExternalArrayElementsKind(elements_kind()); | 6998 return IsExternalArrayElementsKind(elements_kind()); |
6992 } | 6999 } |
6993 | 7000 |
6994 bool is_fixed_typed_array() const { | 7001 bool is_fixed_typed_array() const { |
6995 return IsFixedTypedArrayElementsKind(elements_kind()); | 7002 return IsFixedTypedArrayElementsKind(elements_kind()); |
6996 } | 7003 } |
6997 | 7004 |
(...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7859 }; | 7866 }; |
7860 | 7867 |
7861 | 7868 |
7862 | 7869 |
7863 #undef DECLARE_INSTRUCTION | 7870 #undef DECLARE_INSTRUCTION |
7864 #undef DECLARE_CONCRETE_INSTRUCTION | 7871 #undef DECLARE_CONCRETE_INSTRUCTION |
7865 | 7872 |
7866 } } // namespace v8::internal | 7873 } } // namespace v8::internal |
7867 | 7874 |
7868 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7875 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |