* Removed all Id tags.
[cacao.git] / src / vmcore / method.c
index da7473d1d849bd5e646fd6116ebf7734ced7702f..17e40bd785443145b26172755bdd0cd3b1290fc0 100644 (file)
@@ -22,8 +22,6 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: method.c 8315 2007-08-15 22:49:20Z panzi $
-
 */
 
 
@@ -37,6 +35,8 @@
 
 #include "mm/memory.h"
 
+#include "native/llni.h"
+
 #include "threads/lock-common.h"
 
 #include "vm/builtin.h"
@@ -624,14 +624,14 @@ int32_t method_get_parametercount(methodinfo *m)
 
 *******************************************************************************/
 
-java_objectarray *method_get_parametertypearray(methodinfo *m)
+java_handle_objectarray_t *method_get_parametertypearray(methodinfo *m)
 {
-       methoddesc       *md;
-       typedesc         *paramtypes;
-       int32_t           paramcount;
-       java_objectarray *oa;
-       int32_t           i;
-       classinfo        *c;
+       methoddesc                *md;
+       typedesc                  *paramtypes;
+       int32_t                    paramcount;
+       java_handle_objectarray_t *oa;
+       int32_t                    i;
+       classinfo                 *c;
 
        md = m->parseddesc;
 
@@ -664,7 +664,7 @@ java_objectarray *method_get_parametertypearray(methodinfo *m)
                if (!resolve_class_from_typedesc(&paramtypes[i], true, false, &c))
                        return NULL;
 
-               oa->data[i] = c;
+               LLNI_array_direct(oa, i) = (java_object_t *) c;
        }
 
        return oa;
@@ -677,11 +677,11 @@ java_objectarray *method_get_parametertypearray(methodinfo *m)
 
 *******************************************************************************/
 
-java_objectarray *method_get_exceptionarray(methodinfo *m)
+java_handle_objectarray_t *method_get_exceptionarray(methodinfo *m)
 {
-       java_objectarray *oa;
-       classinfo        *c;
-       s4                i;
+       java_handle_objectarray_t *oa;
+       classinfo                 *c;
+       s4                         i;
 
        /* create class-array */
 
@@ -698,7 +698,7 @@ java_objectarray *method_get_exceptionarray(methodinfo *m)
                if (c == NULL)
                        return NULL;
 
-               oa->data[i] = c;
+               LLNI_array_direct(oa, i) = (java_object_t *) c;
        }
 
        return oa;
@@ -774,19 +774,23 @@ s4 method_count_implementations(methodinfo *m, classinfo *c, methodinfo **found)
 }
 
 
-#if defined(ENABLE_ANNOTATIONS)
 /* method_get_annotations ******************************************************
 
    Gets a methods' annotations (or NULL if none).
 
 *******************************************************************************/
 
-java_bytearray *method_get_annotations(methodinfo *m)
+java_handle_bytearray_t *method_get_annotations(methodinfo *m)
 {
-       classinfo              *c           = m->class;
-       int                     slot        = m - c->methods;
-       annotation_bytearray_t *ba          = NULL;
-       java_bytearray         *annotations = NULL;
+#if defined(ENABLE_ANNOTATIONS)
+       classinfo               *c;
+       int                      slot;
+       annotation_bytearray_t  *ba;
+       java_handle_bytearray_t *annotations;
+
+       c           = m->class;
+       slot        = m - c->methods;
+       annotations = NULL;
        
        if (c->method_annotations != NULL && c->method_annotations->size > slot) {
                ba = c->method_annotations->data[slot];
@@ -801,6 +805,9 @@ java_bytearray *method_get_annotations(methodinfo *m)
        }
        
        return annotations;
+#else
+       return NULL;
+#endif
 }
 
 
@@ -810,12 +817,17 @@ java_bytearray *method_get_annotations(methodinfo *m)
 
 *******************************************************************************/
 
-java_bytearray *method_get_parameterannotations(methodinfo *m)
+java_handle_bytearray_t *method_get_parameterannotations(methodinfo *m)
 {
-       classinfo              *c                    = m->class;
-       int                     slot                 = m - c->methods;
-       annotation_bytearray_t *ba                   = NULL;
-       java_bytearray         *parameterAnnotations = NULL;
+#if defined(ENABLE_ANNOTATIONS)
+       classinfo               *c;
+       int                      slot;
+       annotation_bytearray_t  *ba;
+       java_handle_bytearray_t *parameterAnnotations;
+
+       c                    = m->class;
+       slot                 = m - c->methods;
+       parameterAnnotations = NULL;
 
        if (c->method_parameterannotations != NULL &&
                c->method_parameterannotations->size > slot) {
@@ -831,6 +843,9 @@ java_bytearray *method_get_parameterannotations(methodinfo *m)
        }
        
        return parameterAnnotations;
+#else
+       return NULL;
+#endif
 }
 
 
@@ -840,12 +855,17 @@ java_bytearray *method_get_parameterannotations(methodinfo *m)
 
 *******************************************************************************/
 
-java_bytearray *method_get_annotationdefault(methodinfo *m)
+java_handle_bytearray_t *method_get_annotationdefault(methodinfo *m)
 {
-       classinfo              *c                 = m->class;
-       int                     slot              = m - c->methods;
-       annotation_bytearray_t *ba                = NULL;
-       java_bytearray         *annotationDefault = NULL;
+#if defined(ENABLE_ANNOTATIONS)
+       classinfo               *c;
+       int                      slot;
+       annotation_bytearray_t  *ba;
+       java_handle_bytearray_t *annotationDefault;
+
+       c                 = m->class;
+       slot              = m - c->methods;
+       annotationDefault = NULL;
 
        if (c->method_annotationdefaults != NULL &&
                c->method_annotationdefaults->size > slot) {
@@ -861,8 +881,10 @@ java_bytearray *method_get_annotationdefault(methodinfo *m)
        }
        
        return annotationDefault;
-}
+#else
+       return NULL;
 #endif
+}
 
 
 /* method_add_to_worklist ******************************************************