aboutsummaryrefslogtreecommitdiff
path: root/ltm.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2018-02-07 13:18:04 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2018-02-07 13:18:04 -0200
commit318a9a5859826d7af0294664e206236fc8814319 (patch)
tree31a00af286880036e5ef165fbbdaf7df9a04cfc1 /ltm.c
parent73d797ce7ea4c547cb97e39633a71a242c7356c8 (diff)
downloadlua-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.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ltm.c b/ltm.c
index 64622f20..f36f4625 100644
--- a/ltm.c
+++ b/ltm.c
@@ -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
219void luaT_adjustvarargs (lua_State *L, int nfixparams, int actual) { 219void 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 */