Index: src/mips64/code-stubs-mips64.cc |
diff --git a/src/mips64/code-stubs-mips64.cc b/src/mips64/code-stubs-mips64.cc |
index 1e5efbb0ac966f403b1c496728f824369a14c6da..048bdb9944dfa05b92c961edd50a22b186a0d437 100644 |
--- a/src/mips64/code-stubs-mips64.cc |
+++ b/src/mips64/code-stubs-mips64.cc |
@@ -5007,24 +5007,40 @@ void FastNewSloppyArgumentsStub::Generate(MacroAssembler* masm) { |
// ----------------------------------- |
__ AssertFunction(a1); |
+ // For Ignition we need to skip all possible handler/stub frames until |
+ // we reach the JavaScript frame for the function (similar to what the |
+ // runtime fallback implementation does). So make t0 point to that |
+ // JavaScript frame. |
+ { |
+ Label loop, loop_entry; |
+ __ Branch(USE_DELAY_SLOT, &loop_entry); |
+ __ mov(t0, fp); // In delay slot. |
+ __ bind(&loop); |
+ __ ld(t0, MemOperand(t0, StandardFrameConstants::kCallerFPOffset)); |
+ __ bind(&loop_entry); |
+ __ ld(a3, MemOperand(t0, StandardFrameConstants::kFunctionOffset)); |
+ __ Branch(&loop, ne, a1, Operand(a3)); |
+ } |
+ |
// TODO(bmeurer): Cleanup to match the FastNewStrictArgumentsStub. |
__ ld(a2, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); |
__ lw(a2, |
FieldMemOperand(a2, SharedFunctionInfo::kFormalParameterCountOffset)); |
- __ Lsa(a3, fp, a2, kPointerSizeLog2); |
+ __ Lsa(a3, t0, a2, kPointerSizeLog2); |
__ Addu(a3, a3, Operand(StandardFrameConstants::kCallerSPOffset)); |
__ SmiTag(a2); |
// a1 : function |
// a2 : number of parameters (tagged) |
// a3 : parameters pointer |
+ // t0 : Javascript frame pointer |
// Registers used over whole function: |
// a5 : arguments count (tagged) |
// a6 : mapped parameter count (tagged) |
// Check if the calling frame is an arguments adaptor frame. |
Label adaptor_frame, try_allocate, runtime; |
- __ ld(a4, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
+ __ ld(a4, MemOperand(t0, StandardFrameConstants::kCallerFPOffset)); |
__ ld(a0, MemOperand(a4, CommonFrameConstants::kContextOrFrameTypeOffset)); |
__ Branch(&adaptor_frame, eq, a0, |
Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |