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 3821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3832 // Check for the empty array, and preallocate a small backing store if | 3832 // Check for the empty array, and preallocate a small backing store if |
3833 // possible. | 3833 // possible. |
3834 __ ldr(length_reg, | 3834 __ ldr(length_reg, |
3835 FieldMemOperand(receiver_reg, JSArray::kLengthOffset)); | 3835 FieldMemOperand(receiver_reg, JSArray::kLengthOffset)); |
3836 __ ldr(elements_reg, | 3836 __ ldr(elements_reg, |
3837 FieldMemOperand(receiver_reg, JSObject::kElementsOffset)); | 3837 FieldMemOperand(receiver_reg, JSObject::kElementsOffset)); |
3838 __ CompareRoot(elements_reg, Heap::kEmptyFixedArrayRootIndex); | 3838 __ CompareRoot(elements_reg, Heap::kEmptyFixedArrayRootIndex); |
3839 __ b(ne, &check_capacity); | 3839 __ b(ne, &check_capacity); |
3840 | 3840 |
3841 int size = FixedArray::SizeFor(JSArray::kPreallocatedArrayElements); | 3841 int size = FixedArray::SizeFor(JSArray::kPreallocatedArrayElements); |
3842 __ AllocateInNewSpace(size, elements_reg, scratch, scratch2, &slow, | 3842 __ Allocate(size, elements_reg, scratch, scratch2, &slow, TAG_OBJECT, |
3843 TAG_OBJECT); | 3843 MacroAssembler::NEW_SPACE); |
3844 | 3844 |
3845 __ LoadRoot(scratch, Heap::kFixedArrayMapRootIndex); | 3845 __ LoadRoot(scratch, Heap::kFixedArrayMapRootIndex); |
3846 __ str(scratch, FieldMemOperand(elements_reg, JSObject::kMapOffset)); | 3846 __ str(scratch, FieldMemOperand(elements_reg, JSObject::kMapOffset)); |
3847 __ mov(scratch, Operand(Smi::FromInt(JSArray::kPreallocatedArrayElements))); | 3847 __ mov(scratch, Operand(Smi::FromInt(JSArray::kPreallocatedArrayElements))); |
3848 __ str(scratch, FieldMemOperand(elements_reg, FixedArray::kLengthOffset)); | 3848 __ str(scratch, FieldMemOperand(elements_reg, FixedArray::kLengthOffset)); |
3849 __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex); | 3849 __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex); |
3850 for (int i = 1; i < JSArray::kPreallocatedArrayElements; ++i) { | 3850 for (int i = 1; i < JSArray::kPreallocatedArrayElements; ++i) { |
3851 __ str(scratch, FieldMemOperand(elements_reg, FixedArray::SizeFor(i))); | 3851 __ str(scratch, FieldMemOperand(elements_reg, FixedArray::SizeFor(i))); |
3852 } | 3852 } |
3853 | 3853 |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3986 // Check for the empty array, and preallocate a small backing store if | 3986 // Check for the empty array, and preallocate a small backing store if |
3987 // possible. | 3987 // possible. |
3988 __ ldr(length_reg, | 3988 __ ldr(length_reg, |
3989 FieldMemOperand(receiver_reg, JSArray::kLengthOffset)); | 3989 FieldMemOperand(receiver_reg, JSArray::kLengthOffset)); |
3990 __ ldr(elements_reg, | 3990 __ ldr(elements_reg, |
3991 FieldMemOperand(receiver_reg, JSObject::kElementsOffset)); | 3991 FieldMemOperand(receiver_reg, JSObject::kElementsOffset)); |
3992 __ CompareRoot(elements_reg, Heap::kEmptyFixedArrayRootIndex); | 3992 __ CompareRoot(elements_reg, Heap::kEmptyFixedArrayRootIndex); |
3993 __ b(ne, &check_capacity); | 3993 __ b(ne, &check_capacity); |
3994 | 3994 |
3995 int size = FixedDoubleArray::SizeFor(JSArray::kPreallocatedArrayElements); | 3995 int size = FixedDoubleArray::SizeFor(JSArray::kPreallocatedArrayElements); |
3996 __ AllocateInNewSpace(size, elements_reg, scratch1, scratch2, &slow, | 3996 __ Allocate(size, elements_reg, scratch1, scratch2, &slow, TAG_OBJECT, |
3997 TAG_OBJECT); | 3997 MacroAssembler::NEW_SPACE); |
3998 | 3998 |
3999 // Initialize the new FixedDoubleArray. | 3999 // Initialize the new FixedDoubleArray. |
4000 __ LoadRoot(scratch1, Heap::kFixedDoubleArrayMapRootIndex); | 4000 __ LoadRoot(scratch1, Heap::kFixedDoubleArrayMapRootIndex); |
4001 __ str(scratch1, FieldMemOperand(elements_reg, JSObject::kMapOffset)); | 4001 __ str(scratch1, FieldMemOperand(elements_reg, JSObject::kMapOffset)); |
4002 __ mov(scratch1, | 4002 __ mov(scratch1, |
4003 Operand(Smi::FromInt(JSArray::kPreallocatedArrayElements))); | 4003 Operand(Smi::FromInt(JSArray::kPreallocatedArrayElements))); |
4004 __ str(scratch1, | 4004 __ str(scratch1, |
4005 FieldMemOperand(elements_reg, FixedDoubleArray::kLengthOffset)); | 4005 FieldMemOperand(elements_reg, FixedDoubleArray::kLengthOffset)); |
4006 | 4006 |
4007 __ mov(scratch1, elements_reg); | 4007 __ mov(scratch1, elements_reg); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4054 __ Jump(ic_slow, RelocInfo::CODE_TARGET); | 4054 __ Jump(ic_slow, RelocInfo::CODE_TARGET); |
4055 } | 4055 } |
4056 } | 4056 } |
4057 | 4057 |
4058 | 4058 |
4059 #undef __ | 4059 #undef __ |
4060 | 4060 |
4061 } } // namespace v8::internal | 4061 } } // namespace v8::internal |
4062 | 4062 |
4063 #endif // V8_TARGET_ARCH_ARM | 4063 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |