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