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/base/macros.h" | 8 #include "src/base/macros.h" |
9 #include "src/checks.h" | 9 #include "src/checks.h" |
10 | 10 |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 return (GetHoleyElementsKind(from_kind) == to_kind) || | 204 return (GetHoleyElementsKind(from_kind) == to_kind) || |
205 (IsFastSmiElementsKind(from_kind) && | 205 (IsFastSmiElementsKind(from_kind) && |
206 IsFastObjectElementsKind(to_kind)); | 206 IsFastObjectElementsKind(to_kind)); |
207 } | 207 } |
208 | 208 |
209 | 209 |
210 bool IsMoreGeneralElementsKindTransition(ElementsKind from_kind, | 210 bool IsMoreGeneralElementsKindTransition(ElementsKind from_kind, |
211 ElementsKind to_kind); | 211 ElementsKind to_kind); |
212 | 212 |
213 | 213 |
| 214 inline ElementsKind GetMoreGeneralElementsKind(ElementsKind from_kind, |
| 215 ElementsKind to_kind) { |
| 216 if (IsMoreGeneralElementsKindTransition(from_kind, to_kind)) { |
| 217 return to_kind; |
| 218 } |
| 219 return from_kind; |
| 220 } |
| 221 |
| 222 |
214 inline bool IsTransitionableFastElementsKind(ElementsKind from_kind) { | 223 inline bool IsTransitionableFastElementsKind(ElementsKind from_kind) { |
215 return IsFastElementsKind(from_kind) && | 224 return IsFastElementsKind(from_kind) && |
216 from_kind != TERMINAL_FAST_ELEMENTS_KIND; | 225 from_kind != TERMINAL_FAST_ELEMENTS_KIND; |
217 } | 226 } |
218 | 227 |
219 | 228 |
220 } } // namespace v8::internal | 229 } } // namespace v8::internal |
221 | 230 |
222 #endif // V8_ELEMENTS_KIND_H_ | 231 #endif // V8_ELEMENTS_KIND_H_ |
OLD | NEW |