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 5937 2006-11-08 22:00:57Z twisti $
38 /* forward typedefs ***********************************************************/
40 typedef struct raw_exception_entry raw_exception_entry;
41 typedef struct lineinfo lineinfo;
46 #include "vm/descriptor.h"
47 #include "vm/global.h"
48 #include "vm/linker.h"
49 #include "vm/references.h"
51 #include "vm/jit/code.h"
52 #include "vm/jit/jit.h"
55 /* methodinfo *****************************************************************/
57 struct methodinfo { /* method structure */
58 java_objectheader header; /* we need this in jit's monitorenter */
59 s4 flags; /* ACC flags */
60 utf *name; /* name of method */
61 utf *descriptor; /* JavaVM descriptor string of method */
62 utf *signature; /* Signature attribute string */
63 methoddesc *parseddesc; /* parsed descriptor */
65 classinfo *class; /* class, the method belongs to */
66 s4 vftblindex; /* index of method in virtual function */
67 /* table (if it is a virtual method) */
68 s4 maxstack; /* maximum stack depth of method */
69 s4 maxlocals; /* maximum number of local variables */
70 s4 jcodelength; /* length of JavaVM code */
71 u1 *jcode; /* pointer to JavaVM code */
73 s4 rawexceptiontablelength; /* exceptiontable length */
74 raw_exception_entry *rawexceptiontable; /* the exceptiontable */
76 u2 thrownexceptionscount; /* number of exceptions attribute */
77 classref_or_classinfo *thrownexceptions; /* except. a method may throw */
79 u2 linenumbercount; /* number of linenumber attributes */
80 lineinfo *linenumbers; /* array of lineinfo items */
82 u1 *stubroutine; /* stub for compiling or calling natives */
83 codeinfo *code; /* current code of this method */
85 #if defined(ENABLE_LSRA)
86 s4 maxlifetimes; /* helper for lsra */
91 /* raw_exception_entry ********************************************************/
93 /* exception table entry read by the loader */
95 struct raw_exception_entry { /* exceptiontable entry in a method */
96 classref_or_classinfo catchtype; /* catchtype of exc. (0 == catchall) */
97 u2 startpc; /* start pc of guarded area (inclusive) */
98 u2 endpc; /* end pc of guarded area (exklusive) */
99 u2 handlerpc; /* pc of exception handler */
103 /* lineinfo *******************************************************************/
111 /* function prototypes ********************************************************/
113 void method_free(methodinfo *m);
114 bool method_canoverwrite(methodinfo *m, methodinfo *old);
116 methodinfo *method_vftbl_lookup(vftbl_t *vftbl, methodinfo* m);
119 void method_printflags(methodinfo *m);
120 void method_print(methodinfo *m);
121 void method_println(methodinfo *m);
122 void method_methodref_print(constant_FMIref *mr);
123 void method_methodref_println(constant_FMIref *mr);
126 #endif /* _METHOD_H */
130 * These are local overrides for various environment variables in Emacs.
131 * Please do not remove this and leave it at the end of the file, where
132 * Emacs will automagically detect them.
133 * ---------------------------------------------------------------------
136 * indent-tabs-mode: t
140 * vim:noexpandtab:sw=4:ts=4: