change in opcode OP_LOADNIL: B is used as a counter instead of a

register. (Avoids an assignment to R(B), not present in any other
instruction.)
This commit is contained in:
Roberto Ierusalimschy
2011-04-19 13:22:13 -03:00
parent a4e644add2
commit 4758113043
5 changed files with 22 additions and 18 deletions

8
lvm.c
View File

@@ -1,5 +1,5 @@
/*
** $Id: lvm.c,v 2.134 2011/04/07 18:14:12 roberto Exp roberto $
** $Id: lvm.c,v 2.135 2011/04/18 19:48:53 roberto Exp roberto $
** Lua virtual machine
** See Copyright Notice in lua.h
*/
@@ -541,10 +541,10 @@ void luaV_execute (lua_State *L) {
if (GETARG_C(i)) ci->u.l.savedpc++; /* skip next instruction (if C) */
)
vmcase(OP_LOADNIL,
TValue *rb = RB(i);
int b = GETARG_B(i);
do {
setnilvalue(rb--);
} while (rb >= ra);
setnilvalue(ra++);
} while (b--);
)
vmcase(OP_GETUPVAL,
int b = GETARG_B(i);