Comment
[cacao.git] / jit.h
1 /* jit.h ***********************************************************************
2
3         Copyright (c) 1997 A. Krall, R. Grafl, M. Gschwind, M. Probst
4
5         See file COPYRIGHT for information on usage and disclaimer of warranties
6
7         new compiler header file for inclusion in other moduls.
8
9         Authors: Andreas  Krall      EMAIL: cacao@complang.tuwien.ac.at
10                  Reinhard Grafl      EMAIL: cacao@complang.tuwien.ac.at
11
12         Last Change: 1997/11/05
13
14 *******************************************************************************/
15
16 #ifndef __jit__
17 #define __jit__
18
19 /* compiler switches (set by main function) ***********************************/
20
21 extern bool runverbose;         /* trace all method invocation                */
22 extern bool compileverbose;     /* trace compiler actions                     */
23 extern bool showdisassemble;    /* generate disassembler listing              */
24 extern bool showddatasegment;   /* generate data segment listing              */
25 extern bool showintermediate;   /* generate intermediate code listing         */
26 extern int  optimizelevel;      /* optimzation level  (0 = no optimization)   */
27
28 extern bool useinlining;        /* use method inlining                        */
29 extern bool inlinevirtuals; /* inline unique virtual methods */
30 extern bool inlineexceptions; /* inline methods, that contain excptions */
31 extern bool inlineparamopt; /* optimize parameter passing to inlined methods */
32 extern bool inlineoutsiders; /* inline methods, that are not member of the invoker's class */
33
34
35 extern bool checkbounds;        /* check array bounds                         */
36 extern bool opt_loops;          /* optimize array accesses in loops           */
37 extern bool checknull;          /* check null pointers                        */
38 extern bool opt_noieee;         /* don't implement ieee compliant floats      */
39 extern bool checksync;          /* do synchronization                         */
40
41 extern bool getcompilingtime;   /* compute compile time                       */
42 extern long compilingtime;      /* accumulated compile time                   */
43
44 extern int  has_ext_instr_set;  /* has instruction set extensions */
45
46 extern bool statistics;         
47
48 extern int count_jit_calls;
49 extern int count_methods;
50 extern int count_spills;
51 extern int count_pcmd_activ;
52 extern int count_pcmd_drop;
53 extern int count_pcmd_zero;
54 extern int count_pcmd_const_store;
55 extern int count_pcmd_const_alu;
56 extern int count_pcmd_const_bra;
57 extern int count_pcmd_load;
58 extern int count_pcmd_move;
59 extern int count_load_instruction;
60 extern int count_pcmd_store;
61 extern int count_pcmd_store_comb;
62 extern int count_dup_instruction;
63 extern int count_pcmd_op;
64 extern int count_pcmd_mem;
65 extern int count_pcmd_met;
66 extern int count_pcmd_bra;
67 extern int count_pcmd_table;
68 extern int count_pcmd_return;
69 extern int count_pcmd_returnx;
70 extern int count_check_null;
71 extern int count_check_bound;
72 extern int count_max_basic_blocks;
73 extern int count_basic_blocks;
74 extern int count_max_javainstr;
75 extern int count_javainstr;
76 extern int count_javacodesize;
77 extern int count_javaexcsize;
78 extern int count_calls;
79 extern int count_tryblocks;
80 extern int count_code_len;
81 extern int count_data_len;
82 extern int count_cstub_len;
83 extern int count_nstub_len;
84 extern int count_max_new_stack;
85 extern int count_upper_bound_new_stack;
86 extern int *count_block_stack;
87 extern int *count_analyse_iterations;
88 extern int *count_method_bb_distribution;
89 extern int *count_block_size_distribution;
90 extern int *count_store_length;
91 extern int *count_store_depth;
92
93 /* prototypes *****************************************************************/
94
95 methodptr jit_compile (methodinfo *m);  /* compile a method with jit compiler */
96
97 void jit_init();                        /* compiler initialisation            */
98 void jit_close();                       /* compiler finalisation              */
99
100 u1 *createcompilerstub (methodinfo *m);
101 u1 *createnativestub (functionptr f, methodinfo *m);
102
103 void removecompilerstub (u1 *stub);
104 void removenativestub (u1 *stub);
105 /*------------ Method /Class Used Markers -------------------------------*/                 
106
107 /* Class flags =
108    USED all methods and fields are available; 
109    PARTUSED = specific methods (static, <init>, <clinit>, inherited def used, special) used, 
110               but not instanciated
111    NOTUSED = nothing used in class - not needed 
112 */
113
114 /* Method Flags =
115    USED = method definition is used
116    PARTUSED = method definition will be used if class instanciated
117    NOTUSED  = method defintion never used
118 */
119
120 #define USED      2
121 #define PARTUSED  1
122 #define MARKED    1
123 #define NOTUSED   0
124
125 #define MONO      0
126 #define MONO1     1 /* potential poly that is really mono */
127 #define POLY      2
128
129 #endif
130
131 /*
132  * These are local overrides for various environment variables in Emacs.
133  * Please do not remove this and leave it at the end of the file, where
134  * Emacs will automagically detect them.
135  * ---------------------------------------------------------------------
136  * Local variables:
137  * mode: c
138  * indent-tabs-mode: t
139  * c-basic-offset: 4
140  * tab-width: 4
141  * End:
142  */