added statistics for size of classrefs and parsed descriptors
[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 2080 2005-03-25 13:35:06Z edwin $
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 memoryusage;
67 extern s4 maxmemusage;
68 extern s4 maxdumpsize;
69
70 extern s4 globalallocateddumpsize;
71 extern s4 globaluseddumpsize;
72
73 extern int count_class_infos;           /* variables for measurements         */
74 extern int count_const_pool_len;
75 extern int count_classref_len;
76 extern int count_parsed_desc_len;
77 extern int count_vftbl_len;
78 extern int count_all_methods;
79 extern int count_methods_marked_used;  /*RTA*/
80 extern int count_vmcode_len;
81 extern int count_extable_len;
82 extern int count_class_loads;
83 extern int count_class_inits;
84
85 extern int count_utf_len;               /* size of utf hash                   */
86 extern int count_utf_new;
87 extern int count_utf_new_found;
88
89 extern int count_locals_conflicts;
90 extern int count_locals_spilled;
91 extern int count_locals_register;
92 extern int count_ss_spilled;
93 extern int count_ss_register;
94 extern int count_methods_allocated_by_lsra;
95 extern int count_mem_move_bb;
96 extern int count_interface_size;
97 extern int count_argument_mem_ss;
98 extern int count_argument_reg_ss;
99 extern int count_method_in_register;
100
101 extern int count_jit_calls;
102 extern int count_methods;
103 extern int count_spills;
104 extern int count_spills_read;
105 extern int count_pcmd_activ;
106 extern int count_pcmd_drop;
107 extern int count_pcmd_zero;
108 extern int count_pcmd_const_store;
109 extern int count_pcmd_const_alu;
110 extern int count_pcmd_const_bra;
111 extern int count_pcmd_load;
112 extern int count_pcmd_move;
113 extern int count_load_instruction;
114 extern int count_pcmd_store;
115 extern int count_pcmd_store_comb;
116 extern int count_dup_instruction;
117 extern int count_pcmd_op;
118 extern int count_pcmd_mem;
119 extern int count_pcmd_met;
120 extern int count_pcmd_bra;
121 extern int count_pcmd_table;
122 extern int count_pcmd_return;
123 extern int count_pcmd_returnx;
124 extern int count_check_null;
125 extern int count_check_bound;
126 extern int count_max_basic_blocks;
127 extern int count_basic_blocks;
128 extern int count_max_javainstr;
129 extern int count_javainstr;
130 extern int count_javacodesize;
131 extern int count_javaexcsize;
132 extern int count_calls;
133 extern int count_tryblocks;
134 extern int count_code_len;
135 extern int count_data_len;
136 extern int count_cstub_len;
137 extern int count_nstub_len;
138 extern int count_max_new_stack;
139 extern int count_upper_bound_new_stack;
140 extern int *count_block_stack;
141 extern int *count_analyse_iterations;
142 extern int *count_method_bb_distribution;
143 extern int *count_block_size_distribution;
144 extern int *count_store_length;
145 extern int *count_store_depth;
146                                 /* in_  inline statistics */
147 extern int count_in;
148 extern int count_in_uniqVirt;
149 extern int count_in_uniqIntf;
150 extern int count_in_rejected;
151 extern int count_in_rejected_mult;
152 extern int count_in_outsiders;
153 extern int count_in_uniqueVirt_not_inlined;
154 extern int count_in_uniqueInterface_not_inlined;
155 extern int count_in_maxDepth;
156 extern int count_in_maxMethods;
157
158 extern u2 count_in_not   [512];
159
160 /* instruction scheduler statistics *******************************************/
161
162 extern s4 count_schedule_basic_blocks;
163 extern s4 count_schedule_nodes;
164 extern s4 count_schedule_leaders;
165 extern s4 count_schedule_max_leaders;
166 extern s4 count_schedule_critical_path;
167
168
169 /* function prototypes ********************************************************/
170
171 s8 getcputime();
172
173 void loadingtime_start();
174 void loadingtime_stop();
175 void compilingtime_start();
176 void compilingtime_stop();
177
178 void print_times();
179 void print_stats();
180
181 void mem_usagelog(bool givewarnings);
182  
183 #endif /* _STATISTICS_H */
184
185
186 /*
187  * These are local overrides for various environment variables in Emacs.
188  * Please do not remove this and leave it at the end of the file, where
189  * Emacs will automagically detect them.
190  * ---------------------------------------------------------------------
191  * Local variables:
192  * mode: c
193  * indent-tabs-mode: t
194  * c-basic-offset: 4
195  * tab-width: 4
196  * End:
197  */