1 /* src/vm/jit/optimizing/profile.h - runtime profiling
3 Copyright (C) 1996-2005, 2006, 2008
4 CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
6 This file is part of CACAO.
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License as
10 published by the Free Software Foundation; either version 2, or (at
11 your option) any later version.
13 This program is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
37 #include "vm/global.h"
40 /* CPU cycle counting macros **************************************************/
42 #if defined(ENABLE_PROFILING) && defined(__X86_64__)
44 #define PROFILE_CYCLE_START \
46 if (JITDATA_HAS_FLAG_INSTRUMENT(jd)) { \
50 M_MOV_IMM(code, REG_ITMP3); \
52 M_ISUB_MEMBASE(RAX, REG_ITMP3, OFFSET(codeinfo, cycles)); \
53 M_ISBB_MEMBASE(RDX, REG_ITMP3, OFFSET(codeinfo, cycles) + 4); \
60 #define PROFILE_CYCLE_STOP \
62 if (JITDATA_HAS_FLAG_INSTRUMENT(jd)) { \
66 M_MOV_IMM(code, REG_ITMP3); \
68 M_IADD_MEMBASE(RAX, REG_ITMP3, OFFSET(codeinfo, cycles)); \
69 M_IADC_MEMBASE(RDX, REG_ITMP3, OFFSET(codeinfo, cycles) + 4); \
78 #define PROFILE_CYCLE_START
79 #define PROFILE_CYCLE_STOP
84 /* function prototypes ********************************************************/
86 bool profile_init(void);
87 bool profile_start_thread(void);
90 void profile_printstats(void);
97 #endif /* _PROFILE_H */
101 * These are local overrides for various environment variables in Emacs.
102 * Please do not remove this and leave it at the end of the file, where
103 * Emacs will automagically detect them.
104 * ---------------------------------------------------------------------
107 * indent-tabs-mode: t