From 02ed2cf2821d293fa6c73413a14c3b941505ceed Mon Sep 17 00:00:00 2001 From: William Maddox Date: Fri, 4 Jun 2010 14:31:25 -0700 Subject: [PATCH] Bug 555345 - Histogram profiling macros for JIT-generated code (r=rreitmai+) This patch adds wrapper macros _jhprof_init, _jhnprof_init, and _jhprof to facilitate histogram profiling from JIT-generated code. --HG-- extra : convert_revision : 939ade8f3ee9716faaedc2b2a0cf986b5010003f --- js/src/vprof/vprof.h | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/js/src/vprof/vprof.h b/js/src/vprof/vprof.h index d92be1b7c0a6..b47cf1fe5445 100644 --- a/js/src/vprof/vprof.h +++ b/js/src/vprof/vprof.h @@ -121,13 +121,16 @@ uint64_t readTimestampCounter(); #define _nvprof(e,v) #ifndef VMCFG_SYMBIAN #define _vprof(v,...) -#define _hprof(h,n,...) +#define _hprof(v,n,...) #define _nhprof(e,v,n,...) #define _ntprof_begin(e) #define _ntprof_end(e) #define _jvprof_init(id,...) #define _jnvprof_init(id,e,...) +#define _jhprof_init(id,n,...) +#define _jnhprof_init(id,e,n,...) #define _jvprof(id,v) +#define _jhprof(id,v) #endif // ! VMCFG_SYMBIAN #else @@ -209,12 +212,23 @@ do { \ if (*(id) == 0) \ initValueProfile((id), (char*) (e), -1, ##__VA_ARGS__, NULL) -// Calls to the _jvprof macro must be wrapped in an actual function -// in order to be invoked from JIT-compiled code. +#define _jhprof_init(id,n,...) \ + if (*(id) == 0) \ + initHistProfile((id), __FILE__, __LINE__, (int) (n), ##__VA_ARGS__) + +#define _jnhprof_init(id,e,n,...) \ + if (*(id) == 0) \ + initHistProfile((id), (char*) (e), -1, (int) (n), ##__VA_ARGS__) + +// Calls to the _jvprof and _jhprof macros must be wrapped in a non-inline +// function in order to be invoked from JIT-compiled code. #define _jvprof(id,v) \ profileValue((id), (int64_t) (v)) +#define _jhprof(id,v) \ + histValue((id), (int64_t) (v)) + #endif #define NUM_EVARS 4