new name for opcode

This commit is contained in:
Roberto Ierusalimschy
1999-02-09 16:01:55 -02:00
parent 77113ee02f
commit b82ff713e3
3 changed files with 8 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
/* /*
** $Id: lopcodes.h,v 1.23 1999/02/08 18:54:19 roberto Exp roberto $ ** $Id: lopcodes.h,v 1.24 1999/02/09 15:58:45 roberto Exp roberto $
** Opcodes for Lua virtual machine ** Opcodes for Lua virtual machine
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@@ -27,8 +27,8 @@ POPDUP,/* b v v TOP-=b */
PUSHNUMBERW,/* w - (float)w */ PUSHNUMBERW,/* w - (float)w */
PUSHNUMBER,/* b - (float)b */ PUSHNUMBER,/* b - (float)b */
PUSHNEGW,/* w - (float)-w */ PUSHNUMBERNEGW,/* w - (float)-w */
PUSHNEG,/* b - (float)-b */ PUSHNUMBERNEG,/* b - (float)-b */
PUSHCONSTANTW,/*w - CNST[w] */ PUSHCONSTANTW,/*w - CNST[w] */
PUSHCONSTANT,/* b - CNST[b] */ PUSHCONSTANT,/* b - CNST[b] */

View File

@@ -1,5 +1,5 @@
/* /*
** $Id: lparser.c,v 1.18 1999/02/08 18:54:19 roberto Exp roberto $ ** $Id: lparser.c,v 1.19 1999/02/09 15:59:10 roberto Exp roberto $
** LL(1) Parser and code generator for Lua ** LL(1) Parser and code generator for Lua
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@@ -270,7 +270,7 @@ static void code_number (LexState *ls, real f) {
real af = (f<0) ? -f : f; real af = (f<0) ? -f : f;
if (0 <= af && af <= (real)MAX_WORD && (int)af == af) { if (0 <= af && af <= (real)MAX_WORD && (int)af == af) {
/* abs(f) has a short integer value */ /* abs(f) has a short integer value */
code_oparg(ls, (f<0) ? PUSHNEG : PUSHNUMBER, (int)af, 1); code_oparg(ls, (f<0) ? PUSHNUMBERNEG : PUSHNUMBER, (int)af, 1);
} }
else else
code_constant(ls, real_constant(ls->fs, f)); code_constant(ls, real_constant(ls->fs, f));

6
lvm.c
View File

@@ -1,5 +1,5 @@
/* /*
** $Id: lvm.c,v 1.47 1999/02/08 18:54:19 roberto Exp roberto $ ** $Id: lvm.c,v 1.48 1999/02/09 15:58:45 roberto Exp roberto $
** Lua virtual machine ** Lua virtual machine
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@@ -359,8 +359,8 @@ StkId luaV_execute (Closure *cl, TProtoFunc *tf, StkId base) {
S->top++; S->top++;
break; break;
case PUSHNEGW: aux += highbyte(*pc++); case PUSHNUMBERNEGW: aux += highbyte(*pc++);
case PUSHNEG: aux += *pc++; case PUSHNUMBERNEG: aux += *pc++;
ttype(S->top) = LUA_T_NUMBER; ttype(S->top) = LUA_T_NUMBER;
nvalue(S->top) = -aux; nvalue(S->top) = -aux;
S->top++; S->top++;