aboutsummaryrefslogtreecommitdiff
path: root/ldo.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-01-03 15:42:57 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-01-03 15:42:57 -0200
commitfacfec0687ff20351d3c7520344a722b9149c9ea (patch)
tree142f5863ac2663f6714a712eca9be2407e7aaf0a /ldo.c
parent34df9976a9fe9a94a4ee96d7ff0ebceac025172d (diff)
downloadlua-facfec0687ff20351d3c7520344a722b9149c9ea.tar.gz
lua-facfec0687ff20351d3c7520344a722b9149c9ea.tar.bz2
lua-facfec0687ff20351d3c7520344a722b9149c9ea.zip
small optimizations
Diffstat (limited to 'ldo.c')
-rw-r--r--ldo.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/ldo.c b/ldo.c
index 18bd3d32..fedc0e35 100644
--- a/ldo.c
+++ b/ldo.c
@@ -49,7 +49,6 @@ void luaD_init (lua_State *L, int stacksize) {
49 L->ci = L->base_ci; 49 L->ci = L->base_ci;
50 L->ci->base = L->top; 50 L->ci->base = L->top;
51 L->ci->savedpc = NULL; 51 L->ci->savedpc = NULL;
52 L->ci->pc = NULL;
53 L->size_ci = 20; 52 L->size_ci = 20;
54 L->end_ci = L->base_ci + L->size_ci; 53 L->end_ci = L->base_ci + L->size_ci;
55} 54}
@@ -107,6 +106,7 @@ void luaD_callHook (lua_State *L, lua_Hook callhook, const char *event) {
107 lua_Debug ar; 106 lua_Debug ar;
108 ar.event = event; 107 ar.event = event;
109 ar._ci = L->ci - L->base_ci; 108 ar._ci = L->ci - L->base_ci;
109 L->ci->pc = NULL; /* function is not active */
110 dohook(L, &ar, callhook); 110 dohook(L, &ar, callhook);
111 } 111 }
112} 112}
@@ -135,11 +135,9 @@ StkId luaD_precall (lua_State *L, StkId func) {
135 luaD_openstack(L, func); 135 luaD_openstack(L, func);
136 setobj(func, tm); /* tag method is the new function to be called */ 136 setobj(func, tm); /* tag method is the new function to be called */
137 } 137 }
138 lua_assert(ttype(func) == LUA_TFUNCTION);
139 ci = newci(L); 138 ci = newci(L);
140 ci->base = func+1; 139 ci->base = func+1;
141 ci->savedpc = NULL; 140 ci->savedpc = NULL;
142 ci->pc = NULL;
143 if (L->callhook) 141 if (L->callhook)
144 luaD_callHook(L, L->callhook, "call"); 142 luaD_callHook(L, L->callhook, "call");
145 if (!clvalue(func)->c.isC) return NULL; 143 if (!clvalue(func)->c.isC) return NULL;