aboutsummaryrefslogtreecommitdiff
path: root/lvm.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2017-11-04 10:57:02 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2017-11-04 10:57:02 -0200
commit93fd67b7936f0f1fc20645d18eb85a193887c315 (patch)
tree11cd249fad6b0253f0de48b94c08ab08671b8544 /lvm.c
parent6bb3e40a8d2cdb64a6ac1962d8748dd638a11721 (diff)
downloadlua-93fd67b7936f0f1fc20645d18eb85a193887c315.tar.gz
lua-93fd67b7936f0f1fc20645d18eb85a193887c315.tar.bz2
lua-93fd67b7936f0f1fc20645d18eb85a193887c315.zip
no more 'CallInfo' structure
Diffstat (limited to 'lvm.c')
-rw-r--r--lvm.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/lvm.c b/lvm.c
index 28952da0..b1cf4666 100644
--- a/lvm.c
+++ b/lvm.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lvm.c,v 2.303 2017/11/03 17:22:54 roberto Exp roberto $ 2** $Id: lvm.c,v 2.304 2017/11/03 19:33:22 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*/
@@ -796,7 +796,6 @@ void luaV_finishOp (lua_State *L) {
796 796
797 797
798void luaV_execute (lua_State *L) { 798void luaV_execute (lua_State *L) {
799 CallInfo *ci = L->ci;
800 LClosure *cl; 799 LClosure *cl;
801 TValue *k; 800 TValue *k;
802 StkId base = L->func + 1; /* local copy of 'L->func + 1' */ 801 StkId base = L->func + 1; /* local copy of 'L->func + 1' */
@@ -804,7 +803,6 @@ void luaV_execute (lua_State *L) {
804 const Instruction *pc; /* local copy of 'basepc(base)' */ 803 const Instruction *pc; /* local copy of 'basepc(base)' */
805 callstatus(base - 1) |= CIST_FRESH; /* fresh invocation of 'luaV_execute" */ 804 callstatus(base - 1) |= CIST_FRESH; /* fresh invocation of 'luaV_execute" */
806 newframe: /* reentry point when frame changes (call/return) */ 805 newframe: /* reentry point when frame changes (call/return) */
807 lua_assert(ci == L->ci);
808 cl = clLvalue(s2v(L->func)); /* local reference to function's closure */ 806 cl = clLvalue(s2v(L->func)); /* local reference to function's closure */
809 k = cl->p->k; /* local reference to function's constant table */ 807 k = cl->p->k; /* local reference to function's constant table */
810 updatemask(L); 808 updatemask(L);
@@ -1361,7 +1359,6 @@ void luaV_execute (lua_State *L) {
1361 /* else leave top for next instruction */ 1359 /* else leave top for next instruction */
1362 } 1360 }
1363 else { /* Lua function */ 1361 else { /* Lua function */
1364 ci = L->ci;
1365 base = L->func + 1; 1362 base = L->func + 1;
1366 goto newframe; /* restart luaV_execute over new Lua function */ 1363 goto newframe; /* restart luaV_execute over new Lua function */
1367 } 1364 }
@@ -1391,7 +1388,6 @@ void luaV_execute (lua_State *L) {
1391 L->top = functop(ofunc); /* correct top */ 1388 L->top = functop(ofunc); /* correct top */
1392 ofunc->stkci.u.l.savedpc = nfunc->stkci.u.l.savedpc; 1389 ofunc->stkci.u.l.savedpc = nfunc->stkci.u.l.savedpc;
1393 callstatus(ofunc) |= CIST_TAIL; /* function was tail called */ 1390 callstatus(ofunc) |= CIST_TAIL; /* function was tail called */
1394 ci = L->ci = L->ci->previous; /* remove new frame */
1395 base = ofunc + 1; 1391 base = ofunc + 1;
1396 L->func = ofunc; 1392 L->func = ofunc;
1397 lua_assert(L->top == base + getproto(s2v(ofunc))->maxstacksize); 1393 lua_assert(L->top == base + getproto(s2v(ofunc))->maxstacksize);
@@ -1403,11 +1399,10 @@ void luaV_execute (lua_State *L) {
1403 int b = GETARG_B(i); 1399 int b = GETARG_B(i);
1404 if (cl->p->sizep > 0) luaF_close(L, base); 1400 if (cl->p->sizep > 0) luaF_close(L, base);
1405 savepc(base); 1401 savepc(base);
1406 b = luaD_poscall(L, ci, ra, (b != 0 ? b - 1 : cast_int(L->top - ra))); 1402 b = luaD_poscall(L, ra, (b != 0 ? b - 1 : cast_int(L->top - ra)));
1407 if (callstatus(base - 1) & CIST_FRESH) /* local 'base' still from callee */ 1403 if (callstatus(base - 1) & CIST_FRESH) /* local 'base' still from callee */
1408 return; /* external invocation: return */ 1404 return; /* external invocation: return */
1409 else { /* invocation via reentry: continue execution */ 1405 else { /* invocation via reentry: continue execution */
1410 ci = L->ci;
1411 base = L->func + 1; 1406 base = L->func + 1;
1412 if (b) L->top = functop(base - 1); 1407 if (b) L->top = functop(base - 1);
1413 lua_assert(isLua(base - 1)); 1408 lua_assert(isLua(base - 1));