aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lj_dispatch.c22
-rw-r--r--src/lj_trace.c11
2 files changed, 22 insertions, 11 deletions
diff --git a/src/lj_dispatch.c b/src/lj_dispatch.c
index 1e55c48a..636fb033 100644
--- a/src/lj_dispatch.c
+++ b/src/lj_dispatch.c
@@ -523,16 +523,18 @@ out:
523/* Stitch a new trace. */ 523/* Stitch a new trace. */
524void LJ_FASTCALL lj_dispatch_stitch(jit_State *J, const BCIns *pc) 524void LJ_FASTCALL lj_dispatch_stitch(jit_State *J, const BCIns *pc)
525{ 525{
526 ERRNO_SAVE 526 if (!(J2G(J)->hookmask & HOOK_VMEVENT)) {
527 lua_State *L = J->L; 527 ERRNO_SAVE
528 void *cf = cframe_raw(L->cframe); 528 lua_State *L = J->L;
529 const BCIns *oldpc = cframe_pc(cf); 529 void *cf = cframe_raw(L->cframe);
530 setcframe_pc(cf, pc); 530 const BCIns *oldpc = cframe_pc(cf);
531 /* Before dispatch, have to bias PC by 1. */ 531 setcframe_pc(cf, pc);
532 L->top = L->base + cur_topslot(curr_proto(L), pc+1, cframe_multres_n(cf)); 532 /* Before dispatch, have to bias PC by 1. */
533 lj_trace_stitch(J, pc-1); /* Point to the CALL instruction. */ 533 L->top = L->base + cur_topslot(curr_proto(L), pc+1, cframe_multres_n(cf));
534 setcframe_pc(cf, oldpc); 534 lj_trace_stitch(J, pc-1); /* Point to the CALL instruction. */
535 ERRNO_RESTORE 535 setcframe_pc(cf, oldpc);
536 ERRNO_RESTORE
537 }
536} 538}
537#endif 539#endif
538 540
diff --git a/src/lj_trace.c b/src/lj_trace.c
index 1f3686a3..e55045f4 100644
--- a/src/lj_trace.c
+++ b/src/lj_trace.c
@@ -467,7 +467,11 @@ static void trace_start(jit_State *J)
467 J->ktrace = 0; 467 J->ktrace = 0;
468 setgcref(J->cur.startpt, obj2gco(J->pt)); 468 setgcref(J->cur.startpt, obj2gco(J->pt));
469 469
470 lj_vmevent_send(J2G(J), TRACE, 470 lj_vmevent_send_(J2G(J), TRACE,
471 TValue savetv = J2G(J)->tmptv;
472 TValue savetv2 = J2G(J)->tmptv2;
473 TraceNo parent = J->parent;
474 ExitNo exitno = J->exitno;
471 setstrV(V, V->top++, lj_str_newlit(V, "start")); 475 setstrV(V, V->top++, lj_str_newlit(V, "start"));
472 setintV(V->top++, traceno); 476 setintV(V->top++, traceno);
473 setfuncV(V, V->top++, J->fn); 477 setfuncV(V, V->top++, J->fn);
@@ -482,6 +486,11 @@ static void trace_start(jit_State *J)
482 setintV(V->top++, -1); 486 setintV(V->top++, -1);
483 } 487 }
484 } 488 }
489 ,
490 J2G(J)->tmptv = savetv;
491 J2G(J)->tmptv2 = savetv2;
492 J->parent = parent;
493 J->exitno = exitno;
485 ); 494 );
486 lj_record_setup(J); 495 lj_record_setup(J);
487} 496}