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:
Cormac Shannon
2026-03-12 22:47:25 +00:00
parent f88b17959f
commit f09a033160
9 changed files with 46 additions and 78 deletions

View File

@@ -94,6 +94,7 @@ static const char *const opnames[] = {
"SETLIST",
"CLOSURE",
"VARARG",
"LUSH",
"GETVARG",
"ERRNNIL",
"VARARGPREP",