From 9904c253da9690728710082cfb94654709ab89e7 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 27 Jun 2024 11:24:27 -0300 Subject: Flexible limit for use of registers by constructors Instead of a fixed limit of 50 registers (which, in a bad worst case, can limit the nesting of constructors to 5 levels), the compiler computes an individual limit for each constructor based on how many registers are available when it runs. This limit then controls the frequency of SETLIST instructions. --- lcode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lcode.c') diff --git a/lcode.c b/lcode.c index bc0a3341..a74c2a16 100644 --- a/lcode.c +++ b/lcode.c @@ -1804,7 +1804,7 @@ void luaK_settablesize (FuncState *fs, int pc, int ra, int asize, int hsize) { ** table (or LUA_MULTRET to add up to stack top). */ void luaK_setlist (FuncState *fs, int base, int nelems, int tostore) { - lua_assert(tostore != 0 && tostore <= LFIELDS_PER_FLUSH); + lua_assert(tostore != 0); if (tostore == LUA_MULTRET) tostore = 0; if (nelems <= MAXARG_C) -- cgit v1.2.3-55-g6feb