Add low-overhead profiler. Part 1: interpreter, low-level C API.

This commit is contained in:
Mike Pall
2013-09-02 01:49:19 +02:00
parent 19c2dd17db
commit 4dce22c40d
18 changed files with 558 additions and 33 deletions

View File

@@ -2504,6 +2504,19 @@ static void build_subroutines(BuildCtx *ctx)
| lwz INS, -4(PC)
| mtctr CRET1
| bctr
|
|->vm_profhook: // Dispatch target for profiler hook.
#if LJ_HASPROFILE
| mr CARG1, L
| stw MULTRES, SAVE_MULTRES
| mr CARG2, PC
| stp BASE, L->base
| bl extern lj_dispatch_profile // (lua_State *L, const BCIns *pc)
| // HOOK_PROFILE is off again, so re-dispatch to dynamic instruction.
| lp BASE, L->base
| subi PC, PC, 4
| b ->cont_nop
#endif
|
|//-----------------------------------------------------------------------
|//-- Trace exit handler -------------------------------------------------