Chromium Code Reviews| 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 204 bool IsMoreGeneralElementsKindTransition(ElementsKind from_kind, | 204 bool IsMoreGeneralElementsKindTransition(ElementsKind from_kind, |
| 205 ElementsKind to_kind); | 205 ElementsKind to_kind); |
| 206 | 206 |
| 207 | 207 |
| 208 inline bool IsTransitionableFastElementsKind(ElementsKind from_kind) { | 208 inline bool IsTransitionableFastElementsKind(ElementsKind from_kind) { |
| 209 return IsFastElementsKind(from_kind) && | 209 return IsFastElementsKind(from_kind) && |
| 210 from_kind != TERMINAL_FAST_ELEMENTS_KIND; | 210 from_kind != TERMINAL_FAST_ELEMENTS_KIND; |
| 211 } | 211 } |
| 212 | 212 |
| 213 | 213 |
| 214 // Return the closest fast elements kind that can be transitioned to from both | |
| 215 // kind1 and kind2. For example, kind1 is a SMI, kind2 is a DOUBLE, then | |
| 216 // return DOUBLE. If kind1 is a HOLEY_SMI and kind2 is a DOUBLE, return | |
| 217 // HOLEY_DOUBLE. | |
| 218 ElementsKind GetUnifiedFastElementsKind(ElementsKind kind1, ElementsKind kind2); | |
|
danno
2012/11/28 14:42:10
GetMostGeneralFastElementsKind?
| |
| 219 | |
| 214 ElementsKind GetNextMoreGeneralFastElementsKind(ElementsKind elements_kind, | 220 ElementsKind GetNextMoreGeneralFastElementsKind(ElementsKind elements_kind, |
| 215 bool allow_only_packed); | 221 bool allow_only_packed); |
| 216 | 222 |
| 217 | 223 |
| 218 inline bool CanTransitionToMoreGeneralFastElementsKind( | 224 inline bool CanTransitionToMoreGeneralFastElementsKind( |
| 219 ElementsKind elements_kind, | 225 ElementsKind elements_kind, |
| 220 bool allow_only_packed) { | 226 bool allow_only_packed) { |
| 221 return IsFastElementsKind(elements_kind) && | 227 return IsFastElementsKind(elements_kind) && |
| 222 (elements_kind != TERMINAL_FAST_ELEMENTS_KIND && | 228 (elements_kind != TERMINAL_FAST_ELEMENTS_KIND && |
| 223 (!allow_only_packed || elements_kind != FAST_ELEMENTS)); | 229 (!allow_only_packed || elements_kind != FAST_ELEMENTS)); |
| 224 } | 230 } |
| 225 | 231 |
| 226 | 232 |
| 227 } } // namespace v8::internal | 233 } } // namespace v8::internal |
| 228 | 234 |
| 229 #endif // V8_ELEMENTS_KIND_H_ | 235 #endif // V8_ELEMENTS_KIND_H_ |
| OLD | NEW |