summaryrefslogtreecommitdiff
path: root/src/lj_trace.c
diff options
context:
space:
mode:
authorMike Pall <mike>2015-08-29 23:22:29 +0200
committerMike Pall <mike>2015-08-29 23:24:26 +0200
commita3a6866d4c2cc096b478c8f81b73a3b818034b89 (patch)
tree763f1e2db63fdbc46671e2f44e33ce71a4db2746 /src/lj_trace.c
parentad29314c2c5b205d591e3a6af0a18dc0f69a7f48 (diff)
downloadluajit-a3a6866d4c2cc096b478c8f81b73a3b818034b89.tar.gz
luajit-a3a6866d4c2cc096b478c8f81b73a3b818034b89.tar.bz2
luajit-a3a6866d4c2cc096b478c8f81b73a3b818034b89.zip
Re-enable trace stitching.
Thanks to Vyacheslav Egorov.
Diffstat (limited to 'src/lj_trace.c')
-rw-r--r--src/lj_trace.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lj_trace.c b/src/lj_trace.c
index 42f4321d..1d0c2e5e 100644
--- a/src/lj_trace.c
+++ b/src/lj_trace.c
@@ -274,7 +274,7 @@ int lj_trace_flushall(lua_State *L)
274 if (T->root == 0) 274 if (T->root == 0)
275 trace_flushroot(J, T); 275 trace_flushroot(J, T);
276 lj_gdbjit_deltrace(J, T); 276 lj_gdbjit_deltrace(J, T);
277 T->traceno = 0; 277 T->traceno = T->link = 0; /* Blacklist the link for cont_stitch. */
278 setgcrefnull(J->trace[i]); 278 setgcrefnull(J->trace[i]);
279 } 279 }
280 } 280 }
@@ -284,6 +284,7 @@ int lj_trace_flushall(lua_State *L)
284 memset(J->penalty, 0, sizeof(J->penalty)); 284 memset(J->penalty, 0, sizeof(J->penalty));
285 /* Free the whole machine code and invalidate all exit stub groups. */ 285 /* Free the whole machine code and invalidate all exit stub groups. */
286 lj_mcode_free(J); 286 lj_mcode_free(J);
287 lj_ir_k64_freeall(J);
287 memset(J->exitstubgroup, 0, sizeof(J->exitstubgroup)); 288 memset(J->exitstubgroup, 0, sizeof(J->exitstubgroup));
288 lj_vmevent_send(L, TRACE, 289 lj_vmevent_send(L, TRACE,
289 setstrV(L, L->top++, lj_str_newlit(L, "flush")); 290 setstrV(L, L->top++, lj_str_newlit(L, "flush"));
@@ -402,6 +403,7 @@ static void trace_start(jit_State *J)
402 J->postproc = LJ_POST_NONE; 403 J->postproc = LJ_POST_NONE;
403 lj_resetsplit(J); 404 lj_resetsplit(J);
404 J->retryrec = 0; 405 J->retryrec = 0;
406 J->ktracep = NULL;
405 setgcref(J->cur.startpt, obj2gco(J->pt)); 407 setgcref(J->cur.startpt, obj2gco(J->pt));
406 408
407 L = J->L; 409 L = J->L;
@@ -477,6 +479,9 @@ static void trace_stop(jit_State *J)
477 lj_mcode_commit(J, J->cur.mcode); 479 lj_mcode_commit(J, J->cur.mcode);
478 J->postproc = LJ_POST_NONE; 480 J->postproc = LJ_POST_NONE;
479 trace_save(J, T); 481 trace_save(J, T);
482 if (J->ktracep) { /* Patch K64Array slot with the final GCtrace pointer. */
483 setgcV(J->L, J->ktracep, obj2gco(T), LJ_TTRACE);
484 }
480 485
481 L = J->L; 486 L = J->L;
482 lj_vmevent_send(L, TRACE, 487 lj_vmevent_send(L, TRACE,