diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-02-07 13:18:04 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-02-07 13:18:04 -0200 |
commit | 318a9a5859826d7af0294664e206236fc8814319 (patch) | |
tree | 31a00af286880036e5ef165fbbdaf7df9a04cfc1 /ltm.c | |
parent | 73d797ce7ea4c547cb97e39633a71a242c7356c8 (diff) | |
download | lua-318a9a5859826d7af0294664e206236fc8814319.tar.gz lua-318a9a5859826d7af0294664e206236fc8814319.tar.bz2 lua-318a9a5859826d7af0294664e206236fc8814319.zip |
new opcode 'PREPVARARG'
(avoids test for vararg function in all function calls)
Diffstat (limited to 'ltm.c')
-rw-r--r-- | ltm.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltm.c,v 2.57 2018/01/28 12:08:04 roberto Exp roberto $ | 2 | ** $Id: ltm.c,v 2.58 2018/01/28 13:39:52 roberto Exp roberto $ |
3 | ** Tag methods | 3 | ** Tag methods |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -216,10 +216,11 @@ int luaT_callorderiTM (lua_State *L, const TValue *p1, int v2, | |||
216 | } | 216 | } |
217 | 217 | ||
218 | 218 | ||
219 | void luaT_adjustvarargs (lua_State *L, int nfixparams, int actual) { | 219 | void luaT_adjustvarargs (lua_State *L, int nfixparams, StkId base) { |
220 | int i; | 220 | int i; |
221 | Table *vtab; | 221 | Table *vtab; |
222 | TValue nname; | 222 | TValue nname; |
223 | int actual = cast_int(L->top - base); /* number of arguments */ | ||
223 | int nextra = actual - nfixparams; /* number of extra arguments */ | 224 | int nextra = actual - nfixparams; /* number of extra arguments */ |
224 | vtab = luaH_new(L); /* create vararg table */ | 225 | vtab = luaH_new(L); /* create vararg table */ |
225 | sethvalue2s(L, L->top, vtab); /* anchor it for resizing */ | 226 | sethvalue2s(L, L->top, vtab); /* anchor it for resizing */ |