aboutsummaryrefslogtreecommitdiff
path: root/src/lj_snap.c
diff options
context:
space:
mode:
authorMike Pall <mike>2009-12-08 20:35:29 +0100
committerMike Pall <mike>2009-12-08 20:35:29 +0100
commit3f1f9e11f4f699ae94182d4cba158092f434a7f6 (patch)
tree88fbb674a21a1d554d4b1ee9d4ef2c5fed6a1d88 /src/lj_snap.c
parent5287b9326479ea2b7dddd6f642673e58e5a7f354 (diff)
downloadluajit-3f1f9e11f4f699ae94182d4cba158092f434a7f6.tar.gz
luajit-3f1f9e11f4f699ae94182d4cba158092f434a7f6.tar.bz2
luajit-3f1f9e11f4f699ae94182d4cba158092f434a7f6.zip
Fast forward to sync public repo.
Compile math.sinh(), math.cosh(), math.tanh() and math.random(). Compile various io.*() functions. Drive the GC forward on string allocations in the parser. Improve KNUM fuse vs. load heuristics. Add abstract C call handling to IR.
Diffstat (limited to 'src/lj_snap.c')
-rw-r--r--src/lj_snap.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/src/lj_snap.c b/src/lj_snap.c
index 09cd095c..d27404f2 100644
--- a/src/lj_snap.c
+++ b/src/lj_snap.c
@@ -251,9 +251,9 @@ void lj_snap_restore(jit_State *J, void *exptr)
251 GCfunc *fn = gco2func(gcref(T->ir[ir->op2].gcr)); 251 GCfunc *fn = gco2func(gcref(T->ir[ir->op2].gcr));
252 if (isluafunc(fn)) { 252 if (isluafunc(fn)) {
253 TValue *fs; 253 TValue *fs;
254 newbase = o+1; 254 fs = o+1 + funcproto(fn)->framesize;
255 fs = newbase + funcproto(fn)->framesize;
256 if (fs > ntop) ntop = fs; /* Update top for newly added frames. */ 255 if (fs > ntop) ntop = fs; /* Update top for newly added frames. */
256 if (s != 0) newbase = o+1;
257 } 257 }
258 } 258 }
259 } 259 }
@@ -262,21 +262,17 @@ void lj_snap_restore(jit_State *J, void *exptr)
262 setnilV(o); /* Clear unreferenced slots of newly added frames. */ 262 setnilV(o); /* Clear unreferenced slots of newly added frames. */
263 } 263 }
264 } 264 }
265 if (newbase) { /* Clear remainder of newly added frames. */ 265 if (newbase) L->base = newbase;
266 L->base = newbase; 266 if (ntop >= L->maxstack) { /* Need to grow the stack again. */
267 if (ntop >= L->maxstack) { /* Need to grow the stack again. */ 267 MSize need = (MSize)(ntop - o);
268 MSize need = (MSize)(ntop - o); 268 L->top = o;
269 L->top = o; 269 lj_state_growstack(L, need);
270 lj_state_growstack(L, need); 270 o = L->top;
271 o = L->top; 271 ntop = o + need;
272 ntop = o + need;
273 }
274 L->top = curr_topL(L);
275 for (; o < ntop; o++)
276 setnilV(o);
277 } else { /* Must not clear slots of existing frame. */
278 L->top = curr_topL(L);
279 } 272 }
273 L->top = curr_topL(L);
274 for (; o < ntop; o++) /* Clear remainder of newly added frames. */
275 setnilV(o);
280 lua_assert(map + nslots == flinks-1); 276 lua_assert(map + nslots == flinks-1);
281 J->pc = (const BCIns *)(uintptr_t)(*--flinks); 277 J->pc = (const BCIns *)(uintptr_t)(*--flinks);
282} 278}