aboutsummaryrefslogtreecommitdiff
path: root/lvm.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2005-08-09 16:49:04 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2005-08-09 16:49:04 -0300
commit44b19075c0fa4310d312147ee1d74dc11ff36eba (patch)
treeda10448271a24dc9f0f24e5123fdf8918f9c7228 /lvm.c
parentab3dfa55948a670c35152ffd965d218ad48f871a (diff)
downloadlua-44b19075c0fa4310d312147ee1d74dc11ff36eba.tar.gz
lua-44b19075c0fa4310d312147ee1d74dc11ff36eba.tar.bz2
lua-44b19075c0fa4310d312147ee1d74dc11ff36eba.zip
small changes (to easy integration with Coco)
Diffstat (limited to 'lvm.c')
-rw-r--r--lvm.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/lvm.c b/lvm.c
index 037d696e..c177e9fc 100644
--- a/lvm.c
+++ b/lvm.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lvm.c,v 2.48 2005/07/05 14:31:20 roberto Exp roberto $ 2** $Id: lvm.c,v 2.49 2005/08/09 17:42:02 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*/
@@ -362,13 +362,7 @@ StkId luaV_execute (lua_State *L, int nexeccalls) {
362 StkId base; 362 StkId base;
363 TValue *k; 363 TValue *k;
364 const Instruction *pc; 364 const Instruction *pc;
365 callentry: /* entry point when calling new functions */ 365 reentry: /* entry point */
366 if (L->hookmask & LUA_MASKCALL) {
367 L->savedpc++; /* hooks assume 'pc' is already incremented */
368 luaD_callhook(L, LUA_HOOKCALL, -1);
369 L->savedpc--; /* correct 'pc' */
370 }
371 retentry: /* entry point when returning to old functions */
372 pc = L->savedpc; 366 pc = L->savedpc;
373 cl = &clvalue(L->ci->func)->l; 367 cl = &clvalue(L->ci->func)->l;
374 base = L->base; 368 base = L->base;
@@ -618,7 +612,7 @@ StkId luaV_execute (lua_State *L, int nexeccalls) {
618 switch (luaD_precall(L, ra, nresults)) { 612 switch (luaD_precall(L, ra, nresults)) {
619 case PCRLUA: { 613 case PCRLUA: {
620 nexeccalls++; 614 nexeccalls++;
621 goto callentry; /* restart luaV_execute over new Lua function */ 615 goto reentry; /* restart luaV_execute over new Lua function */
622 } 616 }
623 case PCRC: { 617 case PCRC: {
624 /* it was a C function (`precall' called it); adjust results */ 618 /* it was a C function (`precall' called it); adjust results */
@@ -652,7 +646,7 @@ StkId luaV_execute (lua_State *L, int nexeccalls) {
652 ci->savedpc = L->savedpc; 646 ci->savedpc = L->savedpc;
653 ci->tailcalls++; /* one more call lost */ 647 ci->tailcalls++; /* one more call lost */
654 L->ci--; /* remove new frame */ 648 L->ci--; /* remove new frame */
655 goto callentry; 649 goto reentry;
656 } 650 }
657 case PCRC: { 651 case PCRC: {
658 /* it was a C function (`precall' called it) */ 652 /* it was a C function (`precall' called it) */
@@ -677,7 +671,7 @@ StkId luaV_execute (lua_State *L, int nexeccalls) {
677 lua_assert(GET_OPCODE(*((L->ci - 1)->savedpc - 1)) == OP_CALL); 671 lua_assert(GET_OPCODE(*((L->ci - 1)->savedpc - 1)) == OP_CALL);
678 luaD_poscall(L, nresults, ra); 672 luaD_poscall(L, nresults, ra);
679 if (nresults >= 0) L->top = L->ci->top; 673 if (nresults >= 0) L->top = L->ci->top;
680 goto retentry; 674 goto reentry;
681 } 675 }
682 } 676 }
683 case OP_FORLOOP: { 677 case OP_FORLOOP: {