236b0bdbed96977aec998668677384cf5f7c41ab
[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 /* compiler switches (set by main function) ***********************************/
17
18 extern bool runverbose;         /* trace all method invocation                */
19 extern bool compileverbose;     /* trace compiler actions                     */
20 extern bool showdisassemble;    /* generate disassembler listing              */
21 extern bool showddatasegment;   /* generate data segment listing              */
22 extern bool showintermediate;   /* generate intermediate code listing         */
23 extern int  optimizelevel;      /* optimzation level  (0 = no optimization)   */
24
25 extern bool checkbounds;        /* check array bounds                         */
26 extern bool checknull;          /* check null pointers                        */
27 extern bool checkfloats;        /* implement ieee compliant floats            */
28 extern bool checksync;          /* do synchronization                         */
29
30 extern bool getcompilingtime;   /* compute compile time                       */
31 extern long compilingtime;      /* accumulated compile time                   */
32
33 extern int  has_ext_instr_set;  /* has instruction set extensions */
34
35 extern bool statistics;         
36
37 extern int count_jit_calls;
38 extern int count_methods;
39 extern int count_spills;
40 extern int count_pcmd_activ;
41 extern int count_pcmd_drop;
42 extern int count_pcmd_zero;
43 extern int count_pcmd_const_store;
44 extern int count_pcmd_const_alu;
45 extern int count_pcmd_const_bra;
46 extern int count_pcmd_load;
47 extern int count_pcmd_move;
48 extern int count_load_instruction;
49 extern int count_pcmd_store;
50 extern int count_pcmd_store_comb;
51 extern int count_dup_instruction;
52 extern int count_pcmd_op;
53 extern int count_pcmd_mem;
54 extern int count_pcmd_met;
55 extern int count_pcmd_bra;
56 extern int count_pcmd_table;
57 extern int count_pcmd_return;
58 extern int count_pcmd_returnx;
59 extern int count_check_null;
60 extern int count_check_bound;
61 extern int count_max_basic_blocks;
62 extern int count_basic_blocks;
63 extern int count_max_javainstr;
64 extern int count_javainstr;
65 extern int count_javacodesize;
66 extern int count_javaexcsize;
67 extern int count_calls;
68 extern int count_tryblocks;
69 extern int count_code_len;
70 extern int count_data_len;
71 extern int count_cstub_len;
72 extern int count_nstub_len;
73 extern int count_max_new_stack;
74 extern int count_upper_bound_new_stack;
75 extern int *count_block_stack;
76 extern int *count_analyse_iterations;
77 extern int *count_method_bb_distribution;
78 extern int *count_block_size_distribution;
79 extern int *count_store_length;
80 extern int *count_store_depth;
81
82 /* prototypes *****************************************************************/
83
84 methodptr jit_compile (methodinfo *m);  /* compile a method with jit compiler */
85
86 void jit_init();                        /* compiler initialisation            */
87 void jit_close();                       /* compiler finalisation              */
88
89 u1 *createcompilerstub (methodinfo *m);
90 u1 *createnativestub (functionptr f, methodinfo *m);
91
92 void removecompilerstub (u1 *stub);
93 void removenativestub (u1 *stub);
94
95
96 /*
97  * These are local overrides for various environment variables in Emacs.
98  * Please do not remove this and leave it at the end of the file, where
99  * Emacs will automagically detect them.
100  * ---------------------------------------------------------------------
101  * Local variables:
102  * mode: c
103  * indent-tabs-mode: t
104  * c-basic-offset: 4
105  * tab-width: 4
106  * End:
107  */