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 3815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3826 // Check for the empty array, and preallocate a small backing store if | 3826 // Check for the empty array, and preallocate a small backing store if |
3827 // possible. | 3827 // possible. |
3828 __ ldr(length_reg, | 3828 __ ldr(length_reg, |
3829 FieldMemOperand(receiver_reg, JSArray::kLengthOffset)); | 3829 FieldMemOperand(receiver_reg, JSArray::kLengthOffset)); |
3830 __ ldr(elements_reg, | 3830 __ ldr(elements_reg, |
3831 FieldMemOperand(receiver_reg, JSObject::kElementsOffset)); | 3831 FieldMemOperand(receiver_reg, JSObject::kElementsOffset)); |
3832 __ CompareRoot(elements_reg, Heap::kEmptyFixedArrayRootIndex); | 3832 __ CompareRoot(elements_reg, Heap::kEmptyFixedArrayRootIndex); |
3833 __ b(ne, &check_capacity); | 3833 __ b(ne, &check_capacity); |
3834 | 3834 |
3835 int size = FixedArray::SizeFor(JSArray::kPreallocatedArrayElements); | 3835 int size = FixedArray::SizeFor(JSArray::kPreallocatedArrayElements); |
3836 __ AllocateInNewSpace(size, elements_reg, scratch, scratch2, &slow, | 3836 __ Allocate(size, elements_reg, scratch, scratch2, &slow, TAG_OBJECT); |
3837 TAG_OBJECT); | |
3838 | 3837 |
3839 __ LoadRoot(scratch, Heap::kFixedArrayMapRootIndex); | 3838 __ LoadRoot(scratch, Heap::kFixedArrayMapRootIndex); |
3840 __ str(scratch, FieldMemOperand(elements_reg, JSObject::kMapOffset)); | 3839 __ str(scratch, FieldMemOperand(elements_reg, JSObject::kMapOffset)); |
3841 __ mov(scratch, Operand(Smi::FromInt(JSArray::kPreallocatedArrayElements))); | 3840 __ mov(scratch, Operand(Smi::FromInt(JSArray::kPreallocatedArrayElements))); |
3842 __ str(scratch, FieldMemOperand(elements_reg, FixedArray::kLengthOffset)); | 3841 __ str(scratch, FieldMemOperand(elements_reg, FixedArray::kLengthOffset)); |
3843 __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex); | 3842 __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex); |
3844 for (int i = 1; i < JSArray::kPreallocatedArrayElements; ++i) { | 3843 for (int i = 1; i < JSArray::kPreallocatedArrayElements; ++i) { |
3845 __ str(scratch, FieldMemOperand(elements_reg, FixedArray::SizeFor(i))); | 3844 __ str(scratch, FieldMemOperand(elements_reg, FixedArray::SizeFor(i))); |
3846 } | 3845 } |
3847 | 3846 |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3980 // Check for the empty array, and preallocate a small backing store if | 3979 // Check for the empty array, and preallocate a small backing store if |
3981 // possible. | 3980 // possible. |
3982 __ ldr(length_reg, | 3981 __ ldr(length_reg, |
3983 FieldMemOperand(receiver_reg, JSArray::kLengthOffset)); | 3982 FieldMemOperand(receiver_reg, JSArray::kLengthOffset)); |
3984 __ ldr(elements_reg, | 3983 __ ldr(elements_reg, |
3985 FieldMemOperand(receiver_reg, JSObject::kElementsOffset)); | 3984 FieldMemOperand(receiver_reg, JSObject::kElementsOffset)); |
3986 __ CompareRoot(elements_reg, Heap::kEmptyFixedArrayRootIndex); | 3985 __ CompareRoot(elements_reg, Heap::kEmptyFixedArrayRootIndex); |
3987 __ b(ne, &check_capacity); | 3986 __ b(ne, &check_capacity); |
3988 | 3987 |
3989 int size = FixedDoubleArray::SizeFor(JSArray::kPreallocatedArrayElements); | 3988 int size = FixedDoubleArray::SizeFor(JSArray::kPreallocatedArrayElements); |
3990 __ AllocateInNewSpace(size, elements_reg, scratch1, scratch2, &slow, | 3989 __ Allocate(size, elements_reg, scratch1, scratch2, &slow, TAG_OBJECT); |
3991 TAG_OBJECT); | |
3992 | 3990 |
3993 // Initialize the new FixedDoubleArray. | 3991 // Initialize the new FixedDoubleArray. |
3994 __ LoadRoot(scratch1, Heap::kFixedDoubleArrayMapRootIndex); | 3992 __ LoadRoot(scratch1, Heap::kFixedDoubleArrayMapRootIndex); |
3995 __ str(scratch1, FieldMemOperand(elements_reg, JSObject::kMapOffset)); | 3993 __ str(scratch1, FieldMemOperand(elements_reg, JSObject::kMapOffset)); |
3996 __ mov(scratch1, | 3994 __ mov(scratch1, |
3997 Operand(Smi::FromInt(JSArray::kPreallocatedArrayElements))); | 3995 Operand(Smi::FromInt(JSArray::kPreallocatedArrayElements))); |
3998 __ str(scratch1, | 3996 __ str(scratch1, |
3999 FieldMemOperand(elements_reg, FixedDoubleArray::kLengthOffset)); | 3997 FieldMemOperand(elements_reg, FixedDoubleArray::kLengthOffset)); |
4000 | 3998 |
4001 __ mov(scratch1, elements_reg); | 3999 __ mov(scratch1, elements_reg); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4048 __ Jump(ic_slow, RelocInfo::CODE_TARGET); | 4046 __ Jump(ic_slow, RelocInfo::CODE_TARGET); |
4049 } | 4047 } |
4050 } | 4048 } |
4051 | 4049 |
4052 | 4050 |
4053 #undef __ | 4051 #undef __ |
4054 | 4052 |
4055 } } // namespace v8::internal | 4053 } } // namespace v8::internal |
4056 | 4054 |
4057 #endif // V8_TARGET_ARCH_ARM | 4055 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |