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:
@@ -338,6 +338,8 @@ OP_CLOSURE,/* A Bx R[A] := closure(KPROTO[Bx]) */
|
||||
|
||||
OP_VARARG,/* A C R[A], R[A+1], ..., R[A+C-2] = vararg */
|
||||
|
||||
OP_LUSH,/* A B R[A] := lush_func[B] */
|
||||
|
||||
OP_GETVARG, /* A B C R[A] := R[B][R[C]], R[B] is vararg parameter */
|
||||
|
||||
OP_ERRNNIL,/* A Bx raise error if R[A] ~= nil (K[Bx] is global name)*/
|
||||
|
||||
Reference in New Issue
Block a user