diff options
author | Mike Pall <mike> | 2013-09-02 01:49:19 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2013-09-02 01:49:19 +0200 |
commit | 4dce22c40d38dd7dc3d05cc383ddf004fb1f92c4 (patch) | |
tree | 34800356c01e0a4f7f820d5affb131de8c091d89 /src/vm_ppc.dasc | |
parent | 19c2dd17dbaf66f1341efe2a71a26f0b5724f9e1 (diff) | |
download | luajit-4dce22c40d38dd7dc3d05cc383ddf004fb1f92c4.tar.gz luajit-4dce22c40d38dd7dc3d05cc383ddf004fb1f92c4.tar.bz2 luajit-4dce22c40d38dd7dc3d05cc383ddf004fb1f92c4.zip |
Add low-overhead profiler. Part 1: interpreter, low-level C API.
Diffstat (limited to 'src/vm_ppc.dasc')
-rw-r--r-- | src/vm_ppc.dasc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/vm_ppc.dasc b/src/vm_ppc.dasc index d9186c44..293c5c6f 100644 --- a/src/vm_ppc.dasc +++ b/src/vm_ppc.dasc | |||
@@ -2505,6 +2505,19 @@ static void build_subroutines(BuildCtx *ctx) | |||
2505 | | mtctr CRET1 | 2505 | | mtctr CRET1 |
2506 | | bctr | 2506 | | bctr |
2507 | | | 2507 | | |
2508 | |->vm_profhook: // Dispatch target for profiler hook. | ||
2509 | #if LJ_HASPROFILE | ||
2510 | | mr CARG1, L | ||
2511 | | stw MULTRES, SAVE_MULTRES | ||
2512 | | mr CARG2, PC | ||
2513 | | stp BASE, L->base | ||
2514 | | bl extern lj_dispatch_profile // (lua_State *L, const BCIns *pc) | ||
2515 | | // HOOK_PROFILE is off again, so re-dispatch to dynamic instruction. | ||
2516 | | lp BASE, L->base | ||
2517 | | subi PC, PC, 4 | ||
2518 | | b ->cont_nop | ||
2519 | #endif | ||
2520 | | | ||
2508 | |//----------------------------------------------------------------------- | 2521 | |//----------------------------------------------------------------------- |
2509 | |//-- Trace exit handler ------------------------------------------------- | 2522 | |//-- Trace exit handler ------------------------------------------------- |
2510 | |//----------------------------------------------------------------------- | 2523 | |//----------------------------------------------------------------------- |