lua-users home
lua-l archive

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


> Rather than requiring a larger instruction word (and be incompatible with 
> any libraries that contain 'compiled' code rather than text), I have added 
> an OP_PRELOADK, which loads a prefix number for the high-bits of the 
> constant index.  This is only used if the constant table reference would 
> exceed the Bx field size.  Then the OP_LOADK will use this prefix value 
> shifted up by SIZE_Bx, or'ed with its normal constant index.

Another option is to use the same approach that OP_SETLIST uses. Create
the usual OP_LOADK with a special value at Bx ("-1") and store the
real index as a plain integer in the next slot.

-- Roberto