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

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

Issue 1403333002: PPC: Fix "[Interpreter] Support for operator new." (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 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 3d188a6e9839f0ec5bcb7e5dcd91c7d5e78bd051..ce6aef78e3418d3673c1e0392e9aecca4fffd85f 100644
--- a/src/ppc/builtins-ppc.cc
+++ b/src/ppc/builtins-ppc.cc
@@ -975,6 +975,18 @@ void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) {
}
+static void Generate_InterpreterPushArgs(MacroAssembler* masm, Register index,
+ Register count, Register scratch) {
+ Label loop;
+ __ addi(index, index, Operand(kPointerSize)); // Bias up for LoadPU
+ __ mtctr(count);
+ __ bind(&loop);
+ __ LoadPU(scratch, MemOperand(index, -kPointerSize));
+ __ push(scratch);
+ __ bdnz(&loop);
+}
+
+
// static
void Builtins::Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) {
// ----------- S t a t e -------------
@@ -989,13 +1001,7 @@ void Builtins::Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) {
__ addi(r6, r3, Operand(1));
// Push the arguments.
- Label loop;
- __ addi(r5, r5, Operand(kPointerSize)); // Bias up for LoadPU
- __ mtctr(r6);
- __ bind(&loop);
- __ LoadPU(r6, MemOperand(r5, -kPointerSize));
- __ push(r6);
- __ bdnz(&loop);
+ Generate_InterpreterPushArgs(masm, r5, r6, r7);
// Call the target.
__ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
@@ -1011,26 +1017,15 @@ void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) {
// -- r5 : address of the first argument
// -----------------------------------
- // Calculate number of arguments.
- __ mr(r7, r3);
-
- // Push a slot for the receiver.
+ // Push a slot for the receiver to be constructed.
__ push(r3);
- // Skip pushing arguments if none.
- Label loop_end;
- __ cmpi(r7, Operand(0));
- __ beq(&loop_end);
-
- // Push the arguments
- Label loop;
- __ addi(r5, r5, Operand(kPointerSize)); // Bias up for LoadPU
- __ mtctr(r7);
- __ bind(&loop);
- __ LoadPU(r7, MemOperand(r5, -kPointerSize));
- __ push(r7);
- __ bdnz(&loop);
- __ bind(&loop_end);
+ // Push the arguments (skip if none).
+ Label skip;
+ __ cmpi(r3, Operand::Zero());
+ __ beq(&skip);
+ Generate_InterpreterPushArgs(masm, r5, r3, r7);
+ __ bind(&skip);
// Call the constructor with r3, r4, and r6 unmodified.
__ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CONSTRUCT_CALL);
« 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