1 /* jit/inline.h - code inliner
3 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
4 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser,
5 M. Probst, S. Ring, E. Steiner, C. Thalinger, D. Thuernbeck,
6 P. Tomsich, J. Wenninger
8 This file is part of CACAO.
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.
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.
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
25 Contact: cacao@complang.tuwien.ac.at
27 Authors: Dieter Thuernbeck
29 $Id: inline.h 1621 2004-11-30 13:06:55Z twisti $
37 /* resolve typedef cycles *****************************************************/
39 typedef struct t_inlining_globals t_inlining_globals;
42 #include "toolbox/list.h"
43 #include "vm/global.h"
46 #define INLINING_MAXDEPTH 2 /*1*/
47 #define INLINING_MAXCODESIZE 128 /*32*/
48 #define INLINING_MAXMETHODS 32 /*8*/
69 } inlining_methodinfo;
75 /* saved static compiler variables */
79 /* restored through method */
81 /* int jcodelength; */
83 /* classinfo *class; */
85 /* descriptor never used */
86 /* maxstack used outside of main for loop */
87 /* maxlocals never used */
89 /* exceptiontablelength */
90 /* raw_extable used outside of main for loop */
91 /* mreturntype used outside of main for loop */
92 /* mparamcount used outside of main for loop */
93 /* mparamtypes used outside of main for loop */
95 /* local variables used in parse() */
97 int i; /* temporary for different uses (counters)*/
98 int p; /* java instruction counter */
99 int nextp; /* start of next java instruction */
100 int opcode; /* java opcode */
104 inlining_methodinfo *inlinfo;
106 } t_inlining_stacknode;
109 struct t_inlining_globals { /* try in parse.h with struct not include */
110 bool isinlinedmethod;
111 int cumjcodelength; /* cumulative immediate intruction length */
113 int cumextablelength;
114 int cumlocals; /* was static */
115 int cummethods; /* was static */
116 list *inlining_stack; /* was static */
117 inlining_methodinfo *inlining_rootinfo;
126 /* function prototypes*/
128 void inlining_setup(methodinfo *m, t_inlining_globals *inline_env);
129 void inlining_cleanup(t_inlining_globals *inline_env);
130 void inlining_push_compiler_variables(
131 int i, int p, int nextp, int opcode,
132 u2 lineindex,u2 currentline,u2 linepcchange,
133 inlining_methodinfo* inlinfo,
134 t_inlining_globals *inline_env);
135 void inlining_pop_compiler_variables(
136 int *i, int *p, int *nextp, int *opcode,
137 u2 *lineindex,u2 *currentline,u2 *linepcchange,
138 inlining_methodinfo **inlinfo,
139 t_inlining_globals *inline_env);
140 void inlining_set_compiler_variables_fun(methodinfo *m,
141 t_inlining_globals *inline_env);
142 classinfo *first_occurence(classinfo* class, utf* name, utf* desc);
143 bool is_unique_recOLD(classinfo *class, methodinfo *m, utf* name, utf* desc);
144 bool is_unique_methodOLD(classinfo *class, methodinfo *m, utf* name, utf* desc);
145 inlining_methodinfo *inlining_analyse_method(methodinfo *m,
147 int firstlocal, int maxstackdepth, t_inlining_globals *inline_env);
149 void print_t_inlining_globals (t_inlining_globals *g);
150 void print_inlining_stack ( list *s);
151 void print_inlining_methodinfo( inlining_methodinfo *r);
153 #define inlining_save_compiler_variables() \
154 inlining_push_compiler_variables(i,p,nextp,opcode, lineindex,currentline, \
155 linepcchange,inlinfo,inline_env)
157 #define inlining_restore_compiler_variables() \
158 inlining_pop_compiler_variables(&i, &p, &nextp, &opcode, \
159 &lineindex,¤tline,&linepcchange,&inlinfo, \
162 #define inlining_set_compiler_variables(i) \
165 inlining_set_compiler_variables_fun(i->method, inline_env); \
169 #endif /* _INLINE_H */
172 * These are local overrides for various environment variables in Emacs.
173 * Please do not remove this and leave it at the end of the file, where
174 * Emacs will automagically detect them.
175 * ---------------------------------------------------------------------
178 * indent-tabs-mode: t