* java/lang/Class.h (_Jv_Self): New union type.
(Class): Manipulate vtable pointer via _Jv_Self union. Thanks to
Jeff Sturm and Fergus Henderson.
* java/lang/ClassLoader.java: Remove dead code fragment.
From-SVN: r41876
+2001-05-06 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
+
+ * java/lang/Class.h (_Jv_Self): New union type.
+ (Class): Manipulate vtable pointer via _Jv_Self union. Thanks to
+ Jeff Sturm and Fergus Henderson.
+
+2001-05-06 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
+
+ * java/lang/ClassLoader.java: Remove dead code fragment.
+
2001-05-03 Martin Kahlert <martin.kahlert@infineon.com>
* jni.cc (_Jv_JNI_GetPrimitiveArrayRegion): Fixed bounds
jshort count;
};
+// Used for vtable pointer manipulation.
+union _Jv_Self
+{
+ char *vtable_ptr;
+ jclass self;
+};
+
#define JV_PRIMITIVE_VTABLE ((_Jv_VTable *) -1)
#define JV_CLASS(Obj) ((jclass) (*(_Jv_VTable **) Obj)->clas)
// C++ ctors set the vtbl pointer to point at an offset inside the vtable
// object. That doesn't work for Java, so this hack adjusts it back.
- void *p = ((void **)this)[0];
- ((void **)this)[0] = (void *)((char *)p-2*sizeof (void *));
-
+ ((_Jv_Self *)this)->vtable_ptr -= 2 * sizeof (void *);
+
// We must initialize every field of the class. We do this in the
// same order they are declared in Class.h, except for fields that
// are initialized to NULL.
return loadClass (name, false);
}
- /* findClass implementation for the system classloader.
- native Class systemFindClass(String name)
- throws java.lang.ClassNotFoundException;
-
/**
* Loads the class by the given name. The default implementation
* will search for the class in the following order (similar to jdk 1.2)