| 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 4508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4519 | 4519 |
| 4520 // Fall back to runtime if the target differs from the new target's | 4520 // Fall back to runtime if the target differs from the new target's |
| 4521 // initial map constructor. | 4521 // initial map constructor. |
| 4522 __ ld(a0, FieldMemOperand(a2, Map::kConstructorOrBackPointerOffset)); | 4522 __ ld(a0, FieldMemOperand(a2, Map::kConstructorOrBackPointerOffset)); |
| 4523 __ Branch(&new_object, ne, a0, Operand(a1)); | 4523 __ Branch(&new_object, ne, a0, Operand(a1)); |
| 4524 | 4524 |
| 4525 // Allocate the JSObject on the heap. | 4525 // Allocate the JSObject on the heap. |
| 4526 Label allocate, done_allocate; | 4526 Label allocate, done_allocate; |
| 4527 __ lbu(a4, FieldMemOperand(a2, Map::kInstanceSizeOffset)); | 4527 __ lbu(a4, FieldMemOperand(a2, Map::kInstanceSizeOffset)); |
| 4528 __ Allocate(a4, v0, a5, a0, &allocate, SIZE_IN_WORDS); | 4528 __ Allocate(a4, v0, a5, a0, &allocate, SIZE_IN_WORDS); |
| 4529 __ Dsubu(a5, a5, Operand(kHeapObjectTag)); // Untag result end |
| 4529 __ bind(&done_allocate); | 4530 __ bind(&done_allocate); |
| 4530 | 4531 |
| 4531 // Initialize the JSObject fields. | 4532 // Initialize the JSObject fields. |
| 4532 __ sd(a2, FieldMemOperand(v0, JSObject::kMapOffset)); | 4533 __ sd(a2, FieldMemOperand(v0, JSObject::kMapOffset)); |
| 4533 __ LoadRoot(a3, Heap::kEmptyFixedArrayRootIndex); | 4534 __ LoadRoot(a3, Heap::kEmptyFixedArrayRootIndex); |
| 4534 __ sd(a3, FieldMemOperand(v0, JSObject::kPropertiesOffset)); | 4535 __ sd(a3, FieldMemOperand(v0, JSObject::kPropertiesOffset)); |
| 4535 __ sd(a3, FieldMemOperand(v0, JSObject::kElementsOffset)); | 4536 __ sd(a3, FieldMemOperand(v0, JSObject::kElementsOffset)); |
| 4536 STATIC_ASSERT(JSObject::kHeaderSize == 3 * kPointerSize); | 4537 STATIC_ASSERT(JSObject::kHeaderSize == 3 * kPointerSize); |
| 4537 __ Daddu(a1, v0, Operand(JSObject::kHeaderSize - kHeapObjectTag)); | 4538 __ Daddu(a1, v0, Operand(JSObject::kHeaderSize - kHeapObjectTag)); |
| 4538 | 4539 |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4664 __ bind(&no_rest_parameters); | 4665 __ bind(&no_rest_parameters); |
| 4665 { | 4666 { |
| 4666 // ----------- S t a t e ------------- | 4667 // ----------- S t a t e ------------- |
| 4667 // -- cp : context | 4668 // -- cp : context |
| 4668 // -- ra : return address | 4669 // -- ra : return address |
| 4669 // ----------------------------------- | 4670 // ----------------------------------- |
| 4670 | 4671 |
| 4671 // Allocate an empty rest parameter array. | 4672 // Allocate an empty rest parameter array. |
| 4672 Label allocate, done_allocate; | 4673 Label allocate, done_allocate; |
| 4673 __ Allocate(JSArray::kSize, v0, a0, a1, &allocate, NO_ALLOCATION_FLAGS); | 4674 __ Allocate(JSArray::kSize, v0, a0, a1, &allocate, NO_ALLOCATION_FLAGS); |
| 4675 __ Dsubu(a0, a0, Operand(kHeapObjectTag)); // Untag result end. |
| 4674 __ bind(&done_allocate); | 4676 __ bind(&done_allocate); |
| 4675 | 4677 |
| 4676 // Setup the rest parameter array in v0. | 4678 // Setup the rest parameter array in v0. |
| 4677 __ LoadNativeContextSlot(Context::JS_ARRAY_FAST_ELEMENTS_MAP_INDEX, a1); | 4679 __ LoadNativeContextSlot(Context::JS_ARRAY_FAST_ELEMENTS_MAP_INDEX, a1); |
| 4678 __ sd(a1, FieldMemOperand(v0, JSArray::kMapOffset)); | 4680 __ sd(a1, FieldMemOperand(v0, JSArray::kMapOffset)); |
| 4679 __ LoadRoot(a1, Heap::kEmptyFixedArrayRootIndex); | 4681 __ LoadRoot(a1, Heap::kEmptyFixedArrayRootIndex); |
| 4680 __ sd(a1, FieldMemOperand(v0, JSArray::kPropertiesOffset)); | 4682 __ sd(a1, FieldMemOperand(v0, JSArray::kPropertiesOffset)); |
| 4681 __ sd(a1, FieldMemOperand(v0, JSArray::kElementsOffset)); | 4683 __ sd(a1, FieldMemOperand(v0, JSArray::kElementsOffset)); |
| 4682 __ Move(a1, Smi::FromInt(0)); | 4684 __ Move(a1, Smi::FromInt(0)); |
| 4683 __ Ret(USE_DELAY_SLOT); | 4685 __ Ret(USE_DELAY_SLOT); |
| (...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5580 kStackUnwindSpace, kInvalidStackOffset, | 5582 kStackUnwindSpace, kInvalidStackOffset, |
| 5581 return_value_operand, NULL); | 5583 return_value_operand, NULL); |
| 5582 } | 5584 } |
| 5583 | 5585 |
| 5584 #undef __ | 5586 #undef __ |
| 5585 | 5587 |
| 5586 } // namespace internal | 5588 } // namespace internal |
| 5587 } // namespace v8 | 5589 } // namespace v8 |
| 5588 | 5590 |
| 5589 #endif // V8_TARGET_ARCH_MIPS64 | 5591 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |