diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-06-27 11:24:27 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-06-27 11:24:27 -0300 |
commit | 9904c253da9690728710082cfb94654709ab89e7 (patch) | |
tree | f556ebbf8d99baa37ea8e39608a3d6bea77f8267 /lcode.c | |
parent | fb7e5b76c9d41108c399cf4d16470018b717007b (diff) | |
download | lua-9904c253da9690728710082cfb94654709ab89e7.tar.gz lua-9904c253da9690728710082cfb94654709ab89e7.tar.bz2 lua-9904c253da9690728710082cfb94654709ab89e7.zip |
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.
Diffstat (limited to 'lcode.c')
-rw-r--r-- | lcode.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1804,7 +1804,7 @@ void luaK_settablesize (FuncState *fs, int pc, int ra, int asize, int hsize) { | |||
1804 | ** table (or LUA_MULTRET to add up to stack top). | 1804 | ** table (or LUA_MULTRET to add up to stack top). |
1805 | */ | 1805 | */ |
1806 | void luaK_setlist (FuncState *fs, int base, int nelems, int tostore) { | 1806 | void luaK_setlist (FuncState *fs, int base, int nelems, int tostore) { |
1807 | lua_assert(tostore != 0 && tostore <= LFIELDS_PER_FLUSH); | 1807 | lua_assert(tostore != 0); |
1808 | if (tostore == LUA_MULTRET) | 1808 | if (tostore == LUA_MULTRET) |
1809 | tostore = 0; | 1809 | tostore = 0; |
1810 | if (nelems <= MAXARG_C) | 1810 | if (nelems <= MAXARG_C) |