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

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

Issue 1402943002: [Interpreter] Support for operator new. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix missing receiver slot. 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 | « src/mips64/interface-descriptors-mips64.cc ('k') | src/ppc/interface-descriptors-ppc.cc » ('j') | 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 cdbb1c24a076d7446d8ab230bd1f110ccc9be9da..3d188a6e9839f0ec5bcb7e5dcd91c7d5e78bd051 100644
--- a/src/ppc/builtins-ppc.cc
+++ b/src/ppc/builtins-ppc.cc
@@ -983,6 +983,7 @@ void Builtins::Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) {
// arguments should be consecutive above this, in the same order as
// they are to be pushed onto the stack.
// -- r4 : the target to call (can be any Object).
+ // -----------------------------------
// Calculate number of arguments (add one for receiver).
__ addi(r6, r3, Operand(1));
@@ -1001,6 +1002,41 @@ void Builtins::Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) {
}
+// static
+void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) {
+ // ----------- S t a t e -------------
+ // -- r3 : argument count (not including receiver)
+ // -- r6 : original constructor
+ // -- r4 : constructor to call
+ // -- r5 : address of the first argument
+ // -----------------------------------
+
+ // Calculate number of arguments.
+ __ mr(r7, r3);
+
+ // Push a slot for the receiver.
+ __ 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);
+
+ // Call the constructor with r3, r4, and r6 unmodified.
+ __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CONSTRUCT_CALL);
+}
+
+
void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
CallRuntimePassFunction(masm, Runtime::kCompileLazy);
GenerateTailCallToReturnedCode(masm);
« no previous file with comments | « src/mips64/interface-descriptors-mips64.cc ('k') | src/ppc/interface-descriptors-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698