lua-users home
lua-l archive

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


Mark Hamburg wrote:
I was just reading the Lua VM paper. OP_SELF takes a register or a constant
as the method name? How does one get the compiler to generate the register
version?

See luaK_exp2RK(fs, key) in function luaK_self(), in lcode.c (5.0.2). It is possible for the constant number to not fit in the instruction's C field; that will take lots of methods.

--
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia