Re: copy suspended coroutine

  • From: Karel Tuma <kat@xxxxxx>
  • To: luajit <luajit@xxxxxxxxxxxxx>
  • Date: Thu, 06 Nov 2014 21:49:27 +0100

Excerpts from Daniel Ritchie's message of 2014-11-06 21:10:36 +0100:
> Greetings,
> 
> I recently found an old post Mike made on the Lua users list that 
> describes how to copy a suspended coroutine:
> 
> http://lua-users.org/lists/lua-l/2006-01/msg00652.html

I'm very curious about this myself! Everything else seems
to be straight port with no issues (incl JIT, or better said,
lack of thereof for coroutine.*). However the CallInfo
'copy frames' loop is different.

In LuaJIT, the call chain seems to use custom, more compact structure,
which is hardwired to asm interpreter, you'll find it in lj_frame.h.

One can glean how Rio 5.1 translates to LJ through the code which does
stack traces and similiar.

If you get a working prototype which handles call stack properly, please
post it if you can.

- k

Other related posts: