Optimization for vararg tables
A vararg table can be virtual. If the vararg table is used only as a base in indexing expressions, the code does not need to create an actual table for it. Instead, it compiles the indexing expressions into direct accesses to the internal vararg data.
This commit is contained in:
6
lvm.c
6
lvm.c
@@ -1926,6 +1926,12 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
|
||||
Protect(luaT_getvarargs(L, ci, ra, n));
|
||||
vmbreak;
|
||||
}
|
||||
vmcase(OP_GETVARG) {
|
||||
StkId ra = RA(i);
|
||||
TValue *rc = vRC(i);
|
||||
luaT_getvararg(ci, ra, rc);
|
||||
vmbreak;
|
||||
}
|
||||
vmcase(OP_VARARGPREP) {
|
||||
ProtectNT(luaT_adjustvarargs(L, ci, cl->p));
|
||||
if (l_unlikely(trap)) { /* previous "Protect" updated trap */
|
||||
|
||||
Reference in New Issue
Block a user