OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 FAST_HOLEY_ELEMENTS, | 46 FAST_HOLEY_ELEMENTS, |
47 | 47 |
48 // The "fast" kind for unwrapped, non-tagged double values. | 48 // The "fast" kind for unwrapped, non-tagged double values. |
49 FAST_DOUBLE_ELEMENTS, | 49 FAST_DOUBLE_ELEMENTS, |
50 FAST_HOLEY_DOUBLE_ELEMENTS, | 50 FAST_HOLEY_DOUBLE_ELEMENTS, |
51 | 51 |
52 // The "slow" kind. | 52 // The "slow" kind. |
53 DICTIONARY_ELEMENTS, | 53 DICTIONARY_ELEMENTS, |
54 NON_STRICT_ARGUMENTS_ELEMENTS, | 54 NON_STRICT_ARGUMENTS_ELEMENTS, |
55 // The "fast" kind for external arrays | 55 // The "fast" kind for external arrays |
56 EXTERNAL_BYTE_ELEMENTS, | 56 EXTERNAL_INT8_ELEMENTS, |
57 EXTERNAL_UNSIGNED_BYTE_ELEMENTS, | 57 EXTERNAL_UINT8_ELEMENTS, |
58 EXTERNAL_SHORT_ELEMENTS, | 58 EXTERNAL_INT16_ELEMENTS, |
59 EXTERNAL_UNSIGNED_SHORT_ELEMENTS, | 59 EXTERNAL_UINT16_ELEMENTS, |
60 EXTERNAL_INT_ELEMENTS, | 60 EXTERNAL_INT32_ELEMENTS, |
61 EXTERNAL_UNSIGNED_INT_ELEMENTS, | 61 EXTERNAL_UINT32_ELEMENTS, |
62 EXTERNAL_FLOAT_ELEMENTS, | 62 EXTERNAL_FLOAT32_ELEMENTS, |
63 EXTERNAL_DOUBLE_ELEMENTS, | 63 EXTERNAL_FLOAT64_ELEMENTS, |
64 EXTERNAL_PIXEL_ELEMENTS, | 64 EXTERNAL_UINT8_CLAMPED_ELEMENTS, |
65 | 65 |
66 // Fixed typed arrays | 66 // Fixed typed arrays |
67 UINT8_ELEMENTS, | 67 UINT8_ELEMENTS, |
68 INT8_ELEMENTS, | 68 INT8_ELEMENTS, |
69 UINT16_ELEMENTS, | 69 UINT16_ELEMENTS, |
70 INT16_ELEMENTS, | 70 INT16_ELEMENTS, |
71 UINT32_ELEMENTS, | 71 UINT32_ELEMENTS, |
72 INT32_ELEMENTS, | 72 INT32_ELEMENTS, |
73 FLOAT32_ELEMENTS, | 73 FLOAT32_ELEMENTS, |
74 FLOAT64_ELEMENTS, | 74 FLOAT64_ELEMENTS, |
75 UINT8_CLAMPED_ELEMENTS, | 75 UINT8_CLAMPED_ELEMENTS, |
76 | 76 |
77 // Derived constants from ElementsKind | 77 // Derived constants from ElementsKind |
78 FIRST_ELEMENTS_KIND = FAST_SMI_ELEMENTS, | 78 FIRST_ELEMENTS_KIND = FAST_SMI_ELEMENTS, |
79 LAST_ELEMENTS_KIND = UINT8_CLAMPED_ELEMENTS, | 79 LAST_ELEMENTS_KIND = UINT8_CLAMPED_ELEMENTS, |
80 FIRST_FAST_ELEMENTS_KIND = FAST_SMI_ELEMENTS, | 80 FIRST_FAST_ELEMENTS_KIND = FAST_SMI_ELEMENTS, |
81 LAST_FAST_ELEMENTS_KIND = FAST_HOLEY_DOUBLE_ELEMENTS, | 81 LAST_FAST_ELEMENTS_KIND = FAST_HOLEY_DOUBLE_ELEMENTS, |
82 FIRST_EXTERNAL_ARRAY_ELEMENTS_KIND = EXTERNAL_BYTE_ELEMENTS, | 82 FIRST_EXTERNAL_ARRAY_ELEMENTS_KIND = EXTERNAL_INT8_ELEMENTS, |
83 LAST_EXTERNAL_ARRAY_ELEMENTS_KIND = EXTERNAL_PIXEL_ELEMENTS, | 83 LAST_EXTERNAL_ARRAY_ELEMENTS_KIND = EXTERNAL_UINT8_CLAMPED_ELEMENTS, |
84 FIRST_FIXED_TYPED_ARRAY_ELEMENTS_KIND = UINT8_ELEMENTS, | 84 FIRST_FIXED_TYPED_ARRAY_ELEMENTS_KIND = UINT8_ELEMENTS, |
85 LAST_FIXED_TYPED_ARRAY_ELEMENTS_KIND = UINT8_CLAMPED_ELEMENTS, | 85 LAST_FIXED_TYPED_ARRAY_ELEMENTS_KIND = UINT8_CLAMPED_ELEMENTS, |
86 TERMINAL_FAST_ELEMENTS_KIND = FAST_HOLEY_ELEMENTS | 86 TERMINAL_FAST_ELEMENTS_KIND = FAST_HOLEY_ELEMENTS |
87 }; | 87 }; |
88 | 88 |
89 const int kElementsKindCount = LAST_ELEMENTS_KIND - FIRST_ELEMENTS_KIND + 1; | 89 const int kElementsKindCount = LAST_ELEMENTS_KIND - FIRST_ELEMENTS_KIND + 1; |
90 const int kFastElementsKindCount = LAST_FAST_ELEMENTS_KIND - | 90 const int kFastElementsKindCount = LAST_FAST_ELEMENTS_KIND - |
91 FIRST_FAST_ELEMENTS_KIND + 1; | 91 FIRST_FAST_ELEMENTS_KIND + 1; |
92 | 92 |
93 // The number to add to a packed elements kind to reach a holey elements kind | 93 // The number to add to a packed elements kind to reach a holey elements kind |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 } | 128 } |
129 | 129 |
130 | 130 |
131 inline bool IsFastDoubleElementsKind(ElementsKind kind) { | 131 inline bool IsFastDoubleElementsKind(ElementsKind kind) { |
132 return kind == FAST_DOUBLE_ELEMENTS || | 132 return kind == FAST_DOUBLE_ELEMENTS || |
133 kind == FAST_HOLEY_DOUBLE_ELEMENTS; | 133 kind == FAST_HOLEY_DOUBLE_ELEMENTS; |
134 } | 134 } |
135 | 135 |
136 | 136 |
137 inline bool IsExternalFloatOrDoubleElementsKind(ElementsKind kind) { | 137 inline bool IsExternalFloatOrDoubleElementsKind(ElementsKind kind) { |
138 return kind == EXTERNAL_DOUBLE_ELEMENTS || | 138 return kind == EXTERNAL_FLOAT64_ELEMENTS || |
139 kind == EXTERNAL_FLOAT_ELEMENTS; | 139 kind == EXTERNAL_FLOAT32_ELEMENTS; |
140 } | 140 } |
141 | 141 |
142 | 142 |
143 inline bool IsFixedFloatElementsKind(ElementsKind kind) { | 143 inline bool IsFixedFloatElementsKind(ElementsKind kind) { |
144 return kind == FLOAT32_ELEMENTS || kind == FLOAT64_ELEMENTS; | 144 return kind == FLOAT32_ELEMENTS || kind == FLOAT64_ELEMENTS; |
145 } | 145 } |
146 | 146 |
147 | 147 |
148 inline bool IsDoubleOrFloatElementsKind(ElementsKind kind) { | 148 inline bool IsDoubleOrFloatElementsKind(ElementsKind kind) { |
149 return IsFastDoubleElementsKind(kind) || | 149 return IsFastDoubleElementsKind(kind) || |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 bool allow_only_packed) { | 255 bool allow_only_packed) { |
256 return IsFastElementsKind(elements_kind) && | 256 return IsFastElementsKind(elements_kind) && |
257 (elements_kind != TERMINAL_FAST_ELEMENTS_KIND && | 257 (elements_kind != TERMINAL_FAST_ELEMENTS_KIND && |
258 (!allow_only_packed || elements_kind != FAST_ELEMENTS)); | 258 (!allow_only_packed || elements_kind != FAST_ELEMENTS)); |
259 } | 259 } |
260 | 260 |
261 | 261 |
262 } } // namespace v8::internal | 262 } } // namespace v8::internal |
263 | 263 |
264 #endif // V8_ELEMENTS_KIND_H_ | 264 #endif // V8_ELEMENTS_KIND_H_ |
OLD | NEW |