#include "vm/types.h"
#include "native/jni.h"
+#include "native/llni.h"
-#if defined(ENABLE_JAVAME_CLDC1_1)
-# include "native/include/java_lang_String.h"/* required by java_lang_Class.h */
-#endif
-
-#include "native/include/java_lang_Class.h"
+#include "native/include/java_lang_Object.h"
+#include "native/include/java_lang_String.h" /* required by j.l.CL */
#if defined(ENABLE_JAVASE)
+# if defined(WITH_CLASSPATH_SUN)
+# include "native/include/java_nio_ByteBuffer.h" /* required by j.l.CL */
+# endif
+
+# include "native/include/java_lang_ClassLoader.h" /* required by j.l.C */
# include "native/include/java_lang_Cloneable.h"
#endif
-#include "native/include/java_lang_Object.h"
+#include "native/include/java_lang_Class.h"
-#if defined(ENABLE_THREADS)
-# include "threads/native/lock.h"
-#endif
+#include "threads/lock-common.h"
#include "vm/builtin.h"
+#include "vm/exceptions.h"
#include "vmcore/options.h"
*/
java_lang_Class *_Jv_java_lang_Object_getClass(java_lang_Object *obj)
{
- classinfo *c;
+ java_objectheader *o;
+ classinfo *c;
+
+ o = (java_objectheader *) obj;
- if (obj == NULL)
+ if (o == NULL) {
+ exceptions_throw_nullpointerexception();
return NULL;
+ }
- c = ((java_objectheader *) obj)->vftbl->class;
+ c = o->vftbl->class;
return (java_lang_Class *) c;
}
void _Jv_java_lang_Object_notify(java_lang_Object *this)
{
#if defined(ENABLE_THREADS)
- lock_notify_object(&this->header);
+ lock_notify_object(&LLNI_field_direct(this, header));
#endif
}
void _Jv_java_lang_Object_notifyAll(java_lang_Object *this)
{
#if defined(ENABLE_THREADS)
- lock_notify_all_object(&this->header);
+ lock_notify_all_object(&LLNI_field_direct(this, header));
#endif
}
#endif
#if defined(ENABLE_THREADS)
- lock_wait_for_object(&o->header, ms, ns);
+ lock_wait_for_object(&LLNI_field_direct(o, header), ms, ns);
#endif
#if defined(ENABLE_JVMTI)