diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-04-14 14:46:15 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-04-14 14:46:15 -0300 |
commit | 634c3d57e924f36812ccc5798d91236ae819c6d1 (patch) | |
tree | 31e810ab78448a4487989c498560c4192f9dc209 /ltests.c | |
parent | 4aa9ad6514a98fd4e25015f29e04877e67d9772d (diff) | |
download | lua-github-634c3d57e924f36812ccc5798d91236ae819c6d1.tar.gz |
optimization for SETLOCAL was too specific.
Diffstat (limited to 'ltests.c')
-rw-r--r-- | ltests.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -1,5 +1,5 @@ /* -** $Id: ltests.c,v 1.14 2000/04/12 19:56:50 roberto Exp roberto $ +** $Id: ltests.c,v 1.15 2000/04/13 16:51:01 roberto Exp roberto $ ** Internal Module for Debugging of the Lua Implementation ** See Copyright Notice in lua.h */ @@ -55,7 +55,7 @@ static void setnameval (lua_State *L, lua_Object t, const char *name, int val) { -static int printop (lua_State *L, Instruction i) { +static int pushop (lua_State *L, Instruction i) { char buff[100]; switch (GET_OPCODE(i)) { case OP_END: O("END"); lua_pushstring(L, buff); return 0; @@ -76,7 +76,7 @@ static int printop (lua_State *L, Instruction i) { case OP_GETINDEXED: U("GETINDEXED"); break; case OP_PUSHSELF: U("PUSHSELF"); break; case OP_CREATETABLE: U("CREATETABLE"); break; - case OP_SETLOCAL: AB("SETLOCAL"); break; + case OP_SETLOCAL: U("SETLOCAL"); break; case OP_SETGLOBAL: U("SETGLOBAL"); break; case OP_SETTABLE: AB("SETTABLE"); break; case OP_SETLIST: AB("SETLIST"); break; @@ -111,7 +111,7 @@ static int printop (lua_State *L, Instruction i) { return 1; } -static void printcode (lua_State *L) { +static void listcode (lua_State *L) { lua_Object o = luaL_nonnullarg(L, 1); lua_Object t = lua_createtable(L); Instruction *pc; @@ -125,7 +125,7 @@ static void printcode (lua_State *L) { do { lua_pushobject(L, t); lua_pushnumber(L, pc - p->code + 1); - res = printop(L, *pc++); + res = pushop(L, *pc++); lua_settable(L); } while (res); lua_pushobject(L, t); @@ -402,7 +402,7 @@ static void testC (lua_State *L) { static const struct luaL_reg tests_funcs[] = { {"hash", hash_query}, {"limits", get_limits}, - {"printcode", printcode}, + {"listcode", listcode}, {"querystr", string_query}, {"querytab", table_query}, {"testC", testC}, |