diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-05-04 17:42:28 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-05-04 17:42:28 -0300 |
commit | 65f4a0f636eede0f026d0205ac929bc5a56f8b9c (patch) | |
tree | 28ad2176e61cb97c808f61ecf6ad2d46cef8463c | |
parent | 12acca7bd8168e12a09c345416ffd848e48b9ba4 (diff) | |
download | lua-65f4a0f636eede0f026d0205ac929bc5a56f8b9c.tar.gz lua-65f4a0f636eede0f026d0205ac929bc5a56f8b9c.tar.bz2 lua-65f4a0f636eede0f026d0205ac929bc5a56f8b9c.zip |
no more compatibility code for traversing tables
-rw-r--r-- | ldebug.c | 3 | ||||
-rw-r--r-- | lopcodes.c | 4 | ||||
-rw-r--r-- | lopcodes.h | 4 | ||||
-rw-r--r-- | lparser.c | 4 | ||||
-rw-r--r-- | lvm.c | 10 |
5 files changed, 6 insertions, 19 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldebug.c,v 2.14 2005/04/05 13:41:29 roberto Exp roberto $ | 2 | ** $Id: ldebug.c,v 2.15 2005/04/14 13:30:47 roberto Exp roberto $ |
3 | ** Debug Interface | 3 | ** Debug Interface |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -368,7 +368,6 @@ static Instruction symbexec (const Proto *pt, int lastpc, int reg) { | |||
368 | if (reg >= a+3) last = pc; /* affect all regs above its call base */ | 368 | if (reg >= a+3) last = pc; /* affect all regs above its call base */ |
369 | break; | 369 | break; |
370 | } | 370 | } |
371 | case OP_TFORPREP: | ||
372 | case OP_FORLOOP: | 371 | case OP_FORLOOP: |
373 | case OP_FORPREP: | 372 | case OP_FORPREP: |
374 | checkreg(pt, a+3); | 373 | checkreg(pt, a+3); |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lopcodes.c,v 1.31 2005/03/08 18:00:16 roberto Exp roberto $ | 2 | ** $Id: lopcodes.c,v 1.32 2005/03/16 16:59:21 roberto Exp roberto $ |
3 | ** See Copyright Notice in lua.h | 3 | ** See Copyright Notice in lua.h |
4 | */ | 4 | */ |
5 | 5 | ||
@@ -49,7 +49,6 @@ const char *const luaP_opnames[NUM_OPCODES+1] = { | |||
49 | "FORLOOP", | 49 | "FORLOOP", |
50 | "FORPREP", | 50 | "FORPREP", |
51 | "TFORLOOP", | 51 | "TFORLOOP", |
52 | "TFORPREP", | ||
53 | "SETLIST", | 52 | "SETLIST", |
54 | "CLOSE", | 53 | "CLOSE", |
55 | "CLOSURE", | 54 | "CLOSURE", |
@@ -95,7 +94,6 @@ const lu_byte luaP_opmodes[NUM_OPCODES] = { | |||
95 | ,opmode(0, 1, OpArgR, OpArgN, iAsBx) /* OP_FORLOOP */ | 94 | ,opmode(0, 1, OpArgR, OpArgN, iAsBx) /* OP_FORLOOP */ |
96 | ,opmode(0, 1, OpArgR, OpArgN, iAsBx) /* OP_FORPREP */ | 95 | ,opmode(0, 1, OpArgR, OpArgN, iAsBx) /* OP_FORPREP */ |
97 | ,opmode(1, 0, OpArgN, OpArgU, iABC) /* OP_TFORLOOP */ | 96 | ,opmode(1, 0, OpArgN, OpArgU, iABC) /* OP_TFORLOOP */ |
98 | ,opmode(0, 0, OpArgR, OpArgN, iAsBx) /* OP_TFORPREP */ | ||
99 | ,opmode(0, 0, OpArgU, OpArgU, iABC) /* OP_SETLIST */ | 97 | ,opmode(0, 0, OpArgU, OpArgU, iABC) /* OP_SETLIST */ |
100 | ,opmode(0, 0, OpArgN, OpArgN, iABC) /* OP_CLOSE */ | 98 | ,opmode(0, 0, OpArgN, OpArgN, iABC) /* OP_CLOSE */ |
101 | ,opmode(0, 1, OpArgU, OpArgN, iABx) /* OP_CLOSURE */ | 99 | ,opmode(0, 1, OpArgU, OpArgN, iABx) /* OP_CLOSURE */ |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lopcodes.h,v 1.117 2005/03/09 16:28:07 roberto Exp roberto $ | 2 | ** $Id: lopcodes.h,v 1.118 2005/03/16 16:59:21 roberto Exp roberto $ |
3 | ** Opcodes for Lua virtual machine | 3 | ** Opcodes for Lua virtual machine |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -197,8 +197,6 @@ OP_FORPREP,/* A sBx R(A)-=R(A+2); pc+=sBx */ | |||
197 | 197 | ||
198 | OP_TFORLOOP,/* A C R(A+2), ... ,R(A+2+C) := R(A)(R(A+1), R(A+2)); | 198 | OP_TFORLOOP,/* A C R(A+2), ... ,R(A+2+C) := R(A)(R(A+1), R(A+2)); |
199 | if R(A+2) ~= nil then pc++ */ | 199 | if R(A+2) ~= nil then pc++ */ |
200 | OP_TFORPREP,/* A sBx if type(R(A)) == table then R(A+1):=R(A), R(A):=next; | ||
201 | pc+=sBx */ | ||
202 | 200 | ||
203 | OP_SETLIST,/* A B C R(A)[(C-1)*FPF+i] := R(A+i), 1 <= i <= B */ | 201 | OP_SETLIST,/* A B C R(A)[(C-1)*FPF+i] := R(A+i), 1 <= i <= B */ |
204 | 202 | ||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lparser.c,v 2.22 2005/04/29 12:43:47 roberto Exp roberto $ | 2 | ** $Id: lparser.c,v 2.23 2005/05/04 16:36:23 roberto Exp roberto $ |
3 | ** Lua Parser | 3 | ** Lua Parser |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -1070,7 +1070,7 @@ static void forbody (LexState *ls, int base, int line, int nvars, int isnum) { | |||
1070 | int prep, endfor; | 1070 | int prep, endfor; |
1071 | adjustlocalvars(ls, 3); /* control variables */ | 1071 | adjustlocalvars(ls, 3); /* control variables */ |
1072 | checknext(ls, TK_DO); | 1072 | checknext(ls, TK_DO); |
1073 | prep = luaK_codeAsBx(fs, (isnum ? OP_FORPREP : OP_TFORPREP), base, NO_JUMP); | 1073 | prep = isnum ? luaK_codeAsBx(fs, OP_FORPREP, base, NO_JUMP) : luaK_jump(fs); |
1074 | enterblock(fs, &bl, 0); /* scope for declared variables */ | 1074 | enterblock(fs, &bl, 0); /* scope for declared variables */ |
1075 | adjustlocalvars(ls, nvars); | 1075 | adjustlocalvars(ls, nvars); |
1076 | luaK_reserveregs(fs, nvars); | 1076 | luaK_reserveregs(fs, nvars); |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lvm.c,v 2.40 2005/05/03 19:01:17 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 2.41 2005/05/03 19:30:17 roberto Exp roberto $ |
3 | ** Lua virtual machine | 3 | ** Lua virtual machine |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -714,14 +714,6 @@ StkId luaV_execute (lua_State *L, int nexeccalls) { | |||
714 | } | 714 | } |
715 | continue; | 715 | continue; |
716 | } | 716 | } |
717 | case OP_TFORPREP: { /* for compatibility only */ | ||
718 | if (ttistable(ra)) { | ||
719 | setobjs2s(L, ra+1, ra); | ||
720 | setobj2s(L, ra, luaH_getstr(hvalue(gt(L)), luaS_new(L, "next"))); | ||
721 | } | ||
722 | dojump(L, pc, GETARG_sBx(i)); | ||
723 | continue; | ||
724 | } | ||
725 | case OP_SETLIST: { | 717 | case OP_SETLIST: { |
726 | int n = GETARG_B(i); | 718 | int n = GETARG_B(i); |
727 | int c = GETARG_C(i); | 719 | int c = GETARG_C(i); |