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

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

Issue 1402943002: [Interpreter] Support for operator new. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: One more test. 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
Index: src/mips/builtins-mips.cc
diff --git a/src/mips/builtins-mips.cc b/src/mips/builtins-mips.cc
index 2e6904380a7f644ba3587b8e0075d2f6a0ad27c2..d19b44f7434913eee472b02f9d479797026fd1c4 100644
--- a/src/mips/builtins-mips.cc
+++ b/src/mips/builtins-mips.cc
@@ -986,6 +986,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.
// -- a1 : the target to call (can be any Object).
+ // -----------------------------------
// Find the address of the last argument.
__ Addu(a3, a0, Operand(1)); // Add one for receiver.
@@ -1007,6 +1008,34 @@ void Builtins::Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) {
}
+// static
+void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) {
+ // ----------- S t a t e -------------
+ // -- a0 : argument count (not including receiver)
+ // -- a3 : original constructor
+ // -- a1 : constructor to call
+ // -- a2 : address of the first argument
+ // -----------------------------------
+
+ // Find the address of the last argument.
+ __ sll(t0, a0, kPointerSizeLog2);
+ __ Subu(t0, a2, Operand(t0));
+
+ // Push the arguments.
+ Label loop_header, loop_check;
+ __ Branch(&loop_check);
+ __ bind(&loop_header);
+ __ lw(t1, MemOperand(a2));
+ __ Addu(a2, a2, Operand(-kPointerSize));
+ __ push(t1);
+ __ bind(&loop_check);
+ __ Branch(&loop_header, gt, a2, Operand(t0));
+
+ // Call the constructor with a0, a1, and a3 unmodified.
+ __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CONSTRUCT_CALL);
+}
+
+
void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
CallRuntimePassFunction(masm, Runtime::kCompileLazy);
GenerateTailCallToReturnedCode(masm);

Powered by Google App Engine
This is Rietveld 408576698