| 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 3432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3443 Label slow, check_heap_number, miss_force_generic; | 3443 Label slow, check_heap_number, miss_force_generic; |
| 3444 | 3444 |
| 3445 // Register usage. | 3445 // Register usage. |
| 3446 Register value = x0; | 3446 Register value = x0; |
| 3447 Register key = x1; | 3447 Register key = x1; |
| 3448 Register receiver = x2; | 3448 Register receiver = x2; |
| 3449 | 3449 |
| 3450 // This stub is meant to be tail-jumped to, the receiver must already | 3450 // This stub is meant to be tail-jumped to, the receiver must already |
| 3451 // have been verified by the caller to not be a smi. | 3451 // have been verified by the caller to not be a smi. |
| 3452 if (__ emit_debug_code()) { | 3452 if (__ emit_debug_code()) { |
| 3453 Label ok; | 3453 __ AssertNotSmi(receiver); |
| 3454 __ JumpIfNotSmi(receiver, &ok); | |
| 3455 __ Abort("KeyedStoreStubCompiler::GenerateStoreExternalArray: " | |
| 3456 "receiver is a SMI\n"); | |
| 3457 __ Bind(&ok); | |
| 3458 } | 3454 } |
| 3459 | 3455 |
| 3460 // Check that the key is a smi or a heap number convertible to a smi. | 3456 // Check that the key is a smi or a heap number convertible to a smi. |
| 3461 GenerateSmiKeyCheck(masm, key, x10, d16, d17, &miss_force_generic); | 3457 GenerateSmiKeyCheck(masm, key, x10, d16, d17, &miss_force_generic); |
| 3462 | 3458 |
| 3463 Register elements = x3; | 3459 Register elements = x3; |
| 3464 __ Ldr(elements, FieldMemOperand(receiver, JSObject::kElementsOffset)); | 3460 __ Ldr(elements, FieldMemOperand(receiver, JSObject::kElementsOffset)); |
| 3465 | 3461 |
| 3466 Register key_raw = x4; | 3462 Register key_raw = x4; |
| 3467 __ SmiUntag(key_raw, key); | 3463 __ SmiUntag(key_raw, key); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3545 Label miss_force_generic, transition_elements_kind, grow, slow; | 3541 Label miss_force_generic, transition_elements_kind, grow, slow; |
| 3546 Label finish_store, check_capacity; | 3542 Label finish_store, check_capacity; |
| 3547 | 3543 |
| 3548 Register value = x0; | 3544 Register value = x0; |
| 3549 Register key = x1; | 3545 Register key = x1; |
| 3550 Register receiver = x2; | 3546 Register receiver = x2; |
| 3551 | 3547 |
| 3552 // This stub is meant to be tail-jumped to, the receiver must already | 3548 // This stub is meant to be tail-jumped to, the receiver must already |
| 3553 // have been verified by the caller to not be a smi. | 3549 // have been verified by the caller to not be a smi. |
| 3554 if (__ emit_debug_code()) { | 3550 if (__ emit_debug_code()) { |
| 3555 Label ok; | 3551 __ AssertNotSmi(receiver); |
| 3556 __ JumpIfNotSmi(receiver, &ok); | |
| 3557 __ Abort("GenerateStoreFastSmiOrDoubleElement: receiver is a SMI\n"); | |
| 3558 __ Bind(&ok); | |
| 3559 } | 3552 } |
| 3560 | 3553 |
| 3561 // Check that the key is a smi or a heap number convertible to a smi. | 3554 // Check that the key is a smi or a heap number convertible to a smi. |
| 3562 GenerateSmiKeyCheck(masm, key, x10, d16, d17, &miss_force_generic); | 3555 GenerateSmiKeyCheck(masm, key, x10, d16, d17, &miss_force_generic); |
| 3563 | 3556 |
| 3564 if (!store_double && IsFastSmiElementsKind(elements_kind)) { | 3557 if (!store_double && IsFastSmiElementsKind(elements_kind)) { |
| 3565 __ JumpIfNotSmi(value, &transition_elements_kind); | 3558 __ JumpIfNotSmi(value, &transition_elements_kind); |
| 3566 } | 3559 } |
| 3567 | 3560 |
| 3568 Register elements = x3; | 3561 Register elements = x3; |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3640 // Check that 'elements' and 'length' are pre-loaded. | 3633 // Check that 'elements' and 'length' are pre-loaded. |
| 3641 __ Ldr(x10, FieldMemOperand(receiver, JSObject::kElementsOffset)); | 3634 __ Ldr(x10, FieldMemOperand(receiver, JSObject::kElementsOffset)); |
| 3642 __ Cmp(x10, x3); | 3635 __ Cmp(x10, x3); |
| 3643 __ Ldr(x11, FieldMemOperand(receiver, JSArray::kLengthOffset)); | 3636 __ Ldr(x11, FieldMemOperand(receiver, JSArray::kLengthOffset)); |
| 3644 __ Ccmp(x11, x4, NoFlag, eq); | 3637 __ Ccmp(x11, x4, NoFlag, eq); |
| 3645 | 3638 |
| 3646 // Check that the key is equal to length, so we need to extend the array | 3639 // Check that the key is equal to length, so we need to extend the array |
| 3647 // by one element. | 3640 // by one element. |
| 3648 __ Ccmp(x1, x4, NoFlag, eq); | 3641 __ Ccmp(x1, x4, NoFlag, eq); |
| 3649 | 3642 |
| 3650 __ Check(eq, "GenerateStoreFastSmiOrDoubleElement [grow]: " | 3643 __ Check(eq, kPreconditionsWereNotMet); |
| 3651 "Preconditions were not met."); | |
| 3652 } | 3644 } |
| 3653 | 3645 |
| 3654 __ JumpIfNotRoot(elements, Heap::kEmptyFixedArrayRootIndex, | 3646 __ JumpIfNotRoot(elements, Heap::kEmptyFixedArrayRootIndex, |
| 3655 &check_capacity); | 3647 &check_capacity); |
| 3656 | 3648 |
| 3657 // The array is currently empty, so allocate a new backing store. | 3649 // The array is currently empty, so allocate a new backing store. |
| 3658 int size = FixedArray::SizeFor(JSArray::kPreallocatedArrayElements); | 3650 int size = FixedArray::SizeFor(JSArray::kPreallocatedArrayElements); |
| 3659 __ Allocate(size, elements, x10, x11, &slow, TAG_OBJECT); | 3651 __ Allocate(size, elements, x10, x11, &slow, TAG_OBJECT); |
| 3660 Heap::RootListIndex root_index = store_double | 3652 Heap::RootListIndex root_index = store_double |
| 3661 ? Heap::kFixedDoubleArrayMapRootIndex | 3653 ? Heap::kFixedDoubleArrayMapRootIndex |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3759 // ----------- S t a t e ------------- | 3751 // ----------- S t a t e ------------- |
| 3760 | 3752 |
| 3761 GenerateStoreFastSmiOrDoubleElement(masm, is_js_array, FAST_DOUBLE_ELEMENTS, | 3753 GenerateStoreFastSmiOrDoubleElement(masm, is_js_array, FAST_DOUBLE_ELEMENTS, |
| 3762 store_mode, true); | 3754 store_mode, true); |
| 3763 } | 3755 } |
| 3764 | 3756 |
| 3765 | 3757 |
| 3766 } } // namespace v8::internal | 3758 } } // namespace v8::internal |
| 3767 | 3759 |
| 3768 #endif // V8_TARGET_ARCH_A64 | 3760 #endif // V8_TARGET_ARCH_A64 |
| OLD | NEW |