| 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 | 5 |
| 6 | 6 |
| 7 #include "src/v8.h" | 7 #include "src/v8.h" |
| 8 | 8 |
| 9 #if V8_TARGET_ARCH_MIPS64 | 9 #if V8_TARGET_ARCH_MIPS64 |
| 10 | 10 |
| (...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 780 // TODO(dslomov): support pretenuring | 780 // TODO(dslomov): support pretenuring |
| 781 CHECK(!FLAG_pretenuring_call_new); | 781 CHECK(!FLAG_pretenuring_call_new); |
| 782 | 782 |
| 783 { | 783 { |
| 784 FrameScope frame_scope(masm, StackFrame::CONSTRUCT); | 784 FrameScope frame_scope(masm, StackFrame::CONSTRUCT); |
| 785 | 785 |
| 786 __ mov(a4, a0); | 786 __ mov(a4, a0); |
| 787 __ SmiTag(a4); | 787 __ SmiTag(a4); |
| 788 __ push(a4); // Smi-tagged arguments count. | 788 __ push(a4); // Smi-tagged arguments count. |
| 789 | 789 |
| 790 // Push new.target. |
| 791 __ push(a3); |
| 792 |
| 790 // receiver is the hole. | 793 // receiver is the hole. |
| 791 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); | 794 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); |
| 792 __ push(at); | 795 __ push(at); |
| 793 | 796 |
| 794 // Set up pointer to last argument. | 797 // Set up pointer to last argument. |
| 795 __ Daddu(a2, fp, Operand(StandardFrameConstants::kCallerSPOffset)); | 798 __ Daddu(a2, fp, Operand(StandardFrameConstants::kCallerSPOffset)); |
| 796 | 799 |
| 797 // Copy arguments and receiver to the expression stack. | 800 // Copy arguments and receiver to the expression stack. |
| 798 // a0: number of arguments | 801 // a0: number of arguments |
| 799 // a1: constructor function | 802 // a1: constructor function |
| 800 // a2: address of last argument (caller sp) | 803 // a2: address of last argument (caller sp) |
| 801 // a4: number of arguments (smi-tagged) | 804 // a4: number of arguments (smi-tagged) |
| 802 // sp[0]: receiver | 805 // sp[0]: receiver |
| 803 // sp[1]: number of arguments (smi-tagged) | 806 // sp[1]: new.target |
| 807 // sp[2]: number of arguments (smi-tagged) |
| 804 Label loop, entry; | 808 Label loop, entry; |
| 805 __ SmiUntag(a4); | 809 __ SmiUntag(a4); |
| 806 __ jmp(&entry); | 810 __ jmp(&entry); |
| 807 __ bind(&loop); | 811 __ bind(&loop); |
| 808 __ dsll(at, a4, kPointerSizeLog2); | 812 __ dsll(at, a4, kPointerSizeLog2); |
| 809 __ Daddu(at, a2, Operand(at)); | 813 __ Daddu(at, a2, Operand(at)); |
| 810 __ ld(at, MemOperand(at)); | 814 __ ld(at, MemOperand(at)); |
| 811 __ push(at); | 815 __ push(at); |
| 812 __ bind(&entry); | 816 __ bind(&entry); |
| 813 __ Daddu(a4, a4, Operand(-1)); | 817 __ Daddu(a4, a4, Operand(-1)); |
| 814 __ Branch(&loop, ge, a4, Operand(zero_reg)); | 818 __ Branch(&loop, ge, a4, Operand(zero_reg)); |
| 815 | 819 |
| 816 // Call the function. | 820 // Call the function. |
| 817 // a0: number of arguments | 821 // a0: number of arguments |
| 818 // a1: constructor function | 822 // a1: constructor function |
| 823 __ Daddu(a0, a0, Operand(1)); |
| 819 ParameterCount actual(a0); | 824 ParameterCount actual(a0); |
| 820 __ InvokeFunction(a1, actual, CALL_FUNCTION, NullCallWrapper()); | 825 __ InvokeFunction(a1, actual, CALL_FUNCTION, NullCallWrapper()); |
| 821 | 826 |
| 822 // Restore context from the frame. | 827 // Restore context from the frame. |
| 823 // v0: result | 828 // v0: result |
| 824 // sp[0]: number of arguments (smi-tagged) | 829 // sp[0]: number of arguments (smi-tagged) |
| 825 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 830 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 826 __ ld(a1, MemOperand(sp, 0)); | 831 __ ld(a1, MemOperand(sp, 0)); |
| 827 | 832 |
| 828 // Leave construct frame. | 833 // Leave construct frame. |
| (...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1664 __ break_(0xCC); | 1669 __ break_(0xCC); |
| 1665 } | 1670 } |
| 1666 } | 1671 } |
| 1667 | 1672 |
| 1668 | 1673 |
| 1669 #undef __ | 1674 #undef __ |
| 1670 | 1675 |
| 1671 } } // namespace v8::internal | 1676 } } // namespace v8::internal |
| 1672 | 1677 |
| 1673 #endif // V8_TARGET_ARCH_MIPS64 | 1678 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |