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 12447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12458 SetFastDoubleElementsCapacityAndLength(object, new_capacity, index + 1); | 12458 SetFastDoubleElementsCapacityAndLength(object, new_capacity, index + 1); |
12459 FixedDoubleArray::cast(object->elements())->set(index, double_value); | 12459 FixedDoubleArray::cast(object->elements())->set(index, double_value); |
12460 object->ValidateElements(); | 12460 object->ValidateElements(); |
12461 return value; | 12461 return value; |
12462 } | 12462 } |
12463 } | 12463 } |
12464 | 12464 |
12465 // Otherwise default to slow case. | 12465 // Otherwise default to slow case. |
12466 ASSERT(object->HasFastDoubleElements()); | 12466 ASSERT(object->HasFastDoubleElements()); |
12467 ASSERT(object->map()->has_fast_double_elements()); | 12467 ASSERT(object->map()->has_fast_double_elements()); |
12468 ASSERT(object->elements()->IsFixedDoubleArray()); | 12468 ASSERT(object->elements()->IsFixedDoubleArray() || |
| 12469 object->elements()->length() == 0); |
12469 | 12470 |
12470 NormalizeElements(object); | 12471 NormalizeElements(object); |
12471 ASSERT(object->HasDictionaryElements()); | 12472 ASSERT(object->HasDictionaryElements()); |
12472 return SetElement(object, index, value, NONE, strict_mode, check_prototype); | 12473 return SetElement(object, index, value, NONE, strict_mode, check_prototype); |
12473 } | 12474 } |
12474 | 12475 |
12475 | 12476 |
12476 Handle<Object> JSReceiver::SetElement(Handle<JSReceiver> object, | 12477 Handle<Object> JSReceiver::SetElement(Handle<JSReceiver> object, |
12477 uint32_t index, | 12478 uint32_t index, |
12478 Handle<Object> value, | 12479 Handle<Object> value, |
(...skipping 4005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16484 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16485 #define ERROR_MESSAGES_TEXTS(C, T) T, |
16485 static const char* error_messages_[] = { | 16486 static const char* error_messages_[] = { |
16486 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16487 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
16487 }; | 16488 }; |
16488 #undef ERROR_MESSAGES_TEXTS | 16489 #undef ERROR_MESSAGES_TEXTS |
16489 return error_messages_[reason]; | 16490 return error_messages_[reason]; |
16490 } | 16491 } |
16491 | 16492 |
16492 | 16493 |
16493 } } // namespace v8::internal | 16494 } } // namespace v8::internal |
OLD | NEW |