X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=src%2Fvmcore%2Fmethod.h;h=ff28286f477164a7b09e64f1c485a882b5ef8c6f;hb=b09cdc3299b9caac1cbf3c735d7b4d927e7c23af;hp=964a5ae41f7dd15c8a3549c82cd0716ecd57bafd;hpb=fca538031890410f0695001f80fb0d4c669836ba;p=cacao.git diff --git a/src/vmcore/method.h b/src/vmcore/method.h index 964a5ae41..ff28286f4 100644 --- a/src/vmcore/method.h +++ b/src/vmcore/method.h @@ -1,9 +1,7 @@ /* src/vmcore/method.h - method functions header - Copyright (C) 1996-2005, 2006, 2007 R. Grafl, A. Krall, C. Kruegel, - C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring, - E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, - J. Wenninger, Institut f. Computersprachen - TU Wien + Copyright (C) 1996-2005, 2006, 2007, 2008 + CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO This file is part of CACAO. @@ -22,7 +20,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - $Id: method.h 7464 2007-03-06 00:26:31Z edwin $ */ @@ -41,11 +38,13 @@ typedef struct codeinfo codeinfo; #include "config.h" #include "vm/types.h" +#include "vm/builtin.h" #include "vm/global.h" #include "vmcore/descriptor.h" #include "vmcore/references.h" #include "vmcore/linker.h" +#include "vmcore/loader.h" #if defined(ENABLE_JAVASE) # include "vmcore/stackmap.h" @@ -63,6 +62,7 @@ typedef struct codeinfo codeinfo; /* methodinfo *****************************************************************/ struct methodinfo { /* method structure */ + java_object_t header; /* we need this in jit's monitorenter */ s4 flags; /* ACC flags */ utf *name; /* name of method */ utf *descriptor; /* JavaVM descriptor string of method */ @@ -73,7 +73,7 @@ struct methodinfo { /* method structure */ methoddesc *parseddesc; /* parsed descriptor */ - classinfo *class; /* class, the method belongs to */ + classinfo *clazz; /* class, the method belongs to */ s4 vftblindex; /* index of method in virtual function */ /* table (if it is a virtual method) */ s4 maxstack; /* maximum stack depth of method */ @@ -103,8 +103,15 @@ struct methodinfo { /* method structure */ #if defined(ENABLE_REPLACEMENT) s4 hitcountdown; /* decreased for each hit */ #endif -}; +#if defined(ENABLE_DEBUG_FILTER) + u1 filtermatches; /* flags indicating which filters the method matches */ +#endif + +#if defined(ENABLE_ESCAPE) + u1 *paramescape; +#endif +}; /* method_assumption *********************************************************** @@ -150,18 +157,45 @@ struct lineinfo { }; +/* global variables ***********************************************************/ + +extern methodinfo *method_java_lang_reflect_Method_invoke; + + +/* inline functions ***********************************************************/ + +inline static bool method_is_builtin(methodinfo* m) +{ + return m->flags & ACC_METHOD_BUILTIN; +} + + /* function prototypes ********************************************************/ +void method_init(void); + +bool method_load(classbuffer *cb, methodinfo *m, descriptor_pool *descpool); void method_free(methodinfo *m); bool method_canoverwrite(methodinfo *m, methodinfo *old); +methodinfo *method_new_builtin(builtintable_entry *bte); + methodinfo *method_vftbl_lookup(vftbl_t *vftbl, methodinfo* m); +int32_t method_get_parametercount(methodinfo *m); +java_handle_objectarray_t *method_get_parametertypearray(methodinfo *m); +java_handle_objectarray_t *method_get_exceptionarray(methodinfo *m); +classinfo *method_returntype_get(methodinfo *m); + void method_add_assumption_monomorphic(methodinfo *m, methodinfo *caller); void method_break_assumption_monomorphic(methodinfo *m, method_worklist **wl); s4 method_count_implementations(methodinfo *m, classinfo *c, methodinfo **found); +java_handle_bytearray_t *method_get_annotations(methodinfo *m); +java_handle_bytearray_t *method_get_parameterannotations(methodinfo *m); +java_handle_bytearray_t *method_get_annotationdefault(methodinfo *m); + #if !defined(NDEBUG) void method_printflags(methodinfo *m); void method_print(methodinfo *m);