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/codegen.h" | 7 #include "src/codegen.h" |
8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
(...skipping 942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
953 __ LeaveFrame(StackFrame::JAVA_SCRIPT); | 953 __ LeaveFrame(StackFrame::JAVA_SCRIPT); |
954 | 954 |
955 // Drop receiver + arguments and return. | 955 // Drop receiver + arguments and return. |
956 __ lw(at, FieldMemOperand(kInterpreterBytecodeArrayRegister, | 956 __ lw(at, FieldMemOperand(kInterpreterBytecodeArrayRegister, |
957 BytecodeArray::kParameterSizeOffset)); | 957 BytecodeArray::kParameterSizeOffset)); |
958 __ Daddu(sp, sp, at); | 958 __ Daddu(sp, sp, at); |
959 __ Jump(ra); | 959 __ Jump(ra); |
960 } | 960 } |
961 | 961 |
962 | 962 |
963 // static | |
964 void Builtins::Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) { | |
965 // ----------- S t a t e ------------- | |
966 // -- a0 : the number of arguments (not including the receiver) | |
967 // -- a2 : the address of the first argument to be pushed. Subsequent | |
968 // arguments should be consecutive above this, in the same order as | |
969 // they are to be pushed onto the stack. | |
970 // -- a1 : the target to call (can be any Object). | |
971 | |
972 // Find the address of the last argument. | |
973 __ Addu(a3, a0, Operand(1)); // Add one for receiver. | |
974 __ sll(a3, a3, kPointerSizeLog2); | |
975 __ Subu(a3, a2, Operand(a3)); | |
976 | |
977 // Push the arguments. | |
978 Label loop_header, loop_check; | |
979 __ Branch(&loop_check); | |
980 __ bind(&loop_header); | |
981 __ lw(t0, MemOperand(a2)); | |
982 __ Addu(a2, a2, Operand(-kPointerSize)); | |
983 __ push(t0); | |
984 __ bind(&loop_check); | |
985 __ Branch(&loop_header, gt, a2, Operand(a3)); | |
986 | |
987 // Call the target. | |
988 __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); | |
989 } | |
990 | |
991 | |
992 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { | 963 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { |
993 CallRuntimePassFunction(masm, Runtime::kCompileLazy); | 964 CallRuntimePassFunction(masm, Runtime::kCompileLazy); |
994 GenerateTailCallToReturnedCode(masm); | 965 GenerateTailCallToReturnedCode(masm); |
995 } | 966 } |
996 | 967 |
997 | 968 |
998 static void CallCompileOptimized(MacroAssembler* masm, bool concurrent) { | 969 static void CallCompileOptimized(MacroAssembler* masm, bool concurrent) { |
999 FrameScope scope(masm, StackFrame::INTERNAL); | 970 FrameScope scope(masm, StackFrame::INTERNAL); |
1000 // Push a copy of the function onto the stack. | 971 // Push a copy of the function onto the stack. |
1001 // Push function as parameter to the runtime call. | 972 // Push function as parameter to the runtime call. |
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1728 // method. | 1699 // method. |
1729 __ bind(&non_constructor); | 1700 __ bind(&non_constructor); |
1730 { | 1701 { |
1731 FrameScope scope(masm, StackFrame::INTERNAL); | 1702 FrameScope scope(masm, StackFrame::INTERNAL); |
1732 __ Push(a1); | 1703 __ Push(a1); |
1733 __ CallRuntime(Runtime::kThrowCalledNonCallable, 1); | 1704 __ CallRuntime(Runtime::kThrowCalledNonCallable, 1); |
1734 } | 1705 } |
1735 } | 1706 } |
1736 | 1707 |
1737 | 1708 |
| 1709 // static |
| 1710 void Builtins::Generate_PushArgsAndCall(MacroAssembler* masm) { |
| 1711 // ----------- S t a t e ------------- |
| 1712 // -- a0 : the number of arguments (not including the receiver) |
| 1713 // -- a2 : the address of the first argument to be pushed. Subsequent |
| 1714 // arguments should be consecutive above this, in the same order as |
| 1715 // they are to be pushed onto the stack. |
| 1716 // -- a1 : the target to call (can be any Object). |
| 1717 |
| 1718 // Find the address of the last argument. |
| 1719 __ Daddu(a3, a0, Operand(1)); // Add one for receiver. |
| 1720 __ dsll(a3, a3, kPointerSizeLog2); |
| 1721 __ Dsubu(a3, a2, Operand(a3)); |
| 1722 |
| 1723 // Push the arguments. |
| 1724 Label loop_header, loop_check; |
| 1725 __ Branch(&loop_check); |
| 1726 __ bind(&loop_header); |
| 1727 __ ld(a4, MemOperand(a2)); |
| 1728 __ Daddu(a2, a2, Operand(-kPointerSize)); |
| 1729 __ push(a4); |
| 1730 __ bind(&loop_check); |
| 1731 __ Branch(&loop_header, gt, a2, Operand(a3)); |
| 1732 |
| 1733 // Call the target. |
| 1734 __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); |
| 1735 } |
| 1736 |
| 1737 |
1738 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { | 1738 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
1739 // State setup as expected by MacroAssembler::InvokePrologue. | 1739 // State setup as expected by MacroAssembler::InvokePrologue. |
1740 // ----------- S t a t e ------------- | 1740 // ----------- S t a t e ------------- |
1741 // -- a0: actual arguments count | 1741 // -- a0: actual arguments count |
1742 // -- a1: function (passed through to callee) | 1742 // -- a1: function (passed through to callee) |
1743 // -- a2: expected arguments count | 1743 // -- a2: expected arguments count |
1744 // ----------------------------------- | 1744 // ----------------------------------- |
1745 | 1745 |
1746 Label stack_overflow; | 1746 Label stack_overflow; |
1747 ArgumentAdaptorStackCheck(masm, &stack_overflow); | 1747 ArgumentAdaptorStackCheck(masm, &stack_overflow); |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1887 } | 1887 } |
1888 } | 1888 } |
1889 | 1889 |
1890 | 1890 |
1891 #undef __ | 1891 #undef __ |
1892 | 1892 |
1893 } // namespace internal | 1893 } // namespace internal |
1894 } // namespace v8 | 1894 } // namespace v8 |
1895 | 1895 |
1896 #endif // V8_TARGET_ARCH_MIPS64 | 1896 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |