new opcode LOADI (for loading immediate integers)

This commit is contained in:
Roberto Ierusalimschy
2017-04-20 16:53:55 -03:00
parent c354211744
commit 6a98aa0bb0
6 changed files with 27 additions and 12 deletions

7
lvm.c
View File

@@ -1,5 +1,5 @@
/*
** $Id: lvm.c,v 2.269 2017/04/06 13:08:56 roberto Exp roberto $
** $Id: lvm.c,v 2.270 2017/04/11 18:41:09 roberto Exp roberto $
** Lua virtual machine
** See Copyright Notice in lua.h
*/
@@ -808,6 +808,11 @@ void luaV_execute (lua_State *L) {
setobj2s(L, ra, rb);
vmbreak;
}
vmcase(OP_LOADI) {
lua_Integer b = GETARG_sBx(i);
setivalue(ra, b);
vmbreak;
}
vmcase(OP_LOADKX) {
TValue *rb;
lua_assert(GET_OPCODE(*ci->u.l.savedpc) == OP_EXTRAARG);