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.
*/
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());
}
#include "vm/builtin.h"
#include "vm/exceptions.hpp"
+#include "vm/javaobjects.hpp"
#include "vm/utf8.h"
*/
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());
}
JNIEXPORT jint JNICALL Java_java_lang_VMSystem_identityHashCode(JNIEnv *env, jclass clazz, jobject obj)
{
java_lang_Object o(obj);
+
return o.get_hashcode();
}
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);
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);
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);
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,
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);
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;