OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
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/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 4574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4585 | 4585 |
4586 // Fall back to runtime if the target differs from the new target's | 4586 // Fall back to runtime if the target differs from the new target's |
4587 // initial map constructor. | 4587 // initial map constructor. |
4588 __ Ldr(x0, FieldMemOperand(x2, Map::kConstructorOrBackPointerOffset)); | 4588 __ Ldr(x0, FieldMemOperand(x2, Map::kConstructorOrBackPointerOffset)); |
4589 __ CompareAndBranch(x0, x1, ne, &new_object); | 4589 __ CompareAndBranch(x0, x1, ne, &new_object); |
4590 | 4590 |
4591 // Allocate the JSObject on the heap. | 4591 // Allocate the JSObject on the heap. |
4592 Label allocate, done_allocate; | 4592 Label allocate, done_allocate; |
4593 __ Ldrb(x4, FieldMemOperand(x2, Map::kInstanceSizeOffset)); | 4593 __ Ldrb(x4, FieldMemOperand(x2, Map::kInstanceSizeOffset)); |
4594 __ Allocate(x4, x0, x5, x6, &allocate, SIZE_IN_WORDS); | 4594 __ Allocate(x4, x0, x5, x6, &allocate, SIZE_IN_WORDS); |
| 4595 __ Sub(x5, x5, Operand(kHeapObjectTag)); // Untag result end. |
4595 __ Bind(&done_allocate); | 4596 __ Bind(&done_allocate); |
4596 | 4597 |
4597 // Initialize the JSObject fields. | 4598 // Initialize the JSObject fields. |
4598 STATIC_ASSERT(JSObject::kMapOffset == 0 * kPointerSize); | 4599 STATIC_ASSERT(JSObject::kMapOffset == 0 * kPointerSize); |
4599 __ Str(x2, FieldMemOperand(x0, JSObject::kMapOffset)); | 4600 __ Str(x2, FieldMemOperand(x0, JSObject::kMapOffset)); |
4600 __ LoadRoot(x3, Heap::kEmptyFixedArrayRootIndex); | 4601 __ LoadRoot(x3, Heap::kEmptyFixedArrayRootIndex); |
4601 STATIC_ASSERT(JSObject::kPropertiesOffset == 1 * kPointerSize); | 4602 STATIC_ASSERT(JSObject::kPropertiesOffset == 1 * kPointerSize); |
4602 STATIC_ASSERT(JSObject::kElementsOffset == 2 * kPointerSize); | 4603 STATIC_ASSERT(JSObject::kElementsOffset == 2 * kPointerSize); |
4603 __ Str(x3, FieldMemOperand(x0, JSObject::kPropertiesOffset)); | 4604 __ Str(x3, FieldMemOperand(x0, JSObject::kPropertiesOffset)); |
4604 __ Str(x3, FieldMemOperand(x0, JSObject::kElementsOffset)); | 4605 __ Str(x3, FieldMemOperand(x0, JSObject::kElementsOffset)); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4732 __ Bind(&no_rest_parameters); | 4733 __ Bind(&no_rest_parameters); |
4733 { | 4734 { |
4734 // ----------- S t a t e ------------- | 4735 // ----------- S t a t e ------------- |
4735 // -- cp : context | 4736 // -- cp : context |
4736 // -- lr : return address | 4737 // -- lr : return address |
4737 // ----------------------------------- | 4738 // ----------------------------------- |
4738 | 4739 |
4739 // Allocate an empty rest parameter array. | 4740 // Allocate an empty rest parameter array. |
4740 Label allocate, done_allocate; | 4741 Label allocate, done_allocate; |
4741 __ Allocate(JSArray::kSize, x0, x1, x2, &allocate, NO_ALLOCATION_FLAGS); | 4742 __ Allocate(JSArray::kSize, x0, x1, x2, &allocate, NO_ALLOCATION_FLAGS); |
| 4743 __ Sub(x1, x1, Operand(kHeapObjectTag)); // Untag result end. |
4742 __ Bind(&done_allocate); | 4744 __ Bind(&done_allocate); |
4743 | 4745 |
4744 // Setup the rest parameter array in x0. | 4746 // Setup the rest parameter array in x0. |
4745 __ LoadNativeContextSlot(Context::JS_ARRAY_FAST_ELEMENTS_MAP_INDEX, x1); | 4747 __ LoadNativeContextSlot(Context::JS_ARRAY_FAST_ELEMENTS_MAP_INDEX, x1); |
4746 __ Str(x1, FieldMemOperand(x0, JSArray::kMapOffset)); | 4748 __ Str(x1, FieldMemOperand(x0, JSArray::kMapOffset)); |
4747 __ LoadRoot(x1, Heap::kEmptyFixedArrayRootIndex); | 4749 __ LoadRoot(x1, Heap::kEmptyFixedArrayRootIndex); |
4748 __ Str(x1, FieldMemOperand(x0, JSArray::kPropertiesOffset)); | 4750 __ Str(x1, FieldMemOperand(x0, JSArray::kPropertiesOffset)); |
4749 __ Str(x1, FieldMemOperand(x0, JSArray::kElementsOffset)); | 4751 __ Str(x1, FieldMemOperand(x0, JSArray::kElementsOffset)); |
4750 __ Mov(x1, Smi::FromInt(0)); | 4752 __ Mov(x1, Smi::FromInt(0)); |
4751 __ Str(x1, FieldMemOperand(x0, JSArray::kLengthOffset)); | 4753 __ Str(x1, FieldMemOperand(x0, JSArray::kLengthOffset)); |
(...skipping 997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5749 kStackUnwindSpace, NULL, spill_offset, | 5751 kStackUnwindSpace, NULL, spill_offset, |
5750 return_value_operand, NULL); | 5752 return_value_operand, NULL); |
5751 } | 5753 } |
5752 | 5754 |
5753 #undef __ | 5755 #undef __ |
5754 | 5756 |
5755 } // namespace internal | 5757 } // namespace internal |
5756 } // namespace v8 | 5758 } // namespace v8 |
5757 | 5759 |
5758 #endif // V8_TARGET_ARCH_ARM64 | 5760 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |