* ICMD_GETFIELD: Check if a destination register is equals the source
[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    $Id: statistics.h 3514 2005-10-28 11:34:23Z twisti $
30
31 */
32
33
34 #ifndef _STATISTICS_H
35 #define _STATISTICS_H
36
37
38 #include "vm/global.h"
39                                 /* in_  inline statistics */
40
41 #define IN_MAX  9
42 #define IN_UNIQUEVIRT           0x0000 
43 #define IN_UNIQUE_INTERFACE     0x0001
44 #define IN_OUTSIDERS            0x0004
45 #define IN_MAXDEPTH             0x0008
46 #define IN_MAXCODE              0x0010
47 #define IN_JCODELENGTH          0x0020
48 #define IN_EXCEPTION            0x0040
49 #define IN_NOT_UNIQUE_VIRT      0x0080
50 #define IN_NOT_UNIQUE_INTERFACE 0x0100
51
52 #define N_UNIQUEVIRT            0
53 #define N_UNIQUE_INTERFACE      1
54 #define N_OUTSIDERS             2
55 #define N_MAXDEPTH              3       
56 #define N_MAXCODE               4 
57 #define N_JCODELENGTH           5 
58 #define N_EXCEPTION            6 
59 #define N_NOT_UNIQUE_VIRT       7 
60 #define N_NOT_UNIQUE_INTERFACE  8 
61
62
63
64 /* global variables ***********************************************************/
65
66 extern s4 codememusage;
67 extern s4 maxcodememusage;
68
69 extern s4 memoryusage;
70 extern s4 maxmemusage;
71
72 extern s4 maxdumpsize;
73
74 extern s4 globalallocateddumpsize;
75 extern s4 globaluseddumpsize;
76
77 extern int count_class_infos;           /* variables for measurements         */
78 extern int count_const_pool_len;
79 extern int count_classref_len;
80 extern int count_parsed_desc_len;
81 extern int count_vftbl_len;
82 extern int count_all_methods;
83 extern int count_methods_marked_used;  /*RTA*/
84 extern int count_vmcode_len;
85 extern int count_extable_len;
86 extern int count_class_loads;
87 extern int count_class_inits;
88
89 extern int count_utf_len;               /* size of utf hash                   */
90 extern int count_utf_new;
91 extern int count_utf_new_found;
92
93 extern int count_locals_conflicts;
94 extern int count_locals_spilled;
95 extern int count_locals_register;
96 extern int count_ss_spilled;
97 extern int count_ss_register;
98 extern int count_methods_allocated_by_lsra;
99 extern int count_mem_move_bb;
100 extern int count_interface_size;
101 extern int count_argument_mem_ss;
102 extern int count_argument_reg_ss;
103 extern int count_method_in_register;
104 extern int count_mov_reg_reg;
105 extern int count_mov_mem_reg;
106 extern int count_mov_reg_mem;
107 extern int count_mov_mem_mem;
108
109 extern int count_jit_calls;
110 extern int count_methods;
111 extern int count_spills;
112 extern int count_spills_read;
113 extern int count_pcmd_activ;
114 extern int count_pcmd_drop;
115 extern int count_pcmd_zero;
116 extern int count_pcmd_const_store;
117 extern int count_pcmd_const_alu;
118 extern int count_pcmd_const_bra;
119 extern int count_pcmd_load;
120 extern int count_pcmd_move;
121 extern int count_load_instruction;
122 extern int count_pcmd_store;
123 extern int count_pcmd_store_comb;
124 extern int count_dup_instruction;
125 extern int count_pcmd_op;
126 extern int count_pcmd_mem;
127 extern int count_pcmd_met;
128 extern int count_pcmd_bra;
129 extern int count_pcmd_table;
130 extern int count_pcmd_return;
131 extern int count_pcmd_returnx;
132 extern int count_check_null;
133 extern int count_check_bound;
134 extern int count_max_basic_blocks;
135 extern int count_basic_blocks;
136 extern int count_max_javainstr;
137 extern int count_javainstr;
138 extern int count_javacodesize;
139 extern int count_javaexcsize;
140 extern int count_calls;
141 extern int count_tryblocks;
142 extern int count_code_len;
143 extern int count_data_len;
144 extern int count_cstub_len;
145 extern int count_nstub_len;
146 extern int count_max_new_stack;
147 extern int count_upper_bound_new_stack;
148 extern int *count_block_stack;
149 extern int *count_analyse_iterations;
150 extern int *count_method_bb_distribution;
151 extern int *count_block_size_distribution;
152 extern int *count_store_length;
153 extern int *count_store_depth;
154                                 /* in_  inline statistics */
155 extern int count_in;
156 extern int count_in_uniqVirt;
157 extern int count_in_uniqIntf;
158 extern int count_in_rejected;
159 extern int count_in_rejected_mult;
160 extern int count_in_outsiders;
161 extern int count_in_uniqueVirt_not_inlined;
162 extern int count_in_uniqueInterface_not_inlined;
163 extern int count_in_maxDepth;
164 extern int count_in_maxMethods;
165
166 extern u2 count_in_not   [512];
167
168 /* instruction scheduler statistics *******************************************/
169
170 extern s4 count_schedule_basic_blocks;
171 extern s4 count_schedule_nodes;
172 extern s4 count_schedule_leaders;
173 extern s4 count_schedule_max_leaders;
174 extern s4 count_schedule_critical_path;
175
176
177 /* function prototypes ********************************************************/
178
179 s8 getcputime();
180
181 void loadingtime_start();
182 void loadingtime_stop();
183 void compilingtime_start();
184 void compilingtime_stop();
185
186 void print_times();
187 void print_stats();
188
189 void mem_usagelog(bool givewarnings);
190
191
192 void nativeinvokation();
193 void compiledinvokation();
194 void jnicallXmethodnvokation();
195 void jniinvokation();
196
197
198 #if defined(STATISTICS)
199 #define STATS(x) \
200         { \
201                 if (opt_stat) \
202                         x \
203         }
204 #else
205 #define STATS(x)
206 #endif
207
208
209  
210 #endif /* _STATISTICS_H */
211
212
213 /*
214  * These are local overrides for various environment variables in Emacs.
215  * Please do not remove this and leave it at the end of the file, where
216  * Emacs will automagically detect them.
217  * ---------------------------------------------------------------------
218  * Local variables:
219  * mode: c
220  * indent-tabs-mode: t
221  * c-basic-offset: 4
222  * tab-width: 4
223  * End:
224  */