| Index: src/s390/builtins-s390.cc
|
| diff --git a/src/s390/builtins-s390.cc b/src/s390/builtins-s390.cc
|
| index 55ec1dd18722ad4cd6cd5b7c4954921888e6bd56..22a43ad067fe284ecf662649fe0b2ec88c6b9162 100644
|
| --- a/src/s390/builtins-s390.cc
|
| +++ b/src/s390/builtins-s390.cc
|
| @@ -957,6 +957,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.
|
| + __ LoadP(args_count,
|
| + MemOperand(fp, InterpreterFrameConstants::kBytecodeArrayFromFp));
|
| + __ LoadlW(args_count,
|
| + FieldMemOperand(args_count, BytecodeArray::kParameterSizeOffset));
|
| +
|
| + // Leave the frame (also dropping the register file).
|
| + __ LeaveFrame(StackFrame::JAVA_SCRIPT);
|
| +
|
| + __ AddP(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
|
| @@ -1067,15 +1082,7 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
|
| masm->isolate()->heap()->SetInterpreterEntryReturnPCOffset(masm->pc_offset());
|
|
|
| // The return value is in r2.
|
| -
|
| - // Get the arguments + reciever count.
|
| - __ LoadP(r4, MemOperand(fp, InterpreterFrameConstants::kBytecodeArrayFromFp));
|
| - __ LoadlW(r4, FieldMemOperand(r4, BytecodeArray::kParameterSizeOffset));
|
| -
|
| - // Leave the frame (also dropping the register file).
|
| - __ LeaveFrame(StackFrame::JAVA_SCRIPT);
|
| -
|
| - __ lay(sp, MemOperand(sp, r4));
|
| + LeaveInterpreterFrame(masm, r4);
|
| __ Ret();
|
|
|
| // If the bytecode array is no longer present, then the underlying function
|
| @@ -1091,6 +1098,31 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
|
| __ JumpToJSEntry(r6);
|
| }
|
|
|
| +void Builtins::Generate_InterpreterMarkBaselineOnReturn(MacroAssembler* masm) {
|
| + // Save the function and context for call to CompileBaseline.
|
| + __ LoadP(r3, MemOperand(fp, StandardFrameConstants::kFunctionOffset));
|
| + __ LoadP(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, r4);
|
| +
|
| + {
|
| + FrameScope frame_scope(masm, StackFrame::INTERNAL);
|
| + // Push return value.
|
| + __ push(r2);
|
| +
|
| + // Push function as argument and compile for baseline.
|
| + __ push(r3);
|
| + __ CallRuntime(Runtime::kCompileBaseline);
|
| +
|
| + // Restore return value.
|
| + __ pop(r2);
|
| + }
|
| + __ Ret();
|
| +}
|
| +
|
| static void Generate_InterpreterPushArgs(MacroAssembler* masm, Register index,
|
| Register count, Register scratch) {
|
| Label loop;
|
|
|