Index: src/mips/builtins-mips.cc |
diff --git a/src/mips/builtins-mips.cc b/src/mips/builtins-mips.cc |
index 7e5c0fc669baf43c73c483c94906373af3820994..cbc6819c31c1a86e05692739b523fe6321e1a277 100644 |
--- a/src/mips/builtins-mips.cc |
+++ b/src/mips/builtins-mips.cc |
@@ -1440,6 +1440,7 @@ static void ArgumentAdaptorStackCheck(MacroAssembler* masm, |
// -- a0 : actual number of arguments |
// -- a1 : function (passed through to callee) |
// -- a2 : expected number of arguments |
+ // -- a3 : new target (passed through to callee) |
// ----------------------------------- |
// Check the stack for overflow. We are not trying to catch |
// interruptions (e.g. debug break and preemption) here, so the "real stack |
@@ -1729,14 +1730,12 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
// -- a0: actual arguments count |
// -- a1: function (passed through to callee) |
// -- a2: expected arguments count |
+ // -- a3: new target (passed through to callee) |
// ----------------------------------- |
- Label stack_overflow; |
- ArgumentAdaptorStackCheck(masm, &stack_overflow); |
- Label invoke, dont_adapt_arguments; |
+ Label invoke, dont_adapt_arguments, stack_overflow; |
Label enough, too_few; |
- __ lw(a3, FieldMemOperand(a1, JSFunction::kCodeEntryOffset)); |
__ Branch(&dont_adapt_arguments, eq, |
a2, Operand(SharedFunctionInfo::kDontAdaptArgumentsSentinel)); |
// We use Uless as the number of argument should always be greater than 0. |
@@ -1746,9 +1745,10 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
// a0: actual number of arguments as a smi |
// a1: function |
// a2: expected number of arguments |
- // a3: code entry to call |
+ // a3: new target (passed through to callee) |
__ bind(&enough); |
EnterArgumentsAdaptorFrame(masm); |
+ ArgumentAdaptorStackCheck(masm, &stack_overflow); |
// Calculate copy start address into a0 and copy end address into t1. |
__ sll(a0, a0, kPointerSizeLog2 - kSmiTagSize); |
@@ -1763,7 +1763,7 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
// a0: copy start address |
// a1: function |
// a2: expected number of arguments |
- // a3: code entry to call |
+ // a3: new target (passed through to callee) |
// t1: copy end address |
Label copy; |
@@ -1800,12 +1800,13 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
__ bind(&no_strong_error); |
EnterArgumentsAdaptorFrame(masm); |
+ ArgumentAdaptorStackCheck(masm, &stack_overflow); |
// Calculate copy start address into a0 and copy end address into t3. |
// a0: actual number of arguments as a smi |
// a1: function |
// a2: expected number of arguments |
- // a3: code entry to call |
+ // a3: new target (passed through to callee) |
__ sll(a0, a0, kPointerSizeLog2 - kSmiTagSize); |
__ Addu(a0, fp, a0); |
// Adjust for return address and receiver. |
@@ -1817,7 +1818,7 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
// a0: copy start address |
// a1: function |
// a2: expected number of arguments |
- // a3: code entry to call |
+ // a3: new target (passed through to callee) |
// t3: copy end address |
Label copy; |
__ bind(©); |
@@ -1830,7 +1831,7 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
// Fill the remaining expected arguments with undefined. |
// a1: function |
// a2: expected number of arguments |
- // a3: code entry to call |
+ // a3: new target (passed through to callee) |
__ LoadRoot(t0, Heap::kUndefinedValueRootIndex); |
__ sll(t2, a2, kPointerSizeLog2); |
__ Subu(t1, fp, Operand(t2)); |
@@ -1850,7 +1851,9 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
__ mov(a0, a2); |
// a0 : expected number of arguments |
// a1 : function (passed through to callee) |
- __ Call(a3); |
+ // a3 : new target (passed through to callee) |
+ __ lw(t0, FieldMemOperand(a1, JSFunction::kCodeEntryOffset)); |
+ __ Call(t0); |
// Store offset of return address for deoptimizer. |
masm->isolate()->heap()->SetArgumentsAdaptorDeoptPCOffset(masm->pc_offset()); |
@@ -1864,12 +1867,12 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
// Don't adapt arguments. |
// ------------------------------------------- |
__ bind(&dont_adapt_arguments); |
- __ Jump(a3); |
+ __ lw(t0, FieldMemOperand(a1, JSFunction::kCodeEntryOffset)); |
+ __ Jump(t0); |
__ bind(&stack_overflow); |
{ |
FrameScope frame(masm, StackFrame::MANUAL); |
- EnterArgumentsAdaptorFrame(masm); |
__ CallRuntime(Runtime::kThrowStackOverflow, 0); |
__ break_(0xCC); |
} |