OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_ARM | 5 #if V8_TARGET_ARCH_ARM |
6 | 6 |
7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/api-arguments.h" | 8 #include "src/api-arguments.h" |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 4315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4326 // Fall back to runtime if the target differs from the new target's | 4326 // Fall back to runtime if the target differs from the new target's |
4327 // initial map constructor. | 4327 // initial map constructor. |
4328 __ ldr(r0, FieldMemOperand(r2, Map::kConstructorOrBackPointerOffset)); | 4328 __ ldr(r0, FieldMemOperand(r2, Map::kConstructorOrBackPointerOffset)); |
4329 __ cmp(r0, r1); | 4329 __ cmp(r0, r1); |
4330 __ b(ne, &new_object); | 4330 __ b(ne, &new_object); |
4331 | 4331 |
4332 // Allocate the JSObject on the heap. | 4332 // Allocate the JSObject on the heap. |
4333 Label allocate, done_allocate; | 4333 Label allocate, done_allocate; |
4334 __ ldrb(r4, FieldMemOperand(r2, Map::kInstanceSizeOffset)); | 4334 __ ldrb(r4, FieldMemOperand(r2, Map::kInstanceSizeOffset)); |
4335 __ Allocate(r4, r0, r5, r6, &allocate, SIZE_IN_WORDS); | 4335 __ Allocate(r4, r0, r5, r6, &allocate, SIZE_IN_WORDS); |
| 4336 __ sub(r5, r5, Operand(kHeapObjectTag)); // Untag result end. |
4336 __ bind(&done_allocate); | 4337 __ bind(&done_allocate); |
4337 | 4338 |
4338 // Initialize the JSObject fields. | 4339 // Initialize the JSObject fields. |
4339 __ str(r2, FieldMemOperand(r0, JSObject::kMapOffset)); | 4340 __ str(r2, FieldMemOperand(r0, JSObject::kMapOffset)); |
4340 __ LoadRoot(r3, Heap::kEmptyFixedArrayRootIndex); | 4341 __ LoadRoot(r3, Heap::kEmptyFixedArrayRootIndex); |
4341 __ str(r3, FieldMemOperand(r0, JSObject::kPropertiesOffset)); | 4342 __ str(r3, FieldMemOperand(r0, JSObject::kPropertiesOffset)); |
4342 __ str(r3, FieldMemOperand(r0, JSObject::kElementsOffset)); | 4343 __ str(r3, FieldMemOperand(r0, JSObject::kElementsOffset)); |
4343 STATIC_ASSERT(JSObject::kHeaderSize == 3 * kPointerSize); | 4344 STATIC_ASSERT(JSObject::kHeaderSize == 3 * kPointerSize); |
4344 __ add(r1, r0, Operand(JSObject::kHeaderSize - kHeapObjectTag)); | 4345 __ add(r1, r0, Operand(JSObject::kHeaderSize - kHeapObjectTag)); |
4345 | 4346 |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4466 __ bind(&no_rest_parameters); | 4467 __ bind(&no_rest_parameters); |
4467 { | 4468 { |
4468 // ----------- S t a t e ------------- | 4469 // ----------- S t a t e ------------- |
4469 // -- cp : context | 4470 // -- cp : context |
4470 // -- lr : return address | 4471 // -- lr : return address |
4471 // ----------------------------------- | 4472 // ----------------------------------- |
4472 | 4473 |
4473 // Allocate an empty rest parameter array. | 4474 // Allocate an empty rest parameter array. |
4474 Label allocate, done_allocate; | 4475 Label allocate, done_allocate; |
4475 __ Allocate(JSArray::kSize, r0, r1, r2, &allocate, NO_ALLOCATION_FLAGS); | 4476 __ Allocate(JSArray::kSize, r0, r1, r2, &allocate, NO_ALLOCATION_FLAGS); |
| 4477 __ sub(r1, r1, Operand(kHeapObjectTag)); // Untag result end. |
4476 __ bind(&done_allocate); | 4478 __ bind(&done_allocate); |
4477 | 4479 |
4478 // Setup the rest parameter array in r0. | 4480 // Setup the rest parameter array in r0. |
4479 __ LoadNativeContextSlot(Context::JS_ARRAY_FAST_ELEMENTS_MAP_INDEX, r1); | 4481 __ LoadNativeContextSlot(Context::JS_ARRAY_FAST_ELEMENTS_MAP_INDEX, r1); |
4480 __ str(r1, FieldMemOperand(r0, JSArray::kMapOffset)); | 4482 __ str(r1, FieldMemOperand(r0, JSArray::kMapOffset)); |
4481 __ LoadRoot(r1, Heap::kEmptyFixedArrayRootIndex); | 4483 __ LoadRoot(r1, Heap::kEmptyFixedArrayRootIndex); |
4482 __ str(r1, FieldMemOperand(r0, JSArray::kPropertiesOffset)); | 4484 __ str(r1, FieldMemOperand(r0, JSArray::kPropertiesOffset)); |
4483 __ str(r1, FieldMemOperand(r0, JSArray::kElementsOffset)); | 4485 __ str(r1, FieldMemOperand(r0, JSArray::kElementsOffset)); |
4484 __ mov(r1, Operand(0)); | 4486 __ mov(r1, Operand(0)); |
4485 __ str(r1, FieldMemOperand(r0, JSArray::kLengthOffset)); | 4487 __ str(r1, FieldMemOperand(r0, JSArray::kLengthOffset)); |
(...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5366 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 5368 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
5367 kStackUnwindSpace, NULL, return_value_operand, NULL); | 5369 kStackUnwindSpace, NULL, return_value_operand, NULL); |
5368 } | 5370 } |
5369 | 5371 |
5370 #undef __ | 5372 #undef __ |
5371 | 5373 |
5372 } // namespace internal | 5374 } // namespace internal |
5373 } // namespace v8 | 5375 } // namespace v8 |
5374 | 5376 |
5375 #endif // V8_TARGET_ARCH_ARM | 5377 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |