Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: java_lang_VMRuntime.c 5900 2006-11-04 17:30:44Z michi $
-
*/
#include "vm/types.h"
#include "native/jni.h"
+#include "native/llni.h"
+#include "native/native.h"
-#include "native/include/java_lang_String.h" /* required by java_lang_Class.h */
+#include "native/include/java_lang_String.h" /* required by j.l.C */
#include "native/include/java_lang_Class.h"
+
#include "native/include/java_lang_Object.h"
#include "native/vm/java_lang_Object.h"
+/* native methods implemented by this file ************************************/
+
+static JNINativeMethod methods[] = {
+ { "getClass", "()Ljava/lang/Class;", (void *) (ptrint) &Java_java_lang_Object_getClass },
+ { "hashCode", "()I", (void *) (ptrint) &Java_java_lang_Object_hashCode },
+ { "notify", "()V", (void *) (ptrint) &Java_java_lang_Object_notify },
+ { "notifyAll", "()V", (void *) (ptrint) &Java_java_lang_Object_notifyAll },
+ { "wait", "(J)V", (void *) (ptrint) &Java_java_lang_Object_wait },
+};
+
+
+/* _Jv_java_lang_Object_init ***************************************************
+
+ Register native functions.
+
+*******************************************************************************/
+
+void _Jv_java_lang_Object_init(void)
+{
+ utf *u;
+
+ u = utf_new_char("java/lang/Object");
+
+ native_method_register(u, methods, NATIVE_METHODS_COUNT);
+}
+
+
/*
- * Class: java/lang/VMObject
+ * Class: java/lang/Object
* Method: getClass
- * Signature: (Ljava/lang/Object;)Ljava/lang/Class;
+ * Signature: ()Ljava/lang/Class;
*/
JNIEXPORT java_lang_Class* JNICALL Java_java_lang_Object_getClass(JNIEnv *env, java_lang_Object *obj)
{
- java_objectheader *o;
- classinfo *c;
+ java_handle_t *o;
+ classinfo *c;
- o = (java_objectheader *) obj;
+ o = (java_handle_t *) obj;
if (o == NULL)
return NULL;
c = o->vftbl->class;
- return (java_lang_Class *) c;
+ return LLNI_classinfo_wrap(c);
}