From 93da1af87bedb29732653415378a0600cb4cf4d3 Mon Sep 17 00:00:00 2001 From: David Flamme Date: Tue, 16 Mar 2010 16:13:20 +0100 Subject: [PATCH] Method call frequency statistics for ARM * src/vm/jit/arm/emit.c: Added working emit_profile_method(..) and emit_profile_basicblock(..) for ARM, so now call frequencys can be shown with -Xprof * src/vm/jit/optimizing/profile.cpp (profile_printstats): The use of DumpList is causing problems, so std::list is used instead --- src/vm/jit/arm/emit.c | 52 +++++++++++++++++++++++++++++++ src/vm/jit/optimizing/profile.cpp | 3 +- 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/src/vm/jit/arm/emit.c b/src/vm/jit/arm/emit.c index 6a196037c..b1587e340 100644 --- a/src/vm/jit/arm/emit.c +++ b/src/vm/jit/arm/emit.c @@ -959,6 +959,58 @@ void emit_verbosecall_exit(jitdata *jd) #endif /* !defined(NDEBUG) */ +/** + * Emit profiling code for method frequency counting. + * Its slow but working, so be carefull, if you want to use it... + */ +#if defined(ENABLE_PROFILING) +void emit_profile_method(codegendata* cd, codeinfo* code) +{ + ICONST(REG_ITMP3,code); + M_LDR(REG_ITMP2,REG_ITMP3,OFFSET(codeinfo, frequency)); + M_ADD_IMM(REG_ITMP2, REG_ITMP2, 1); + M_STR(REG_ITMP2,REG_ITMP3,OFFSET(codeinfo, frequency)); +// M_TRAP(0, TRAP_DEBUG); +} + +#endif + +/** + * Emit profiling code for basicblock frequency counting. + * Its slow but working, so be carefull, if you want to use it... + */ +#if defined(ENABLE_PROFILING) +void emit_profile_basicblock(codegendata* cd, codeinfo* code, basicblock* bptr) +{ + ICONST(REG_ITMP3,code); + M_LDR(REG_ITMP2,REG_ITMP3,OFFSET(codeinfo, bbfrequency)); + M_ADD_IMM(REG_ITMP2, REG_ITMP2, 1); + M_STR(REG_ITMP2,REG_ITMP3,OFFSET(codeinfo, bbfrequency)); +} +#endif + + +/** + * Emit profiling code to start CPU cycle counting. + */ +#if defined(ENABLE_PROFILING) +void emit_profile_cycle_start(codegendata* cd, codeinfo* code) +{ + // XXX Not implemented yet! +} +#endif + + +/** + * Emit profiling code to stop CPU cycle counting. + */ +#if defined(ENABLE_PROFILING) +void emit_profile_cycle_stop(codegendata* cd, codeinfo* code) +{ + // XXX Not implemented yet! +} +#endif + /* * These are local overrides for various environment variables in Emacs. * Please do not remove this and leave it at the end of the file, where diff --git a/src/vm/jit/optimizing/profile.cpp b/src/vm/jit/optimizing/profile.cpp index 1ebc554a3..eb8ceccd9 100644 --- a/src/vm/jit/optimizing/profile.cpp +++ b/src/vm/jit/optimizing/profile.cpp @@ -226,7 +226,8 @@ void profile_printstats(void) /* create new method list */ - DumpList l; + std::list l; + //DumpList l; // XXX currently the DumpList doesn't work here. /* iterate through all classes and methods */ -- 2.25.1