aboutsummaryrefslogtreecommitdiff
path: root/lvm.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2009-05-22 12:19:54 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2009-05-22 12:19:54 -0300
commiteea6d10866f04a7062d8d7d02984770b220d940e (patch)
tree2e3af8bbd30edf3eb93b9476aff2aca30c14fbb0 /lvm.c
parent019ebcb85fa5ab03f424e21f6758d8533a5b3126 (diff)
downloadlua-eea6d10866f04a7062d8d7d02984770b220d940e.tar.gz
lua-eea6d10866f04a7062d8d7d02984770b220d940e.tar.bz2
lua-eea6d10866f04a7062d8d7d02984770b220d940e.zip
details (use ci->base instead of L->base when possible)
Diffstat (limited to 'lvm.c')
-rw-r--r--lvm.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lvm.c b/lvm.c
index a2720a0a..a6207984 100644
--- a/lvm.c
+++ b/lvm.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lvm.c,v 2.86 2009/04/17 22:00:01 roberto Exp roberto $ 2** $Id: lvm.c,v 2.87 2009/04/30 17:42:21 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*/
@@ -364,7 +364,7 @@ void luaV_finishOp (lua_State *L) {
364 case OP_ADD: case OP_SUB: case OP_MUL: case OP_DIV: 364 case OP_ADD: case OP_SUB: case OP_MUL: case OP_DIV:
365 case OP_MOD: case OP_POW: case OP_UNM: case OP_LEN: 365 case OP_MOD: case OP_POW: case OP_UNM: case OP_LEN:
366 case OP_GETGLOBAL: case OP_GETTABLE: case OP_SELF: { 366 case OP_GETGLOBAL: case OP_GETTABLE: case OP_SELF: {
367 setobjs2s(L, L->base + GETARG_A(inst), --L->top); 367 setobjs2s(L, ci->base + GETARG_A(inst), --L->top);
368 break; 368 break;
369 } 369 }
370 case OP_LE: case OP_LT: case OP_EQ: { 370 case OP_LE: case OP_LT: case OP_EQ: {
@@ -373,7 +373,7 @@ void luaV_finishOp (lua_State *L) {
373 /* metamethod should not be called when operand is K */ 373 /* metamethod should not be called when operand is K */
374 lua_assert(!ISK(GETARG_B(inst))); 374 lua_assert(!ISK(GETARG_B(inst)));
375 if (GET_OPCODE(inst) == OP_LE && /* "<=" using "<" instead? */ 375 if (GET_OPCODE(inst) == OP_LE && /* "<=" using "<" instead? */
376 ttisnil(luaT_gettmbyobj(L, L->base + GETARG_B(inst), TM_LE))) 376 ttisnil(luaT_gettmbyobj(L, ci->base + GETARG_B(inst), TM_LE)))
377 res = !res; /* invert result */ 377 res = !res; /* invert result */
378 lua_assert(GET_OPCODE(*ci->u.l.savedpc) == OP_JMP); 378 lua_assert(GET_OPCODE(*ci->u.l.savedpc) == OP_JMP);
379 if (res != GETARG_A(inst)) /* condition failed? */ 379 if (res != GETARG_A(inst)) /* condition failed? */
@@ -382,7 +382,7 @@ void luaV_finishOp (lua_State *L) {
382 } 382 }
383 case OP_CONCAT: { 383 case OP_CONCAT: {
384 StkId top = L->top - 1; /* top when __concat was called */ 384 StkId top = L->top - 1; /* top when __concat was called */
385 int last = cast_int(top - L->base) - 2; /* last element and ... */ 385 int last = cast_int(top - ci->base) - 2; /* last element and ... */
386 int b = GETARG_B(inst); /* ... first element to concatenate */ 386 int b = GETARG_B(inst); /* ... first element to concatenate */
387 int total = last - b + 1; /* number of elements to concatenate */ 387 int total = last - b + 1; /* number of elements to concatenate */
388 setobj2s(L, top - 2, top); /* put TM result in proper position */ 388 setobj2s(L, top - 2, top); /* put TM result in proper position */
@@ -390,7 +390,7 @@ void luaV_finishOp (lua_State *L) {
390 if (total > 1) /* are there elements to concat? */ 390 if (total > 1) /* are there elements to concat? */
391 luaV_concat(L, total, last); /* concat them (may yield again) */ 391 luaV_concat(L, total, last); /* concat them (may yield again) */
392 /* move final result to final position */ 392 /* move final result to final position */
393 setobj2s(L, L->base + GETARG_A(inst), L->base + b); 393 setobj2s(L, ci->base + GETARG_A(inst), ci->base + b);
394 break; 394 break;
395 } 395 }
396 case OP_TFORCALL: { 396 case OP_TFORCALL: {
@@ -670,7 +670,7 @@ void luaV_execute (lua_State *L) {
670 for (aux = 0; nfunc+aux < L->top; aux++) /* move frame down */ 670 for (aux = 0; nfunc+aux < L->top; aux++) /* move frame down */
671 setobjs2s(L, ofunc + aux, nfunc + aux); 671 setobjs2s(L, ofunc + aux, nfunc + aux);
672 oci->top = L->top = ofunc + aux; /* correct top */ 672 oci->top = L->top = ofunc + aux; /* correct top */
673 lua_assert(L->top == L->base + clvalue(ofunc)->l.p->maxstacksize); 673 lua_assert(L->top == oci->base + clvalue(ofunc)->l.p->maxstacksize);
674 oci->u.l.savedpc = nci->u.l.savedpc; 674 oci->u.l.savedpc = nci->u.l.savedpc;
675 oci->u.l.tailcalls++; /* one more call lost */ 675 oci->u.l.tailcalls++; /* one more call lost */
676 ci = L->ci = oci; /* remove new frame */ 676 ci = L->ci = oci; /* remove new frame */