lua-users home
lua-l archive

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


On Thu, Aug 13, 2009 at 8:08 PM, Doug
Rogers<doug.rogers@elbitsystems-us.com> wrote:
> Your replacement of SETLIST by TUPLE and DETUPLE was a nice insight into how
> to achieve the goal. And as I scanned the diff, I noticed quite a few places
> where there were more leading '-' than '+' characters; that's always a good
> sign that you're on the right track. Of course the final product contained
> more '+' lines, especially when it came time to tweak the VM.

SETLIST is totally separate from DE/TUPLE. The changing of SETLIST is
the reason for most of the removed lines; the new SETLIST simplifies
the bytecode format, and allows simple and efficient expansion of
expressions in table constructors, with the cost being increased
memory usage from each table being increased by sizeof(int). DE/TUPLE
are the reason for most of the added lines, and are for the very
separate issue of expanding expressions within an expression list. The
TUPLE instruction complicates writing a strong bytecode verifier, as
such a verifier would need to guarantee that a tuple isn't used for
anything other than a DETUPLE instruction. As the current verifier is
considered broken and is probably being removed in 5.2, I don't
consider breaking the bytecode verifier further to be too big of a
crime.