lua-users home
lua-l archive

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


> Hmmm.  Did that change add much complexity to the compiler?  In
> particular, the logic in the compiler that has to fall back on a
> multi-instruction sequence when the number of constants is large?

It does add complexity, but not in that part. The complexity comes
because now there are several different kinds of operands and
instructions for one same operation. For instance, a sum can be
coded with OP_ADD (two registers), OP_ADDI (a register plus an
immediate small integer), and OP_ADDK (a register plus a constant
in the contant table). Moreover, 1+x is coded as x+1 to use OP_ADDI.

-- Roberto