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

Unified Diff: src/ppc/builtins-ppc.cc

Issue 1544833002: PPC: [runtime] Rewrite Function.prototype.toString in C++. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ppc/builtins-ppc.cc
diff --git a/src/ppc/builtins-ppc.cc b/src/ppc/builtins-ppc.cc
index 5817e8cb2ed296651f5ba12d6a65ad5c0cc4be6d..b1a8a83c69f8af2e13d4f56e28b5eae9ee395b03 100644
--- a/src/ppc/builtins-ppc.cc
+++ b/src/ppc/builtins-ppc.cc
@@ -1384,52 +1384,7 @@ void Builtins::Generate_OsrAfterStackCheck(MacroAssembler* masm) {
// static
-void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
- // 1. Make sure we have at least one argument.
- // r3: actual number of arguments
- {
- Label done;
- __ cmpi(r3, Operand::Zero());
- __ bne(&done);
- __ PushRoot(Heap::kUndefinedValueRootIndex);
- __ addi(r3, r3, Operand(1));
- __ bind(&done);
- }
-
- // 2. Get the callable to call (passed as receiver) from the stack.
- // r3: actual number of arguments
- __ ShiftLeftImm(r5, r3, Operand(kPointerSizeLog2));
- __ LoadPX(r4, MemOperand(sp, r5));
-
- // 3. Shift arguments and return address one slot down on the stack
- // (overwriting the original receiver). Adjust argument count to make
- // the original first argument the new receiver.
- // r3: actual number of arguments
- // r4: callable
- {
- Label loop;
- // Calculate the copy start address (destination). Copy end address is sp.
- __ add(r5, sp, r5);
-
-
- __ mtctr(r3);
- __ bind(&loop);
- __ LoadP(ip, MemOperand(r5, -kPointerSize));
- __ StoreP(ip, MemOperand(r5));
- __ subi(r5, r5, Operand(kPointerSize));
- __ bdnz(&loop);
- // Adjust the actual number of arguments and remove the top element
- // (which is a copy of the last argument).
- __ subi(r3, r3, Operand(1));
- __ pop();
- }
-
- // 4. Call the callable.
- __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
-}
-
-
-void Builtins::Generate_FunctionApply(MacroAssembler* masm) {
+void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- r3 : argc
// -- sp[0] : argArray
@@ -1501,6 +1456,52 @@ void Builtins::Generate_FunctionApply(MacroAssembler* masm) {
}
+// static
+void Builtins::Generate_FunctionPrototypeCall(MacroAssembler* masm) {
+ // 1. Make sure we have at least one argument.
+ // r3: actual number of arguments
+ {
+ Label done;
+ __ cmpi(r3, Operand::Zero());
+ __ bne(&done);
+ __ PushRoot(Heap::kUndefinedValueRootIndex);
+ __ addi(r3, r3, Operand(1));
+ __ bind(&done);
+ }
+
+ // 2. Get the callable to call (passed as receiver) from the stack.
+ // r3: actual number of arguments
+ __ ShiftLeftImm(r5, r3, Operand(kPointerSizeLog2));
+ __ LoadPX(r4, MemOperand(sp, r5));
+
+ // 3. Shift arguments and return address one slot down on the stack
+ // (overwriting the original receiver). Adjust argument count to make
+ // the original first argument the new receiver.
+ // r3: actual number of arguments
+ // r4: callable
+ {
+ Label loop;
+ // Calculate the copy start address (destination). Copy end address is sp.
+ __ add(r5, sp, r5);
+
+
+ __ mtctr(r3);
+ __ bind(&loop);
+ __ LoadP(ip, MemOperand(r5, -kPointerSize));
+ __ StoreP(ip, MemOperand(r5));
+ __ subi(r5, r5, Operand(kPointerSize));
+ __ bdnz(&loop);
+ // Adjust the actual number of arguments and remove the top element
+ // (which is a copy of the last argument).
+ __ subi(r3, r3, Operand(1));
+ __ pop();
+ }
+
+ // 4. Call the callable.
+ __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
+}
+
+
void Builtins::Generate_ReflectApply(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- r3 : argc
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698