diff options
Diffstat (limited to 'src/lj_dispatch.c')
-rw-r--r-- | src/lj_dispatch.c | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/src/lj_dispatch.c b/src/lj_dispatch.c index 01bc4239..af269c44 100644 --- a/src/lj_dispatch.c +++ b/src/lj_dispatch.c | |||
@@ -508,28 +508,18 @@ out: | |||
508 | void LJ_FASTCALL lj_dispatch_profile(lua_State *L, const BCIns *pc) | 508 | void LJ_FASTCALL lj_dispatch_profile(lua_State *L, const BCIns *pc) |
509 | { | 509 | { |
510 | ERRNO_SAVE | 510 | ERRNO_SAVE |
511 | global_State *g = G(L); | 511 | GCfunc *fn = curr_func(L); |
512 | uint8_t mask = g->hookmask; | 512 | GCproto *pt = funcproto(fn); |
513 | g->hookmask = (mask & ~HOOK_PROFILE); | 513 | void *cf = cframe_raw(L->cframe); |
514 | lj_dispatch_update(g); | 514 | const BCIns *oldpc = cframe_pc(cf); |
515 | if (!(mask & HOOK_VMEVENT)) { | 515 | global_State *g; |
516 | GCfunc *fn = curr_func(L); | 516 | setcframe_pc(cf, pc); |
517 | GCproto *pt = funcproto(fn); | 517 | L->top = L->base + cur_topslot(pt, pc, cframe_multres_n(cf)); |
518 | void *cf = cframe_raw(L->cframe); | 518 | lj_profile_interpreter(L); |
519 | const BCIns *oldpc = cframe_pc(cf); | 519 | setcframe_pc(cf, oldpc); |
520 | uint8_t oldh = hook_save(g); | 520 | g = G(L); |
521 | BCReg slots; | 521 | setgcref(g->cur_L, obj2gco(L)); |
522 | hook_vmevent(g); | 522 | setvmstate(g, INTERP); |
523 | setcframe_pc(cf, pc); | ||
524 | slots = cur_topslot(pt, pc, cframe_multres_n(cf)); | ||
525 | L->top = L->base + slots; /* Fix top. */ | ||
526 | lj_profile_interpreter(L); | ||
527 | setgcref(g->cur_L, obj2gco(L)); | ||
528 | setcframe_pc(cf, oldpc); | ||
529 | hook_restore(g, oldh); | ||
530 | lj_trace_abort(g); | ||
531 | setvmstate(g, INTERP); | ||
532 | } | ||
533 | ERRNO_RESTORE | 523 | ERRNO_RESTORE |
534 | } | 524 | } |
535 | #endif | 525 | #endif |