lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Venkat Murty wrote:
> /** The attached code prints out 202 lines with standard lua.
>     And 103 lines with LuaJIT. (LuaJIT-2.0.0-beta2)
>  */

Yield from hooks was simply not implemented at all. I've added it
to the git repo now -- thanks for the reminder!

Note that the behavior of the instruction hook is implementation-
dependent. The bytecode in LuaJIT 2.0 is different and hook
functions/counters are global and not per-coroutine.

And hooks are not called from compiled code, yet. Its not obvious
when or where they should be called, since there is only a loose
correspondence of compiled code to bytecode. The standard Lua
debug API operates at the wrong level and is not well suited for a
JIT compiler.

--Mike