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

Unified Diff: src/arm/builtins-arm.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 | « no previous file | src/arm/interface-descriptors-arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/builtins-arm.cc
diff --git a/src/arm/builtins-arm.cc b/src/arm/builtins-arm.cc
index 554baa2f4498da06b967942c6387318e27392cea..fd94243cdd827cec833baa88f0266e257fe82822 100644
--- a/src/arm/builtins-arm.cc
+++ b/src/arm/builtins-arm.cc
@@ -976,6 +976,19 @@ void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) {
}
+static void Generate_InterpreterPushArgs(MacroAssembler* masm, Register index,
+ Register limit, Register scratch) {
+ Label loop_header, loop_check;
+ __ b(al, &loop_check);
+ __ bind(&loop_header);
+ __ ldr(scratch, MemOperand(index, -kPointerSize, PostIndex));
+ __ push(scratch);
+ __ bind(&loop_check);
+ __ cmp(index, limit);
+ __ b(gt, &loop_header);
+}
+
+
// static
void Builtins::Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) {
// ----------- S t a t e -------------
@@ -984,6 +997,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.
// -- r1 : the target to call (can be any Object).
+ // -----------------------------------
// Find the address of the last argument.
__ add(r3, r0, Operand(1)); // Add one for receiver.
@@ -991,20 +1005,37 @@ void Builtins::Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) {
__ sub(r3, r2, r3);
// Push the arguments.
- Label loop_header, loop_check;
- __ b(al, &loop_check);
- __ bind(&loop_header);
- __ ldr(r4, MemOperand(r2, -kPointerSize, PostIndex));
- __ push(r4);
- __ bind(&loop_check);
- __ cmp(r2, r3);
- __ b(gt, &loop_header);
+ Generate_InterpreterPushArgs(masm, r2, r3, r4);
// Call the target.
__ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
}
+// static
+void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) {
+ // ----------- S t a t e -------------
+ // -- r0 : argument count (not including receiver)
+ // -- r3 : original constructor
+ // -- r1 : constructor to call
+ // -- r2 : address of the first argument
+ // -----------------------------------
+
+ // Find the address of the last argument.
+ __ mov(r4, Operand(r0, LSL, kPointerSizeLog2));
+ __ sub(r4, r2, r4);
+
+ // Push a slot for the receiver to be constructed.
+ __ push(r0);
+
+ // Push the arguments.
+ Generate_InterpreterPushArgs(masm, r2, r4, r5);
+
+ // Call the constructor with r0, r1, and r3 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 | « no previous file | src/arm/interface-descriptors-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698