summaryrefslogtreecommitdiff
path: root/src/lj_dispatch.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_dispatch.c')
-rw-r--r--src/lj_dispatch.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lj_dispatch.c b/src/lj_dispatch.c
index 5fbc112c..c29cad46 100644
--- a/src/lj_dispatch.c
+++ b/src/lj_dispatch.c
@@ -172,11 +172,11 @@ void lj_dispatch_update(global_State *g)
172static void setptmode(global_State *g, GCproto *pt, int mode) 172static void setptmode(global_State *g, GCproto *pt, int mode)
173{ 173{
174 if ((mode & LUAJIT_MODE_ON)) { /* (Re-)enable JIT compilation. */ 174 if ((mode & LUAJIT_MODE_ON)) { /* (Re-)enable JIT compilation. */
175 pt->flags &= ~PROTO_NO_JIT; 175 pt->flags &= ~PROTO_NOJIT;
176 lj_trace_reenableproto(pt); /* Unpatch all ILOOP etc. bytecodes. */ 176 lj_trace_reenableproto(pt); /* Unpatch all ILOOP etc. bytecodes. */
177 } else { /* Flush and/or disable JIT compilation. */ 177 } else { /* Flush and/or disable JIT compilation. */
178 if (!(mode & LUAJIT_MODE_FLUSH)) 178 if (!(mode & LUAJIT_MODE_FLUSH))
179 pt->flags |= PROTO_NO_JIT; 179 pt->flags |= PROTO_NOJIT;
180 lj_trace_flushproto(g, pt); /* Flush all traces of prototype. */ 180 lj_trace_flushproto(g, pt); /* Flush all traces of prototype. */
181 } 181 }
182} 182}
@@ -185,6 +185,7 @@ static void setptmode(global_State *g, GCproto *pt, int mode)
185static void setptmode_all(global_State *g, GCproto *pt, int mode) 185static void setptmode_all(global_State *g, GCproto *pt, int mode)
186{ 186{
187 ptrdiff_t i; 187 ptrdiff_t i;
188 if (!(pt->flags & PROTO_CHILD)) return;
188 for (i = -(ptrdiff_t)pt->sizekgc; i < 0; i++) { 189 for (i = -(ptrdiff_t)pt->sizekgc; i < 0; i++) {
189 GCobj *o = proto_kgc(pt, i); 190 GCobj *o = proto_kgc(pt, i);
190 if (o->gch.gct == ~LJ_TPROTO) { 191 if (o->gch.gct == ~LJ_TPROTO) {
@@ -400,7 +401,7 @@ static int call_init(lua_State *L, GCfunc *fn)
400 int numparams = pt->numparams; 401 int numparams = pt->numparams;
401 int gotparams = (int)(L->top - L->base); 402 int gotparams = (int)(L->top - L->base);
402 int need = pt->framesize; 403 int need = pt->framesize;
403 if ((pt->flags & PROTO_IS_VARARG)) need += 1+gotparams; 404 if ((pt->flags & PROTO_VARARG)) need += 1+gotparams;
404 lj_state_checkstack(L, (MSize)need); 405 lj_state_checkstack(L, (MSize)need);
405 numparams -= gotparams; 406 numparams -= gotparams;
406 return numparams >= 0 ? numparams : 0; 407 return numparams >= 0 ? numparams : 0;