diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-11-06 19:41:53 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-11-06 19:41:53 -0200 |
commit | 26bf2adaceb18877d836174226d2bfdc3f1fc512 (patch) | |
tree | b23ccd2e297e7c5e732ce65e88f35145271f7faa /lvm.c | |
parent | fd48dcc7c8734091181d8d0e54b0ba3d1770f4c3 (diff) | |
download | lua-26bf2adaceb18877d836174226d2bfdc3f1fc512.tar.gz lua-26bf2adaceb18877d836174226d2bfdc3f1fc512.tar.bz2 lua-26bf2adaceb18877d836174226d2bfdc3f1fc512.zip |
optimizations for space in LClosures and time cleanning weak tables
Diffstat (limited to 'lvm.c')
-rw-r--r-- | lvm.c | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lvm.c,v 1.196 2001/10/25 19:14:14 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 1.197 2001/10/31 19:58:11 roberto Exp $ |
3 | ** Lua virtual machine | 3 | ** Lua virtual machine |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -391,8 +391,8 @@ StkId luaV_execute (lua_State *L, const LClosure *cl, StkId base) { | |||
391 | } | 391 | } |
392 | case OP_GETUPVAL: { | 392 | case OP_GETUPVAL: { |
393 | int b = GETARG_B(i); | 393 | int b = GETARG_B(i); |
394 | lua_assert(cl->upvals[b].heap || cl->upvals[b].val < base); | 394 | lua_assert(isclosed(cl->upvals[b]) || cl->upvals[b] < base); |
395 | setobj(ra, cl->upvals[b].val); | 395 | setobj(ra, cl->upvals[b]); |
396 | break; | 396 | break; |
397 | } | 397 | } |
398 | case OP_GETGLOBAL: { | 398 | case OP_GETGLOBAL: { |
@@ -411,8 +411,8 @@ StkId luaV_execute (lua_State *L, const LClosure *cl, StkId base) { | |||
411 | } | 411 | } |
412 | case OP_SETUPVAL: { | 412 | case OP_SETUPVAL: { |
413 | int b = GETARG_B(i); | 413 | int b = GETARG_B(i); |
414 | lua_assert(cl->upvals[b].heap || cl->upvals[b].val < base); | 414 | lua_assert(isclosed(cl->upvals[b]) || cl->upvals[b] < base); |
415 | setobj(cl->upvals[b].val, ra); | 415 | setobj(cl->upvals[b], ra); |
416 | break; | 416 | break; |
417 | } | 417 | } |
418 | case OP_SETTABLE: { | 418 | case OP_SETTABLE: { |
@@ -649,8 +649,7 @@ StkId luaV_execute (lua_State *L, const LClosure *cl, StkId base) { | |||
649 | ncl->l.upvals[j] = cl->upvals[GETARG_B(*pc)]; | 649 | ncl->l.upvals[j] = cl->upvals[GETARG_B(*pc)]; |
650 | else { | 650 | else { |
651 | lua_assert(GET_OPCODE(*pc) == OP_MOVE); | 651 | lua_assert(GET_OPCODE(*pc) == OP_MOVE); |
652 | ncl->l.upvals[j].heap = NULL; | 652 | ncl->l.upvals[j] = base + GETARG_B(*pc); |
653 | ncl->l.upvals[j].val = base + GETARG_B(*pc); | ||
654 | } | 653 | } |
655 | } | 654 | } |
656 | luaF_LConlist(L, ncl); | 655 | luaF_LConlist(L, ncl); |