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_mips.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_mips.dasc')
-rw-r--r-- | src/vm_mips.dasc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/vm_mips.dasc b/src/vm_mips.dasc index 39d1521d..e7d01dc4 100644 --- a/src/vm_mips.dasc +++ b/src/vm_mips.dasc | |||
@@ -2011,6 +2011,20 @@ static void build_subroutines(BuildCtx *ctx) | |||
2011 | | jr CRET1 | 2011 | | jr CRET1 |
2012 | |. lw INS, -4(PC) | 2012 | |. lw INS, -4(PC) |
2013 | | | 2013 | | |
2014 | |->vm_profhook: // Dispatch target for profiler hook. | ||
2015 | #if LJ_HASPROFILE | ||
2016 | | load_got lj_dispatch_profile | ||
2017 | | sw MULTRES, SAVE_MULTRES | ||
2018 | | move CARG2, PC | ||
2019 | | sw BASE, L->base | ||
2020 | | call_intern lj_dispatch_profile // (lua_State *L, const BCIns *pc) | ||
2021 | |. move CARG1, L | ||
2022 | | // HOOK_PROFILE is off again, so re-dispatch to dynamic instruction. | ||
2023 | | addiu PC, PC, -4 | ||
2024 | | b ->cont_nop | ||
2025 | |. lw BASE, L->base | ||
2026 | #endif | ||
2027 | | | ||
2014 | |//----------------------------------------------------------------------- | 2028 | |//----------------------------------------------------------------------- |
2015 | |//-- Trace exit handler ------------------------------------------------- | 2029 | |//-- Trace exit handler ------------------------------------------------- |
2016 | |//----------------------------------------------------------------------- | 2030 | |//----------------------------------------------------------------------- |