| 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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
| 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 4605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4616 | 4616 |
| 4617 // Fall back to runtime if the target differs from the new target's | 4617 // Fall back to runtime if the target differs from the new target's |
| 4618 // initial map constructor. | 4618 // initial map constructor. |
| 4619 __ ld(a0, FieldMemOperand(a2, Map::kConstructorOrBackPointerOffset)); | 4619 __ ld(a0, FieldMemOperand(a2, Map::kConstructorOrBackPointerOffset)); |
| 4620 __ Branch(&new_object, ne, a0, Operand(a1)); | 4620 __ Branch(&new_object, ne, a0, Operand(a1)); |
| 4621 | 4621 |
| 4622 // Allocate the JSObject on the heap. | 4622 // Allocate the JSObject on the heap. |
| 4623 Label allocate, done_allocate; | 4623 Label allocate, done_allocate; |
| 4624 __ lbu(a4, FieldMemOperand(a2, Map::kInstanceSizeOffset)); | 4624 __ lbu(a4, FieldMemOperand(a2, Map::kInstanceSizeOffset)); |
| 4625 __ Allocate(a4, v0, a5, a0, &allocate, SIZE_IN_WORDS); | 4625 __ Allocate(a4, v0, a5, a0, &allocate, SIZE_IN_WORDS); |
| 4626 __ Dsubu(a5, a5, Operand(kHeapObjectTag)); // Untag result end | |
| 4627 __ bind(&done_allocate); | 4626 __ bind(&done_allocate); |
| 4628 | 4627 |
| 4629 // Initialize the JSObject fields. | 4628 // Initialize the JSObject fields. |
| 4630 __ sd(a2, FieldMemOperand(v0, JSObject::kMapOffset)); | 4629 __ sd(a2, FieldMemOperand(v0, JSObject::kMapOffset)); |
| 4631 __ LoadRoot(a3, Heap::kEmptyFixedArrayRootIndex); | 4630 __ LoadRoot(a3, Heap::kEmptyFixedArrayRootIndex); |
| 4632 __ sd(a3, FieldMemOperand(v0, JSObject::kPropertiesOffset)); | 4631 __ sd(a3, FieldMemOperand(v0, JSObject::kPropertiesOffset)); |
| 4633 __ sd(a3, FieldMemOperand(v0, JSObject::kElementsOffset)); | 4632 __ sd(a3, FieldMemOperand(v0, JSObject::kElementsOffset)); |
| 4634 STATIC_ASSERT(JSObject::kHeaderSize == 3 * kPointerSize); | 4633 STATIC_ASSERT(JSObject::kHeaderSize == 3 * kPointerSize); |
| 4635 __ Daddu(a1, v0, Operand(JSObject::kHeaderSize - kHeapObjectTag)); | 4634 __ Daddu(a1, v0, Operand(JSObject::kHeaderSize - kHeapObjectTag)); |
| 4636 | 4635 |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4762 __ bind(&no_rest_parameters); | 4761 __ bind(&no_rest_parameters); |
| 4763 { | 4762 { |
| 4764 // ----------- S t a t e ------------- | 4763 // ----------- S t a t e ------------- |
| 4765 // -- cp : context | 4764 // -- cp : context |
| 4766 // -- ra : return address | 4765 // -- ra : return address |
| 4767 // ----------------------------------- | 4766 // ----------------------------------- |
| 4768 | 4767 |
| 4769 // Allocate an empty rest parameter array. | 4768 // Allocate an empty rest parameter array. |
| 4770 Label allocate, done_allocate; | 4769 Label allocate, done_allocate; |
| 4771 __ Allocate(JSArray::kSize, v0, a0, a1, &allocate, NO_ALLOCATION_FLAGS); | 4770 __ Allocate(JSArray::kSize, v0, a0, a1, &allocate, NO_ALLOCATION_FLAGS); |
| 4772 __ Dsubu(a0, a0, Operand(kHeapObjectTag)); // Untag result end. | |
| 4773 __ bind(&done_allocate); | 4771 __ bind(&done_allocate); |
| 4774 | 4772 |
| 4775 // Setup the rest parameter array in v0. | 4773 // Setup the rest parameter array in v0. |
| 4776 __ LoadNativeContextSlot(Context::JS_ARRAY_FAST_ELEMENTS_MAP_INDEX, a1); | 4774 __ LoadNativeContextSlot(Context::JS_ARRAY_FAST_ELEMENTS_MAP_INDEX, a1); |
| 4777 __ sd(a1, FieldMemOperand(v0, JSArray::kMapOffset)); | 4775 __ sd(a1, FieldMemOperand(v0, JSArray::kMapOffset)); |
| 4778 __ LoadRoot(a1, Heap::kEmptyFixedArrayRootIndex); | 4776 __ LoadRoot(a1, Heap::kEmptyFixedArrayRootIndex); |
| 4779 __ sd(a1, FieldMemOperand(v0, JSArray::kPropertiesOffset)); | 4777 __ sd(a1, FieldMemOperand(v0, JSArray::kPropertiesOffset)); |
| 4780 __ sd(a1, FieldMemOperand(v0, JSArray::kElementsOffset)); | 4778 __ sd(a1, FieldMemOperand(v0, JSArray::kElementsOffset)); |
| 4781 __ Move(a1, Smi::FromInt(0)); | 4779 __ Move(a1, Smi::FromInt(0)); |
| 4782 __ Ret(USE_DELAY_SLOT); | 4780 __ Ret(USE_DELAY_SLOT); |
| (...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5661 kStackUnwindSpace, kInvalidStackOffset, | 5659 kStackUnwindSpace, kInvalidStackOffset, |
| 5662 return_value_operand, NULL); | 5660 return_value_operand, NULL); |
| 5663 } | 5661 } |
| 5664 | 5662 |
| 5665 #undef __ | 5663 #undef __ |
| 5666 | 5664 |
| 5667 } // namespace internal | 5665 } // namespace internal |
| 5668 } // namespace v8 | 5666 } // namespace v8 |
| 5669 | 5667 |
| 5670 #endif // V8_TARGET_ARCH_MIPS64 | 5668 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |