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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 160 } | 160 } |
| 161 | 161 |
| 162 | 162 |
| 163 inline bool IsFastPackedElementsKind(ElementsKind kind) { | 163 inline bool IsFastPackedElementsKind(ElementsKind kind) { |
| 164 return kind == FAST_SMI_ELEMENTS || | 164 return kind == FAST_SMI_ELEMENTS || |
| 165 kind == FAST_DOUBLE_ELEMENTS || | 165 kind == FAST_DOUBLE_ELEMENTS || |
| 166 kind == FAST_ELEMENTS; | 166 kind == FAST_ELEMENTS; |
| 167 } | 167 } |
| 168 | 168 |
| 169 | 169 |
| 170 inline bool IsFastPackedSmiElementsKind(ElementsKind kind) { | |
|
Toon Verwaest
2013/12/17 13:53:04
I wouldn't add this method. Just directly compare
Igor Sheludko
2013/12/18 10:01:33
Done.
| |
| 171 return kind == FAST_SMI_ELEMENTS; | |
| 172 } | |
| 173 | |
| 174 | |
| 170 inline ElementsKind GetPackedElementsKind(ElementsKind holey_kind) { | 175 inline ElementsKind GetPackedElementsKind(ElementsKind holey_kind) { |
| 171 if (holey_kind == FAST_HOLEY_SMI_ELEMENTS) { | 176 if (holey_kind == FAST_HOLEY_SMI_ELEMENTS) { |
| 172 return FAST_SMI_ELEMENTS; | 177 return FAST_SMI_ELEMENTS; |
| 173 } | 178 } |
| 174 if (holey_kind == FAST_HOLEY_DOUBLE_ELEMENTS) { | 179 if (holey_kind == FAST_HOLEY_DOUBLE_ELEMENTS) { |
| 175 return FAST_DOUBLE_ELEMENTS; | 180 return FAST_DOUBLE_ELEMENTS; |
| 176 } | 181 } |
| 177 if (holey_kind == FAST_HOLEY_ELEMENTS) { | 182 if (holey_kind == FAST_HOLEY_ELEMENTS) { |
| 178 return FAST_ELEMENTS; | 183 return FAST_ELEMENTS; |
| 179 } | 184 } |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 230 bool allow_only_packed) { | 235 bool allow_only_packed) { |
| 231 return IsFastElementsKind(elements_kind) && | 236 return IsFastElementsKind(elements_kind) && |
| 232 (elements_kind != TERMINAL_FAST_ELEMENTS_KIND && | 237 (elements_kind != TERMINAL_FAST_ELEMENTS_KIND && |
| 233 (!allow_only_packed || elements_kind != FAST_ELEMENTS)); | 238 (!allow_only_packed || elements_kind != FAST_ELEMENTS)); |
| 234 } | 239 } |
| 235 | 240 |
| 236 | 241 |
| 237 } } // namespace v8::internal | 242 } } // namespace v8::internal |
| 238 | 243 |
| 239 #endif // V8_ELEMENTS_KIND_H_ | 244 #endif // V8_ELEMENTS_KIND_H_ |
| OLD | NEW |