| 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 3786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3797 __ Move(FieldOperand(rdi, FixedDoubleArray::kLengthOffset), | 3797 __ Move(FieldOperand(rdi, FixedDoubleArray::kLengthOffset), |
| 3798 Smi::FromInt(JSArray::kPreallocatedArrayElements)); | 3798 Smi::FromInt(JSArray::kPreallocatedArrayElements)); |
| 3799 | 3799 |
| 3800 // Install the new backing store in the JSArray. | 3800 // Install the new backing store in the JSArray. |
| 3801 __ movq(FieldOperand(rdx, JSObject::kElementsOffset), rdi); | 3801 __ movq(FieldOperand(rdx, JSObject::kElementsOffset), rdi); |
| 3802 __ RecordWriteField(rdx, JSObject::kElementsOffset, rdi, rbx, | 3802 __ RecordWriteField(rdx, JSObject::kElementsOffset, rdi, rbx, |
| 3803 kDontSaveFPRegs, EMIT_REMEMBERED_SET, OMIT_SMI_CHECK); | 3803 kDontSaveFPRegs, EMIT_REMEMBERED_SET, OMIT_SMI_CHECK); |
| 3804 | 3804 |
| 3805 // Increment the length of the array. | 3805 // Increment the length of the array. |
| 3806 __ Move(FieldOperand(rdx, JSArray::kLengthOffset), Smi::FromInt(1)); | 3806 __ Move(FieldOperand(rdx, JSArray::kLengthOffset), Smi::FromInt(1)); |
| 3807 __ movq(rdi, FieldOperand(rdx, JSObject::kElementsOffset)); |
| 3807 __ jmp(&finish_store); | 3808 __ jmp(&finish_store); |
| 3808 | 3809 |
| 3809 __ bind(&check_capacity); | 3810 __ bind(&check_capacity); |
| 3810 // rax: value | 3811 // rax: value |
| 3811 // rcx: key | 3812 // rcx: key |
| 3812 // rdx: receiver | 3813 // rdx: receiver |
| 3813 // rdi: elements | 3814 // rdi: elements |
| 3814 // Make sure that the backing store can hold additional elements. | 3815 // Make sure that the backing store can hold additional elements. |
| 3815 __ cmpq(rcx, FieldOperand(rdi, FixedDoubleArray::kLengthOffset)); | 3816 __ cmpq(rcx, FieldOperand(rdi, FixedDoubleArray::kLengthOffset)); |
| 3816 __ j(above_equal, &slow); | 3817 __ j(above_equal, &slow); |
| 3817 | 3818 |
| 3818 // Grow the array and finish the store. | 3819 // Grow the array and finish the store. |
| 3819 __ SmiAddConstant(FieldOperand(rdx, JSArray::kLengthOffset), | 3820 __ SmiAddConstant(FieldOperand(rdx, JSArray::kLengthOffset), |
| 3820 Smi::FromInt(1)); | 3821 Smi::FromInt(1)); |
| 3821 __ jmp(&finish_store); | 3822 __ jmp(&finish_store); |
| 3822 | 3823 |
| 3823 __ bind(&slow); | 3824 __ bind(&slow); |
| 3824 Handle<Code> ic_slow = masm->isolate()->builtins()->KeyedStoreIC_Slow(); | 3825 Handle<Code> ic_slow = masm->isolate()->builtins()->KeyedStoreIC_Slow(); |
| 3825 __ jmp(ic_slow, RelocInfo::CODE_TARGET); | 3826 __ jmp(ic_slow, RelocInfo::CODE_TARGET); |
| 3826 } | 3827 } |
| 3827 } | 3828 } |
| 3828 | 3829 |
| 3829 | 3830 |
| 3830 #undef __ | 3831 #undef __ |
| 3831 | 3832 |
| 3832 } } // namespace v8::internal | 3833 } } // namespace v8::internal |
| 3833 | 3834 |
| 3834 #endif // V8_TARGET_ARCH_X64 | 3835 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |