I was confused about LuaJIT’s trace link and exit.
I thought every trace will exit via int LJ_FASTCALL lj_trace_exit(jit_State *J, void *exptr)
, but the trace link return
didn’t invoke this function,
even the function LJ_FUNC const BCIns *lj_snap_restore(jit_State *J, void *exptr)
at all.
But when a trace exit to the interpreter(ignore sidetrace here), the register
will restore from the corresponding snapshot. So how did the trace link “return” restore it’s register when it exit to the interpreter?
And when did the link setted in lj_record_stop
was used? in the end of the corresponding MC?