| Index: src/builtins/s390/builtins-s390.cc
|
| diff --git a/src/builtins/s390/builtins-s390.cc b/src/builtins/s390/builtins-s390.cc
|
| index a3fd0a42cdbb723578815c67bc9639ff0bf1868d..a034e588c1a72d7b4c7d5d5f79b7fb2f4402420c 100644
|
| --- a/src/builtins/s390/builtins-s390.cc
|
| +++ b/src/builtins/s390/builtins-s390.cc
|
| @@ -1694,6 +1694,72 @@ void Builtins::Generate_NotifyStubFailureSaveDoubles(MacroAssembler* masm) {
|
| Generate_NotifyStubFailureHelper(masm, kSaveFPRegs);
|
| }
|
|
|
| +void Builtins::Generate_NotifyBuiltinContinuation(MacroAssembler* masm) {
|
| + {
|
| + FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
|
| + // Preserve possible return result from lazy deopt.
|
| + __ push(r2);
|
| + // Pass the function and deoptimization type to the runtime system.
|
| + __ CallRuntime(Runtime::kNotifyStubFailure, false);
|
| + __ pop(r2);
|
| + }
|
| +
|
| + __ AddP(sp, sp, Operand(kPointerSize)); // Ignore state
|
| + __ Ret(); // Jump to ContinueToBuiltin stub
|
| +}
|
| +
|
| +namespace {
|
| +void Generate_ContinueToBuiltinHelper(MacroAssembler* masm,
|
| + bool java_script_builtin,
|
| + bool with_result) {
|
| + const RegisterConfiguration* config(RegisterConfiguration::Turbofan());
|
| + int allocatable_register_count = config->num_allocatable_general_registers();
|
| + if (with_result) {
|
| + // Overwrite the hole inserted by the deoptimizer with the return value from
|
| + // the LAZY deopt point.
|
| + __ StoreP(
|
| + r2, MemOperand(
|
| + sp, config->num_allocatable_general_registers() * kPointerSize +
|
| + BuiltinContinuationFrameConstants::kFixedFrameSize));
|
| + }
|
| + for (int i = allocatable_register_count - 1; i >= 0; --i) {
|
| + int code = config->GetAllocatableGeneralCode(i);
|
| + __ Pop(Register::from_code(code));
|
| + if (java_script_builtin && code == kJavaScriptCallArgCountRegister.code()) {
|
| + __ SmiUntag(Register::from_code(code));
|
| + }
|
| + }
|
| + __ LoadP(
|
| + fp,
|
| + MemOperand(sp, BuiltinContinuationFrameConstants::kFixedFrameSizeFromFp));
|
| + __ Pop(ip);
|
| + __ AddP(sp, sp,
|
| + Operand(BuiltinContinuationFrameConstants::kFixedFrameSizeFromFp));
|
| + __ Pop(r0);
|
| + __ LoadRR(r14, r0);
|
| + __ AddP(ip, ip, Operand(Code::kHeaderSize - kHeapObjectTag));
|
| + __ Jump(ip);
|
| +}
|
| +} // namespace
|
| +
|
| +void Builtins::Generate_ContinueToCodeStubBuiltin(MacroAssembler* masm) {
|
| + Generate_ContinueToBuiltinHelper(masm, false, false);
|
| +}
|
| +
|
| +void Builtins::Generate_ContinueToCodeStubBuiltinWithResult(
|
| + MacroAssembler* masm) {
|
| + Generate_ContinueToBuiltinHelper(masm, false, true);
|
| +}
|
| +
|
| +void Builtins::Generate_ContinueToJavaScriptBuiltin(MacroAssembler* masm) {
|
| + Generate_ContinueToBuiltinHelper(masm, true, false);
|
| +}
|
| +
|
| +void Builtins::Generate_ContinueToJavaScriptBuiltinWithResult(
|
| + MacroAssembler* masm) {
|
| + Generate_ContinueToBuiltinHelper(masm, true, true);
|
| +}
|
| +
|
| static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm,
|
| Deoptimizer::BailoutType type) {
|
| {
|
|
|