| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 13071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13082 break; | 13082 break; |
| 13083 } | 13083 } |
| 13084 case FAST_DOUBLE_ELEMENTS: | 13084 case FAST_DOUBLE_ELEMENTS: |
| 13085 if (IsJSArray()) { | 13085 if (IsJSArray()) { |
| 13086 *capacity = backing_store_base->length(); | 13086 *capacity = backing_store_base->length(); |
| 13087 *used = Smi::cast(JSArray::cast(this)->length())->value(); | 13087 *used = Smi::cast(JSArray::cast(this)->length())->value(); |
| 13088 break; | 13088 break; |
| 13089 } | 13089 } |
| 13090 // Fall through if packing is not guaranteed. | 13090 // Fall through if packing is not guaranteed. |
| 13091 case FAST_HOLEY_DOUBLE_ELEMENTS: { | 13091 case FAST_HOLEY_DOUBLE_ELEMENTS: { |
| 13092 FixedDoubleArray* elms = FixedDoubleArray::cast(elements()); | 13092 *capacity = elements()->length(); |
| 13093 *capacity = elms->length(); | 13093 if (*capacity == 0) break; |
| 13094 FixedDoubleArray * elms = FixedDoubleArray::cast(elements()); |
| 13094 for (int i = 0; i < *capacity; i++) { | 13095 for (int i = 0; i < *capacity; i++) { |
| 13095 if (!elms->is_the_hole(i)) ++(*used); | 13096 if (!elms->is_the_hole(i)) ++(*used); |
| 13096 } | 13097 } |
| 13097 break; | 13098 break; |
| 13098 } | 13099 } |
| 13099 | 13100 |
| 13100 #define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \ | 13101 #define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \ |
| 13101 case EXTERNAL_##TYPE##_ELEMENTS: \ | 13102 case EXTERNAL_##TYPE##_ELEMENTS: \ |
| 13102 case TYPE##_ELEMENTS: \ | 13103 case TYPE##_ELEMENTS: \ |
| 13103 | 13104 |
| (...skipping 3387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16491 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16492 #define ERROR_MESSAGES_TEXTS(C, T) T, |
| 16492 static const char* error_messages_[] = { | 16493 static const char* error_messages_[] = { |
| 16493 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16494 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
| 16494 }; | 16495 }; |
| 16495 #undef ERROR_MESSAGES_TEXTS | 16496 #undef ERROR_MESSAGES_TEXTS |
| 16496 return error_messages_[reason]; | 16497 return error_messages_[reason]; |
| 16497 } | 16498 } |
| 16498 | 16499 |
| 16499 | 16500 |
| 16500 } } // namespace v8::internal | 16501 } } // namespace v8::internal |
| OLD | NEW |