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_arm.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_arm.dasc')
-rw-r--r-- | src/vm_arm.dasc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/vm_arm.dasc b/src/vm_arm.dasc index dd39052c..0bd929fd 100644 --- a/src/vm_arm.dasc +++ b/src/vm_arm.dasc | |||
@@ -2082,6 +2082,18 @@ static void build_subroutines(BuildCtx *ctx) | |||
2082 | | ldr INS, [PC, #-4] | 2082 | | ldr INS, [PC, #-4] |
2083 | | bx CRET1 | 2083 | | bx CRET1 |
2084 | | | 2084 | | |
2085 | |->vm_profhook: // Dispatch target for profiler hook. | ||
2086 | #if LJ_HASPROFILE | ||
2087 | | mov CARG1, L | ||
2088 | | str BASE, L->base | ||
2089 | | mov CARG2, PC | ||
2090 | | bl extern lj_dispatch_profile // (lua_State *L, const BCIns *pc) | ||
2091 | | // HOOK_PROFILE is off again, so re-dispatch to dynamic instruction. | ||
2092 | | ldr BASE, L->base | ||
2093 | | sub PC, PC, #4 | ||
2094 | | b ->cont_nop | ||
2095 | #endif | ||
2096 | | | ||
2085 | |//----------------------------------------------------------------------- | 2097 | |//----------------------------------------------------------------------- |
2086 | |//-- Trace exit handler ------------------------------------------------- | 2098 | |//-- Trace exit handler ------------------------------------------------- |
2087 | |//----------------------------------------------------------------------- | 2099 | |//----------------------------------------------------------------------- |