Replace upvalue-based shell dispatch with OP_LUSH opcode
Add a dedicated OP_LUSH A B instruction that loads shell C functions directly from the registry, eliminating the need for upvalue allocation in mainfunc(), upvalue population in lua_load(), and the fragile LUSH_NUM_UPVALS heuristic. Every chunk no longer carries 4 extra upvalues.
This commit is contained in:
@@ -102,6 +102,7 @@ LUAI_DDEF const lu_byte luaP_opmodes[NUM_OPCODES] = {
|
||||
,opmode(0, 0, 1, 0, 0, ivABC) /* OP_SETLIST */
|
||||
,opmode(0, 0, 0, 0, 1, iABx) /* OP_CLOSURE */
|
||||
,opmode(0, 1, 0, 0, 1, iABC) /* OP_VARARG */
|
||||
,opmode(0, 0, 0, 0, 1, iABC) /* OP_LUSH */
|
||||
,opmode(0, 0, 0, 0, 1, iABC) /* OP_GETVARG */
|
||||
,opmode(0, 0, 0, 0, 0, iABx) /* OP_ERRNNIL */
|
||||
,opmode(0, 0, 1, 0, 1, iABC) /* OP_VARARGPREP */
|
||||
|
||||
Reference in New Issue
Block a user