[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Is there any plan to make luajit support bytecode?
- From: Mike Pall <mikelu-1104@...>
- Date: Thu, 14 Apr 2011 20:38:43 +0200
Adam Strzelecki wrote:
> Started peeking in LuaJIT code. I wonder if there are any
> caveats in thinking that GCproto serialization/deserialization
> is sufficient to mimic "luac" compilation - dumping BC,
> constants and variable info into binary file with some own
> LuaJIT signature, i.e. "\033LJ2".
>
> Seems to me that GCproto is pretty self-contained having all
> necessary information about script. What's not clear to me is
> how to encode constants, especially whether they are just simple
> types, or tables too.
Well, it's not that easy because the constants may contain nested
GCproto objects or template tables holding more constants. And
you'll need to intern some constants upon deserialization, but not
others. The VM probably needs some changes to handle loading
bytecode efficiently. Haven't looked into this in detail.
--Mike