| Index: src/mips64/builtins-mips64.cc
|
| diff --git a/src/mips64/builtins-mips64.cc b/src/mips64/builtins-mips64.cc
|
| index 7a0d81a71aa1ddd33286f8a1f6801082c2cb86ee..4a21519f9c66c757ee4cd912c1aa28169723fe2c 100644
|
| --- a/src/mips64/builtins-mips64.cc
|
| +++ b/src/mips64/builtins-mips64.cc
|
| @@ -940,6 +940,21 @@ void Builtins::Generate_JSConstructEntryTrampoline(MacroAssembler* masm) {
|
| Generate_JSEntryTrampolineHelper(masm, true);
|
| }
|
|
|
| +static void LeaveInterpreterFrame(MacroAssembler* masm, Register scratch) {
|
| + Register args_count = scratch;
|
| +
|
| + // Get the arguments + receiver count.
|
| + __ ld(args_count,
|
| + MemOperand(fp, InterpreterFrameConstants::kBytecodeArrayFromFp));
|
| + __ lw(t0, FieldMemOperand(args_count, BytecodeArray::kParameterSizeOffset));
|
| +
|
| + // Leave the frame (also dropping the register file).
|
| + __ LeaveFrame(StackFrame::JAVA_SCRIPT);
|
| +
|
| + // Drop receiver + arguments.
|
| + __ Daddu(sp, sp, args_count);
|
| +}
|
| +
|
| // Generate code for entering a JS function with the interpreter.
|
| // On entry to the function the receiver and arguments have been pushed on the
|
| // stack left to right. The actual argument count matches the formal parameter
|
| @@ -1042,16 +1057,7 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
|
| masm->isolate()->heap()->SetInterpreterEntryReturnPCOffset(masm->pc_offset());
|
|
|
| // The return value is in v0.
|
| -
|
| - // Get the arguments + reciever count.
|
| - __ ld(t0, MemOperand(fp, InterpreterFrameConstants::kBytecodeArrayFromFp));
|
| - __ lw(t0, FieldMemOperand(t0, BytecodeArray::kParameterSizeOffset));
|
| -
|
| - // Leave the frame (also dropping the register file).
|
| - __ LeaveFrame(StackFrame::JAVA_SCRIPT);
|
| -
|
| - // Drop receiver + arguments and return.
|
| - __ Daddu(sp, sp, t0);
|
| + LeaveInterpreterFrame(masm, t0);
|
| __ Jump(ra);
|
|
|
| // Load debug copy of the bytecode array.
|
| @@ -1073,6 +1079,31 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
|
| __ Jump(a4);
|
| }
|
|
|
| +void Builtins::Generate_InterpreterMarkBaselineOnReturn(MacroAssembler* masm) {
|
| + // Save the function and context for call to CompileBaseline.
|
| + __ ld(a1, MemOperand(fp, StandardFrameConstants::kFunctionOffset));
|
| + __ ld(kContextRegister,
|
| + MemOperand(fp, StandardFrameConstants::kContextOffset));
|
| +
|
| + // Leave the frame before recompiling for baseline so that we don't count as
|
| + // an activation on the stack.
|
| + LeaveInterpreterFrame(masm, t0);
|
| +
|
| + {
|
| + FrameScope frame_scope(masm, StackFrame::INTERNAL);
|
| + // Push return value.
|
| + __ push(v0);
|
| +
|
| + // Push function as argument and compile for baseline.
|
| + __ push(a1);
|
| + __ CallRuntime(Runtime::kCompileBaseline);
|
| +
|
| + // Restore return value.
|
| + __ pop(v0);
|
| + }
|
| + __ Jump(ra);
|
| +}
|
| +
|
| // static
|
| void Builtins::Generate_InterpreterPushArgsAndCallImpl(
|
| MacroAssembler* masm, TailCallMode tail_call_mode) {
|
|
|