diff options
Diffstat (limited to 'lcode.c')
| -rw-r--r-- | lcode.c | 14 |
1 files changed, 2 insertions, 12 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lcode.c,v 2.43 2010/01/11 17:38:30 roberto Exp roberto $ | 2 | ** $Id: lcode.c,v 2.44 2010/02/26 20:40:29 roberto Exp roberto $ |
| 3 | ** Code generator for Lua | 3 | ** Code generator for Lua |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -372,11 +372,6 @@ void luaK_dischargevars (FuncState *fs, expdesc *e) { | |||
| 372 | e->k = VRELOCABLE; | 372 | e->k = VRELOCABLE; |
| 373 | break; | 373 | break; |
| 374 | } | 374 | } |
| 375 | case VGLOBAL: { | ||
| 376 | e->u.s.info = luaK_codeABxX(fs, OP_GETGLOBAL, 0, e->u.s.info); | ||
| 377 | e->k = VRELOCABLE; | ||
| 378 | break; | ||
| 379 | } | ||
| 380 | case VINDEXED: { | 375 | case VINDEXED: { |
| 381 | freereg(fs, e->u.s.aux); | 376 | freereg(fs, e->u.s.aux); |
| 382 | freereg(fs, e->u.s.info); | 377 | freereg(fs, e->u.s.info); |
| @@ -555,11 +550,6 @@ void luaK_storevar (FuncState *fs, expdesc *var, expdesc *ex) { | |||
| 555 | luaK_codeABC(fs, OP_SETUPVAL, e, var->u.s.info, 0); | 550 | luaK_codeABC(fs, OP_SETUPVAL, e, var->u.s.info, 0); |
| 556 | break; | 551 | break; |
| 557 | } | 552 | } |
| 558 | case VGLOBAL: { | ||
| 559 | int e = luaK_exp2anyreg(fs, ex); | ||
| 560 | luaK_codeABxX(fs, OP_SETGLOBAL, e, var->u.s.info); | ||
| 561 | break; | ||
| 562 | } | ||
| 563 | case VINDEXED: { | 553 | case VINDEXED: { |
| 564 | int e = luaK_exp2RK(fs, ex); | 554 | int e = luaK_exp2RK(fs, ex); |
| 565 | luaK_codeABC(fs, OP_SETTABLE, var->u.s.info, var->u.s.aux, e); | 555 | luaK_codeABC(fs, OP_SETTABLE, var->u.s.info, var->u.s.aux, e); |
| @@ -584,9 +574,9 @@ void luaK_self (FuncState *fs, expdesc *e, expdesc *key) { | |||
| 584 | luaK_exp2anyreg(fs, e); | 574 | luaK_exp2anyreg(fs, e); |
| 585 | freeexp(fs, e); | 575 | freeexp(fs, e); |
| 586 | func = fs->freereg; | 576 | func = fs->freereg; |
| 587 | luaK_reserveregs(fs, 2); | ||
| 588 | luaK_codeABC(fs, OP_SELF, func, e->u.s.info, luaK_exp2RK(fs, key)); | 577 | luaK_codeABC(fs, OP_SELF, func, e->u.s.info, luaK_exp2RK(fs, key)); |
| 589 | freeexp(fs, key); | 578 | freeexp(fs, key); |
| 579 | luaK_reserveregs(fs, 2); | ||
| 590 | e->u.s.info = func; | 580 | e->u.s.info = func; |
| 591 | e->k = VNONRELOC; | 581 | e->k = VNONRELOC; |
| 592 | } | 582 | } |
