Index: src/builtins/arm64/builtins-arm64.cc |
diff --git a/src/builtins/arm64/builtins-arm64.cc b/src/builtins/arm64/builtins-arm64.cc |
index 79184bebe176cfa9494d234bef47fc53c5e88078..a7e768570b21d4a50cfea52522788edb15f0486f 100644 |
--- a/src/builtins/arm64/builtins-arm64.cc |
+++ b/src/builtins/arm64/builtins-arm64.cc |
@@ -3164,6 +3164,35 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
} |
} |
+void Builtins::Generate_WasmCompileLazy(MacroAssembler* masm) { |
+ DCHECK(masm->StackPointer().is(jssp)); |
+ __ Move(jssp, csp); |
+ { |
+ FrameScope scope(masm, StackFrame::INTERNAL); |
+ |
+ // Save all parameter registers (see wasm-linkage.cc). |
+ const RegList gp_regs = x0.Bit() | x1.Bit() | x2.Bit() | x3.Bit() | |
+ x4.Bit() | x5.Bit() | x6.Bit() | x7.Bit(); |
+ const RegList fp_regs = d0.Bit() | d1.Bit() | d2.Bit() | d3.Bit() | |
+ d4.Bit() | d5.Bit() | d6.Bit() | d7.Bit(); |
+ __ PushXRegList(gp_regs); |
+ __ PushDRegList(fp_regs); |
+ |
+ // Initialize cp register with kZero, CEntryStub will use it to set the |
+ // current context on the isolate. |
+ __ Move(cp, Smi::kZero); |
+ __ CallRuntime(Runtime::kWasmCompileLazy); |
+ // Store returned instruction start in x8. |
+ __ Add(x8, x0, Code::kHeaderSize - kHeapObjectTag); |
+ |
+ // Restore registers. |
+ __ PopDRegList(fp_regs); |
+ __ PopXRegList(gp_regs); |
+ } |
+ // Now jump to the instructions of the returned code object. |
+ __ Jump(x8); |
+} |
+ |
#undef __ |
} // namespace internal |