* src/native/vm/cldc1.1/java_lang_Object.cpp: Use getter function instead of
authorMichael Starzinger <michi@complang.tuwien.ac.at>
Wed, 20 Aug 2008 14:55:14 +0000 (16:55 +0200)
committerMichael Starzinger <michi@complang.tuwien.ac.at>
Wed, 20 Aug 2008 14:55:14 +0000 (16:55 +0200)
LLNI macro to determine objects class.

* src/native/vm/gnuclasspath/java_lang_VMObject.cpp: Likewise.
* src/native/vm/gnuclasspath/java_lang_reflect_VMConstructor.cpp: Likewise.
* src/native/vm/gnuclasspath/java_lang_reflect_VMField.cpp: Likewise.
* src/native/vm/gnuclasspath/java_lang_reflect_VMMethod.cpp: Likewise.

src/native/vm/cldc1.1/java_lang_Object.cpp
src/native/vm/gnuclasspath/java_lang_VMObject.cpp
src/native/vm/gnuclasspath/java_lang_VMSystem.cpp
src/native/vm/gnuclasspath/java_lang_reflect_VMConstructor.cpp
src/native/vm/gnuclasspath/java_lang_reflect_VMField.cpp
src/native/vm/gnuclasspath/java_lang_reflect_VMMethod.cpp

index 14711dcd784bfb8f3e7c359b19389730b661eb7a..2f934c6a4c85eafdbae7ed357389d59e01dfe4c8 100644 (file)
@@ -52,16 +52,14 @@ extern "C" {
  */
 JNIEXPORT jclass JNICALL Java_java_lang_Object_getClass(JNIEnv *env, jobject obj)
 {
-       classinfo *c;
-
        if (obj == NULL) {
                exceptions_throw_nullpointerexception();
                return NULL;
        }
 
-       LLNI_class_get(obj, c);
+       java_lang_Object o(obj);
 
-       return (jclass) LLNI_classinfo_wrap(c);
+       return (jclass) LLNI_classinfo_wrap(o.get_Class());
 }
 
 
index a671f9b4f1d9a0feb5e5b2fd034f9f301cc07b61..b5af0cdefafeb5d236c3e2a28c29bc8b9de02be9 100644 (file)
@@ -39,6 +39,7 @@
 
 #include "vm/builtin.h"
 #include "vm/exceptions.hpp"
+#include "vm/javaobjects.hpp"
 #include "vm/utf8.h"
 
 
@@ -52,16 +53,14 @@ extern "C" {
  */
 JNIEXPORT jclass JNICALL Java_java_lang_VMObject_getClass(JNIEnv *env, jclass clazz, jobject obj)
 {
-       classinfo *c;
-
        if (obj == NULL) {
                exceptions_throw_nullpointerexception();
                return NULL;
        }
 
-       LLNI_class_get(obj, c);
+       java_lang_Object o(obj);
 
-       return (jclass) LLNI_classinfo_wrap(c);
+       return (jclass) LLNI_classinfo_wrap(o.get_Class());
 }
 
 
index 3a7b67ff2e7ff041444d13065e3e99485b07b74a..180914bea4ae82c54959567d55bdb6da6bff7d64 100644 (file)
@@ -65,6 +65,7 @@ JNIEXPORT void JNICALL Java_java_lang_VMSystem_arraycopy(JNIEnv *env, jclass cla
 JNIEXPORT jint JNICALL Java_java_lang_VMSystem_identityHashCode(JNIEnv *env, jclass clazz, jobject obj)
 {
        java_lang_Object o(obj);
+
        return o.get_hashcode();
 }
 
index 756ef407d0ab65494b0ee64c1cff799f2acb05a8..ffb0bb737a20afdcc57a15d799de5eb25ad94126 100644 (file)
@@ -148,9 +148,7 @@ JNIEXPORT jobject JNICALL Java_java_lang_reflect_VMConstructor_declaredAnnotatio
        if (declaredAnnotations == NULL) {
                java_handle_bytearray_t* annotations    = rvmc.get_annotations();
                classinfo*               declaringClass = rvmc.get_clazz();
-
-               classinfo *referer;
-               LLNI_class_get(_this, referer);
+               classinfo*               referer        = rvmc.get_Class();
 
                declaredAnnotations = Reflection::get_declaredannotations(annotations, declaringClass, referer);
 
@@ -174,9 +172,7 @@ JNIEXPORT jobjectArray JNICALL Java_java_lang_reflect_VMConstructor_getParameter
 
        java_handle_bytearray_t* parameterAnnotations = rvmc.get_parameterAnnotations();
        methodinfo* m = rvmc.get_method();
-
-       classinfo* referer;
-       LLNI_class_get((java_lang_reflect_VMConstructor*) _this, referer);
+       classinfo* referer = rvmc.get_Class();
 
        java_handle_objectarray_t* oa = Reflection::get_parameterannotations(parameterAnnotations, m, referer);
 
index 8a100bbe326e456f67e15e3442a102288eea5904..4762379361a25a31e3e79d01f9afa46b377d5d1d 100644 (file)
@@ -1134,9 +1134,7 @@ JNIEXPORT jobject JNICALL Java_java_lang_reflect_VMField_declaredAnnotations(JNI
        if (declaredAnnotations == NULL) {
                java_handle_bytearray_t* annotations    = rvmf.get_annotations();
                classinfo*               declaringClass = rvmf.get_clazz();
-
-               classinfo* referer;
-               LLNI_class_get(_this, referer);
+               classinfo*               referer        = rvmf.get_Class();
 
                declaredAnnotations = Reflection::get_declaredannotations(annotations, declaringClass, referer);
 
index 561ab3882b3affecf84a0345622b05ea1ed719cd..7be27fd6bac4ef2c365dfe7c836616016c0501ff 100644 (file)
@@ -193,8 +193,7 @@ JNIEXPORT jobject JNICALL Java_java_lang_reflect_VMMethod_getDefaultValue(JNIEnv
                        return NULL;
                }
 
-               classinfo *referer;
-               LLNI_class_get((java_lang_reflect_VMMethod *) _this, referer);
+               classinfo *referer = rvmm.get_Class();
 
                m_parseAnnotationDefault = class_resolveclassmethod(
                        class_sun_reflect_annotation_AnnotationParser,
@@ -232,9 +231,7 @@ JNIEXPORT jobject JNICALL Java_java_lang_reflect_VMMethod_declaredAnnotations(JN
        if (declaredAnnotations == NULL) {
                java_handle_bytearray_t* annotations    = rvmm.get_annotations();
                classinfo*               declaringClass = rvmm.get_clazz();
-
-               classinfo *referer;
-               LLNI_class_get((java_lang_reflect_VMMethod *) _this, referer);
+               classinfo*               referer        = rvmm.get_Class();
 
                declaredAnnotations = Reflection::get_declaredannotations(annotations, declaringClass, referer);
 
@@ -255,9 +252,7 @@ JNIEXPORT jobjectArray JNICALL Java_java_lang_reflect_VMMethod_getParameterAnnot
        java_lang_reflect_VMMethod rvmm(_this);
        java_handle_bytearray_t* parameterAnnotations = rvmm.get_parameterAnnotations();
        methodinfo* m = rvmm.get_method();
-
-       classinfo* referer;
-       LLNI_class_get((java_lang_reflect_VMMethod *) _this, referer);
+       classinfo* referer = rvmm.get_Class();
 
        java_handle_objectarray_t* oa = Reflection::get_parameterannotations(parameterAnnotations, m, referer);
        return (jobjectArray) oa;