lua-users home
lua-l archive

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


David Given wrote:
> I'm rather curious to know what it would be
> like with LuaJIT 2 when that comes out.

This won't work since you're patching Lua bytecode. LJ2 has a
completely different bytecode. It also stores more details needed
by the trace recorder for efficient tracing (e.g. loop control
flow or stack slot allocation). The fact that Lua is a goto-free
language simplifies the design a lot. :-)

But LJ2 is of course fully compatible to Lua at the source level.
So if you want to use it as a backend, you need to transform the
BB graph into Lua source with standard control flow constructs.
See Muchnick, chapter 7.7: "Structural Analysis".

--Mike