Index: src/arm/builtins-arm.cc |
diff --git a/src/arm/builtins-arm.cc b/src/arm/builtins-arm.cc |
index 2859f97dc4bc1de7d278bf6644662e9f4e66b3b6..a530d9faec83f6313bca15d11b66341633051a61 100644 |
--- a/src/arm/builtins-arm.cc |
+++ b/src/arm/builtins-arm.cc |
@@ -318,7 +318,7 @@ static void Generate_Runtime_NewObject(MacroAssembler* masm, |
Label* allocated) { |
if (create_memento) { |
// Get the cell or allocation site. |
- __ ldr(r2, MemOperand(sp, 2 * kPointerSize)); |
+ __ ldr(r2, MemOperand(sp, 3 * kPointerSize)); |
__ push(r2); |
} |
@@ -343,7 +343,6 @@ static void Generate_Runtime_NewObject(MacroAssembler* masm, |
static void Generate_JSConstructStubHelper(MacroAssembler* masm, |
bool is_api_function, |
- bool use_new_target, |
bool create_memento) { |
// ----------- S t a t e ------------- |
// -- r0 : number of arguments |
@@ -372,9 +371,7 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm, |
__ SmiTag(r0); |
__ push(r0); |
__ push(r1); |
- if (use_new_target) { |
- __ push(r3); |
- } |
+ __ push(r3); |
Label rt_call, allocated, normal_new, count_incremented; |
__ cmp(r1, r3); |
@@ -614,8 +611,7 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm, |
__ bind(&allocated); |
if (create_memento) { |
- int offset = (use_new_target ? 3 : 2) * kPointerSize; |
- __ ldr(r2, MemOperand(sp, offset)); |
+ __ ldr(r2, MemOperand(sp, 3 * kPointerSize)); |
__ LoadRoot(r5, Heap::kUndefinedValueRootIndex); |
__ cmp(r2, r5); |
__ b(eq, &count_incremented); |
@@ -630,9 +626,7 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm, |
} |
// Restore the parameters. |
- if (use_new_target) { |
- __ pop(r3); |
- } |
+ __ pop(r3); |
__ pop(r1); |
// Retrieve smi-tagged arguments count from the stack. |
@@ -641,9 +635,7 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm, |
// Push new.target onto the construct frame. This is stored just below the |
// receiver on the stack. |
- if (use_new_target) { |
- __ push(r3); |
- } |
+ __ push(r3); |
__ push(r4); |
__ push(r4); |
@@ -657,8 +649,8 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm, |
// r3: number of arguments (smi-tagged) |
// sp[0]: receiver |
// sp[1]: receiver |
- // sp[2]: new.target (if used) |
- // sp[2/3]: number of arguments (smi-tagged) |
+ // sp[2]: new.target |
+ // sp[3]: number of arguments (smi-tagged) |
Label loop, entry; |
__ SmiTag(r3, r0); |
__ b(&entry); |
@@ -683,17 +675,15 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm, |
} |
// Store offset of return address for deoptimizer. |
- // TODO(arv): Remove the "!use_new_target" before supporting optimization |
- // of functions that reference new.target |
- if (!is_api_function && !use_new_target) { |
+ if (!is_api_function) { |
masm->isolate()->heap()->SetConstructStubDeoptPCOffset(masm->pc_offset()); |
} |
// Restore context from the frame. |
// r0: result |
// sp[0]: receiver |
- // sp[1]: new.target (if used) |
- // sp[1/2]: number of arguments (smi-tagged) |
+ // sp[1]: new.target |
+ // sp[2]: number of arguments (smi-tagged) |
__ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
// If the result is an object (in the ECMA sense), we should get rid |
@@ -723,10 +713,9 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm, |
__ bind(&exit); |
// r0: result |
// sp[0]: receiver (newly allocated object) |
- // sp[1]: new.target (if used) |
- // sp[1/2]: number of arguments (smi-tagged) |
- int offset = (use_new_target ? 2 : 1) * kPointerSize; |
- __ ldr(r1, MemOperand(sp, offset)); |
+ // sp[1]: new.target (original constructor) |
+ // sp[2]: number of arguments (smi-tagged) |
+ __ ldr(r1, MemOperand(sp, 2 * kPointerSize)); |
// Leave construct frame. |
} |
@@ -739,17 +728,12 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm, |
void Builtins::Generate_JSConstructStubGeneric(MacroAssembler* masm) { |
- Generate_JSConstructStubHelper(masm, false, false, FLAG_pretenuring_call_new); |
+ Generate_JSConstructStubHelper(masm, false, FLAG_pretenuring_call_new); |
} |
void Builtins::Generate_JSConstructStubApi(MacroAssembler* masm) { |
- Generate_JSConstructStubHelper(masm, true, false, false); |
-} |
- |
- |
-void Builtins::Generate_JSConstructStubNewTarget(MacroAssembler* masm) { |
- Generate_JSConstructStubHelper(masm, false, true, FLAG_pretenuring_call_new); |
+ Generate_JSConstructStubHelper(masm, true, false); |
} |