1 /* src/vm/method.h - method functions header
3 Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel,
4 C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
5 E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
6 J. Wenninger, Institut f. Computersprachen - TU Wien
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., 51 Franklin Street, Fifth Floor, Boston, MA
25 Contact: cacao@cacaojvm.org
27 Authors: Reinhard Grafl
31 $Id: method.h 5974 2006-11-12 15:14:19Z edwin $
38 /* forward typedefs ***********************************************************/
40 typedef struct raw_exception_entry raw_exception_entry;
41 typedef struct lineinfo lineinfo;
42 typedef struct method_assumption method_assumption;
43 typedef struct method_worklist method_worklist;
48 #include "vm/descriptor.h"
49 #include "vm/global.h"
50 #include "vm/linker.h"
51 #include "vm/references.h"
53 #include "vm/jit/code.h"
54 #include "vm/jit/jit.h"
57 /* methodinfo *****************************************************************/
59 struct methodinfo { /* method structure */
60 java_objectheader header; /* we need this in jit's monitorenter */
61 s4 flags; /* ACC flags */
62 utf *name; /* name of method */
63 utf *descriptor; /* JavaVM descriptor string of method */
64 utf *signature; /* Signature attribute string */
65 methoddesc *parseddesc; /* parsed descriptor */
67 classinfo *class; /* class, the method belongs to */
68 s4 vftblindex; /* index of method in virtual function */
69 /* table (if it is a virtual method) */
70 s4 maxstack; /* maximum stack depth of method */
71 s4 maxlocals; /* maximum number of local variables */
72 s4 jcodelength; /* length of JavaVM code */
73 u1 *jcode; /* pointer to JavaVM code */
75 s4 rawexceptiontablelength; /* exceptiontable length */
76 raw_exception_entry *rawexceptiontable; /* the exceptiontable */
78 u2 thrownexceptionscount; /* number of exceptions attribute */
79 classref_or_classinfo *thrownexceptions; /* except. a method may throw */
81 u2 linenumbercount; /* number of linenumber attributes */
82 lineinfo *linenumbers; /* array of lineinfo items */
84 u1 *stubroutine; /* stub for compiling or calling natives */
85 codeinfo *code; /* current code of this method */
87 #if defined(ENABLE_LSRA)
88 s4 maxlifetimes; /* helper for lsra */
91 methodinfo *overwrites; /* method that is directly overwritten */
92 method_assumption *assumptions; /* list of assumptions about this method */
96 /* method_assumption ***********************************************************
98 This struct is used for registering assumptions about methods.
100 *******************************************************************************/
102 struct method_assumption {
103 method_assumption *next;
108 /* method_worklist *************************************************************
110 List node used for method worklists.
112 *******************************************************************************/
114 struct method_worklist {
115 method_worklist *next;
120 /* raw_exception_entry ********************************************************/
122 /* exception table entry read by the loader */
124 struct raw_exception_entry { /* exceptiontable entry in a method */
125 classref_or_classinfo catchtype; /* catchtype of exc. (0 == catchall) */
126 u2 startpc; /* start pc of guarded area (inclusive) */
127 u2 endpc; /* end pc of guarded area (exklusive) */
128 u2 handlerpc; /* pc of exception handler */
132 /* lineinfo *******************************************************************/
140 /* function prototypes ********************************************************/
142 void method_free(methodinfo *m);
143 bool method_canoverwrite(methodinfo *m, methodinfo *old);
145 methodinfo *method_vftbl_lookup(vftbl_t *vftbl, methodinfo* m);
147 void method_add_assumption_monomorphic(methodinfo *m, methodinfo *caller);
148 void method_break_assumption_monomorphic(methodinfo *m, method_worklist **wl);
151 void method_printflags(methodinfo *m);
152 void method_print(methodinfo *m);
153 void method_println(methodinfo *m);
154 void method_methodref_print(constant_FMIref *mr);
155 void method_methodref_println(constant_FMIref *mr);
158 #endif /* _METHOD_H */
162 * These are local overrides for various environment variables in Emacs.
163 * Please do not remove this and leave it at the end of the file, where
164 * Emacs will automagically detect them.
165 * ---------------------------------------------------------------------
168 * indent-tabs-mode: t
172 * vim:noexpandtab:sw=4:ts=4: