| 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_ELEMENTS_KIND_H_ | 5 #ifndef V8_ELEMENTS_KIND_H_ |
| 6 #define V8_ELEMENTS_KIND_H_ | 6 #define V8_ELEMENTS_KIND_H_ |
| 7 | 7 |
| 8 #include "src/checks.h" | 8 #include "src/checks.h" |
| 9 #include "src/ostreams.h" | 9 #include "src/ostreams.h" |
| 10 | 10 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 FIRST_FAST_ELEMENTS_KIND + 1; | 69 FIRST_FAST_ELEMENTS_KIND + 1; |
| 70 | 70 |
| 71 // The number to add to a packed elements kind to reach a holey elements kind | 71 // The number to add to a packed elements kind to reach a holey elements kind |
| 72 const int kFastElementsKindPackedToHoley = | 72 const int kFastElementsKindPackedToHoley = |
| 73 FAST_HOLEY_SMI_ELEMENTS - FAST_SMI_ELEMENTS; | 73 FAST_HOLEY_SMI_ELEMENTS - FAST_SMI_ELEMENTS; |
| 74 | 74 |
| 75 int ElementsKindToShiftSize(ElementsKind elements_kind); | 75 int ElementsKindToShiftSize(ElementsKind elements_kind); |
| 76 int GetDefaultHeaderSizeForElementsKind(ElementsKind elements_kind); | 76 int GetDefaultHeaderSizeForElementsKind(ElementsKind elements_kind); |
| 77 const char* ElementsKindToString(ElementsKind kind); | 77 const char* ElementsKindToString(ElementsKind kind); |
| 78 | 78 |
| 79 ElementsKind GetInitialFastElementsKind(); | 79 inline ElementsKind GetInitialFastElementsKind() { return FAST_SMI_ELEMENTS; } |
| 80 | 80 |
| 81 ElementsKind GetFastElementsKindFromSequenceIndex(int sequence_number); | 81 ElementsKind GetFastElementsKindFromSequenceIndex(int sequence_number); |
| 82 int GetSequenceIndexFromFastElementsKind(ElementsKind elements_kind); | 82 int GetSequenceIndexFromFastElementsKind(ElementsKind elements_kind); |
| 83 | 83 |
| 84 ElementsKind GetNextTransitionElementsKind(ElementsKind elements_kind); | 84 ElementsKind GetNextTransitionElementsKind(ElementsKind elements_kind); |
| 85 | 85 |
| 86 inline bool IsDictionaryElementsKind(ElementsKind kind) { | 86 inline bool IsDictionaryElementsKind(ElementsKind kind) { |
| 87 return kind == DICTIONARY_ELEMENTS; | 87 return kind == DICTIONARY_ELEMENTS; |
| 88 } | 88 } |
| 89 | 89 |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 bool allow_only_packed) { | 244 bool allow_only_packed) { |
| 245 return IsFastElementsKind(elements_kind) && | 245 return IsFastElementsKind(elements_kind) && |
| 246 (elements_kind != TERMINAL_FAST_ELEMENTS_KIND && | 246 (elements_kind != TERMINAL_FAST_ELEMENTS_KIND && |
| 247 (!allow_only_packed || elements_kind != FAST_ELEMENTS)); | 247 (!allow_only_packed || elements_kind != FAST_ELEMENTS)); |
| 248 } | 248 } |
| 249 | 249 |
| 250 | 250 |
| 251 } } // namespace v8::internal | 251 } } // namespace v8::internal |
| 252 | 252 |
| 253 #endif // V8_ELEMENTS_KIND_H_ | 253 #endif // V8_ELEMENTS_KIND_H_ |
| OLD | NEW |