Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: src/ppc/builtins-ppc.cc

Issue 1384483004: PPC: [Interpreter] Add CallRuntime support to the interpreter. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/ppc/code-stubs-ppc.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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_PPC 5 #if V8_TARGET_ARCH_PPC
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 938 matching lines...) Expand 10 before | Expand all | Expand 10 after
949 __ LeaveFrame(StackFrame::JAVA_SCRIPT); 949 __ LeaveFrame(StackFrame::JAVA_SCRIPT);
950 950
951 // Drop receiver + arguments and return. 951 // Drop receiver + arguments and return.
952 __ lwz(r0, FieldMemOperand(kInterpreterBytecodeArrayRegister, 952 __ lwz(r0, FieldMemOperand(kInterpreterBytecodeArrayRegister,
953 BytecodeArray::kParameterSizeOffset)); 953 BytecodeArray::kParameterSizeOffset));
954 __ add(sp, sp, r0); 954 __ add(sp, sp, r0);
955 __ blr(); 955 __ blr();
956 } 956 }
957 957
958 958
959 // static
960 void Builtins::Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) {
961 // ----------- S t a t e -------------
962 // -- r3 : the number of arguments (not including the receiver)
963 // -- r5 : the address of the first argument to be pushed. Subsequent
964 // arguments should be consecutive above this, in the same order as
965 // they are to be pushed onto the stack.
966 // -- r4 : the target to call (can be any Object).
967
968 // Calculate number of arguments (add one for receiver).
969 __ addi(r6, r3, Operand(1));
970
971 // Push the arguments.
972 Label loop;
973 __ addi(r5, r5, Operand(kPointerSize)); // Bias up for LoadPU
974 __ mtctr(r6);
975 __ bind(&loop);
976 __ LoadPU(r6, MemOperand(r5, -kPointerSize));
977 __ push(r6);
978 __ bdnz(&loop);
979
980 // Call the target.
981 __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
982 }
983
984
959 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { 985 void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
960 CallRuntimePassFunction(masm, Runtime::kCompileLazy); 986 CallRuntimePassFunction(masm, Runtime::kCompileLazy);
961 GenerateTailCallToReturnedCode(masm); 987 GenerateTailCallToReturnedCode(masm);
962 } 988 }
963 989
964 990
965 static void CallCompileOptimized(MacroAssembler* masm, bool concurrent) { 991 static void CallCompileOptimized(MacroAssembler* masm, bool concurrent) {
966 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); 992 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
967 // Push a copy of the function onto the stack. 993 // Push a copy of the function onto the stack.
968 // Push function as parameter to the runtime call. 994 // Push function as parameter to the runtime call.
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after
1712 // method. 1738 // method.
1713 __ bind(&non_constructor); 1739 __ bind(&non_constructor);
1714 { 1740 {
1715 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); 1741 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
1716 __ Push(r4); 1742 __ Push(r4);
1717 __ CallRuntime(Runtime::kThrowCalledNonCallable, 1); 1743 __ CallRuntime(Runtime::kThrowCalledNonCallable, 1);
1718 } 1744 }
1719 } 1745 }
1720 1746
1721 1747
1722 // static
1723 void Builtins::Generate_PushArgsAndCall(MacroAssembler* masm) {
1724 // ----------- S t a t e -------------
1725 // -- r3 : the number of arguments (not including the receiver)
1726 // -- r5 : the address of the first argument to be pushed. Subsequent
1727 // arguments should be consecutive above this, in the same order as
1728 // they are to be pushed onto the stack.
1729 // -- r4 : the target to call (can be any Object).
1730
1731 // Calculate number of arguments (add one for receiver).
1732 __ addi(r6, r3, Operand(1));
1733
1734 // Push the arguments.
1735 Label loop;
1736 __ addi(r5, r5, Operand(kPointerSize)); // Bias up for LoadPU
1737 __ mtctr(r6);
1738 __ bind(&loop);
1739 __ LoadPU(r6, MemOperand(r5, -kPointerSize));
1740 __ push(r6);
1741 __ bdnz(&loop);
1742
1743 // Call the target.
1744 __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
1745 }
1746
1747
1748 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { 1748 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
1749 // ----------- S t a t e ------------- 1749 // ----------- S t a t e -------------
1750 // -- r3 : actual number of arguments 1750 // -- r3 : actual number of arguments
1751 // -- r4 : function (passed through to callee) 1751 // -- r4 : function (passed through to callee)
1752 // -- r5 : expected number of arguments 1752 // -- r5 : expected number of arguments
1753 // ----------------------------------- 1753 // -----------------------------------
1754 1754
1755 Label stack_overflow; 1755 Label stack_overflow;
1756 ArgumentAdaptorStackCheck(masm, &stack_overflow); 1756 ArgumentAdaptorStackCheck(masm, &stack_overflow);
1757 Label invoke, dont_adapt_arguments; 1757 Label invoke, dont_adapt_arguments;
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
1902 __ bkpt(0); 1902 __ bkpt(0);
1903 } 1903 }
1904 } 1904 }
1905 1905
1906 1906
1907 #undef __ 1907 #undef __
1908 } // namespace internal 1908 } // namespace internal
1909 } // namespace v8 1909 } // namespace v8
1910 1910
1911 #endif // V8_TARGET_ARCH_PPC 1911 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « no previous file | src/ppc/code-stubs-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698