5405dc67aa0c7dbef9ae61baab7f7d53dff7ee8a
[cacao.git] / src / vm / statistics.h
1 /* src/vm/statistics.h - exports global varables for statistics
2
3    Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
4    R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
5    C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
6    Institut f. Computersprachen - TU Wien
7
8    This file is part of CACAO.
9
10    This program is free software; you can redistribute it and/or
11    modify it under the terms of the GNU General Public License as
12    published by the Free Software Foundation; either version 2, or (at
13    your option) any later version.
14
15    This program is distributed in the hope that it will be useful, but
16    WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18    General Public License for more details.
19
20    You should have received a copy of the GNU General Public License
21    along with this program; if not, write to the Free Software
22    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
23    02111-1307, USA.
24
25    Contact: cacao@complang.tuwien.ac.at
26
27    Authors: Christian Thalinger
28
29    Changes:
30
31    $Id: statistics.h 4002 2005-12-22 14:06:10Z twisti $
32
33 */
34
35
36 #ifndef _STATISTICS_H
37 #define _STATISTICS_H
38
39 #include "config.h"
40 #include "vm/types.h"
41
42 #include "vm/global.h"
43
44
45 /* statistic macros ***********************************************************/
46
47 #if defined(ENABLE_STATISTICS)
48 #define STATISTICS(x) \
49     do { \
50         if (opt_stat) { \
51             x; \
52         } \
53     } while (0)
54 #else
55 #define STATISTICS(x)    /* nothing */
56 #endif
57
58 /* in_  inline statistics */
59
60 #define IN_MAX                  9
61 #define IN_UNIQUEVIRT           0x0000 
62 #define IN_UNIQUE_INTERFACE     0x0001
63 #define IN_OUTSIDERS            0x0004
64 #define IN_MAXDEPTH             0x0008
65 #define IN_MAXCODE              0x0010
66 #define IN_JCODELENGTH          0x0020
67 #define IN_EXCEPTION            0x0040
68 #define IN_NOT_UNIQUE_VIRT      0x0080
69 #define IN_NOT_UNIQUE_INTERFACE 0x0100
70
71 #define N_UNIQUEVIRT            0
72 #define N_UNIQUE_INTERFACE      1
73 #define N_OUTSIDERS             2
74 #define N_MAXDEPTH              3       
75 #define N_MAXCODE               4 
76 #define N_JCODELENGTH           5 
77 #define N_EXCEPTION            6 
78 #define N_NOT_UNIQUE_VIRT       7 
79 #define N_NOT_UNIQUE_INTERFACE  8 
80
81
82 /* global variables ***********************************************************/
83
84 extern s4 codememusage;
85 extern s4 maxcodememusage;
86
87 extern s4 memoryusage;
88 extern s4 maxmemusage;
89
90 extern s4 maxdumpsize;
91
92 extern s4 globalallocateddumpsize;
93 extern s4 globaluseddumpsize;
94
95 extern int count_class_infos;           /* variables for measurements         */
96 extern int count_const_pool_len;
97 extern int count_classref_len;
98 extern int count_parsed_desc_len;
99 extern int count_vftbl_len;
100 extern int count_all_methods;
101 extern int count_methods_marked_used;  /*RTA*/
102 extern int count_vmcode_len;
103 extern int count_extable_len;
104 extern int count_class_loads;
105 extern int count_class_inits;
106
107 extern int count_utf_len;               /* size of utf hash                   */
108 extern int count_utf_new;
109 extern int count_utf_new_found;
110
111 extern int count_locals_conflicts;
112 extern int count_locals_spilled;
113 extern int count_locals_register;
114 extern int count_ss_spilled;
115 extern int count_ss_register;
116 extern int count_methods_allocated_by_lsra;
117 extern int count_mem_move_bb;
118 extern int count_interface_size;
119 extern int count_argument_mem_ss;
120 extern int count_argument_reg_ss;
121 extern int count_method_in_register;
122 extern int count_mov_reg_reg;
123 extern int count_mov_mem_reg;
124 extern int count_mov_reg_mem;
125 extern int count_mov_mem_mem;
126
127 extern int count_jit_calls;
128 extern int count_methods;
129 extern int count_spills;
130 extern int count_spills_read;
131 extern int count_pcmd_activ;
132 extern int count_pcmd_drop;
133 extern int count_pcmd_zero;
134 extern int count_pcmd_const_store;
135 extern int count_pcmd_const_alu;
136 extern int count_pcmd_const_bra;
137 extern int count_pcmd_load;
138 extern int count_pcmd_move;
139 extern int count_load_instruction;
140 extern int count_pcmd_store;
141 extern int count_pcmd_store_comb;
142 extern int count_dup_instruction;
143 extern int count_pcmd_op;
144 extern int count_pcmd_mem;
145 extern int count_pcmd_met;
146 extern int count_pcmd_bra;
147 extern int count_pcmd_table;
148 extern int count_pcmd_return;
149 extern int count_pcmd_returnx;
150 extern int count_check_null;
151 extern int count_check_bound;
152 extern int count_max_basic_blocks;
153 extern int count_basic_blocks;
154 extern int count_max_javainstr;
155 extern int count_javainstr;
156 extern int count_javacodesize;
157 extern int count_javaexcsize;
158 extern int count_calls;
159 extern int count_tryblocks;
160 extern int count_code_len;
161 extern int count_data_len;
162 extern int count_cstub_len;
163 extern int count_nstub_len;
164 extern int count_max_new_stack;
165 extern int count_upper_bound_new_stack;
166 extern int *count_block_stack;
167 extern int *count_analyse_iterations;
168 extern int *count_method_bb_distribution;
169 extern int *count_block_size_distribution;
170 extern int *count_store_length;
171 extern int *count_store_depth;
172                                 /* in_  inline statistics */
173 extern int count_in;
174 extern int count_in_uniqVirt;
175 extern int count_in_uniqIntf;
176 extern int count_in_rejected;
177 extern int count_in_rejected_mult;
178 extern int count_in_outsiders;
179 extern int count_in_uniqueVirt_not_inlined;
180 extern int count_in_uniqueInterface_not_inlined;
181 extern int count_in_maxDepth;
182 extern int count_in_maxMethods;
183
184 extern u2 count_in_not   [512];
185
186 /* instruction scheduler statistics *******************************************/
187
188 extern s4 count_schedule_basic_blocks;
189 extern s4 count_schedule_nodes;
190 extern s4 count_schedule_leaders;
191 extern s4 count_schedule_max_leaders;
192 extern s4 count_schedule_critical_path;
193
194
195 /* function prototypes ********************************************************/
196
197 s8 getcputime(void);
198
199 void loadingtime_start(void);
200 void loadingtime_stop(void);
201 void compilingtime_start(void);
202 void compilingtime_stop(void);
203
204 void print_times(void);
205 void print_stats(void);
206
207 void mem_usagelog(bool givewarnings);
208
209
210 void nativeinvokation(void);
211 void compiledinvokation(void);
212 void jnicallXmethodnvokation(void);
213 void jniinvokation(void);
214
215 #endif /* _STATISTICS_H */
216
217
218 /*
219  * These are local overrides for various environment variables in Emacs.
220  * Please do not remove this and leave it at the end of the file, where
221  * Emacs will automagically detect them.
222  * ---------------------------------------------------------------------
223  * Local variables:
224  * mode: c
225  * indent-tabs-mode: t
226  * c-basic-offset: 4
227  * tab-width: 4
228  * End:
229  */