* src/vmcore/method.c (method_returntype_get): New function.
authortwisti <none@none>
Mon, 11 Jun 2007 14:44:58 +0000 (14:44 +0000)
committertwisti <none@none>
Mon, 11 Jun 2007 14:44:58 +0000 (14:44 +0000)
* src/vmcore/method.h (method_returntype_get): Added.

* src/native/vm/gnu/java_lang_reflect_Method.c (getReturnType): Use
method_returntype_get.

src/native/vm/gnu/java_lang_reflect_Method.c
src/vmcore/method.c
src/vmcore/method.h

index abdeca89c884e1cc3a1ad6c9af2c7cbce94ef0bc..a7c07964a784e9d66178ff433a909416351d77f0 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: java_lang_reflect_Method.c 7976 2007-05-29 12:22:55Z twisti $
+   $Id: java_lang_reflect_Method.c 8063 2007-06-11 14:44:58Z twisti $
 
 */
 
@@ -50,6 +50,8 @@
 #include "vm/resolve.h"
 #include "vm/stringlocal.h"
 
+#include "vmcore/method.h"
+
 
 /* native methods implemented by this file ************************************/
 
@@ -105,17 +107,14 @@ JNIEXPORT java_lang_Class* JNICALL Java_java_lang_reflect_Method_getReturnType(J
 {
        classinfo  *c;
        methodinfo *m;
-       typedesc   *td;
+       classinfo  *result;
 
        c = (classinfo *) this->declaringClass;
        m = &(c->methods[this->slot]);
 
-       td = &(m->parseddesc->returntype);
-
-       if (!resolve_class_from_typedesc(td, true, false, &c))
-               return NULL;
+       result = method_returntype_get(m);
 
-       return (java_lang_Class *) c;
+       return (java_lang_Class *) result;
 }
 
 
index f9dc0924e77fa14e44936be839ea374ff66ade46..b2d3e970301307ca8110d18eb6bf451caece1238 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: method.c 7573 2007-03-25 18:55:02Z twisti $
+   $Id: method.c 8063 2007-06-11 14:44:58Z twisti $
 
 */
 
@@ -238,6 +238,26 @@ java_objectarray *method_get_exceptionarray(methodinfo *m)
 }
 
 
+/* method_returntype_get *******************************************************
+
+   Get the return type of the method.
+
+*******************************************************************************/
+
+classinfo *method_returntype_get(methodinfo *m)
+{
+       typedesc  *td;
+       classinfo *c;
+
+       td = &(m->parseddesc->returntype);
+
+       if (!resolve_class_from_typedesc(td, true, false, &c))
+               return NULL;
+
+       return c;
+}
+
+
 /* method_count_implementations ************************************************
 
    Count the implementations of a method in a class cone (a class and all its
index 71ce13c366328e763b92fa10a99eff7a8cdb4b86..c32f05bcd4ff66c108a5ca2a0cf38983cb2fd452 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: method.h 7966 2007-05-25 12:41:03Z pm $
+   $Id: method.h 8063 2007-06-11 14:44:58Z twisti $
 */
 
 
@@ -164,6 +164,7 @@ methodinfo *method_vftbl_lookup(vftbl_t *vftbl, methodinfo* m);
 
 java_objectarray *method_get_parametertypearray(methodinfo *m);
 java_objectarray *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);