aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/lang/Class.h
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2001-12-16 22:28:35 +0000
committerTom Tromey <tromey@gcc.gnu.org>2001-12-16 22:28:35 +0000
commit68940f3f3c1c6011be4434d30e1e1f8548be7b7d (patch)
tree40b6d3dc40874ea7045518f5a5d294ffddf0cf1f /libjava/java/lang/Class.h
parent495513eea640d4135f4b62f341bc844a09779df7 (diff)
downloadgcc-68940f3f3c1c6011be4434d30e1e1f8548be7b7d.zip
gcc-68940f3f3c1c6011be4434d30e1e1f8548be7b7d.tar.gz
gcc-68940f3f3c1c6011be4434d30e1e1f8548be7b7d.tar.bz2
For PR java/5088:
* java/lang/natClassLoader.cc (_Jv_InitNewClassFields): New function. (_Jv_NewClass): Use it. (defineClass0): Use it. * prims.cc (_Jv_InitPrimClass): Adjust vtable here. (_Jv_InitPrimClass): Use _Jv_InitNewClassFields. (_Jv_NewArray): Don't abort; just throw exception. Include InternalError.h. * java/lang/Class.h (Class::Class): Declare, don't define. (Class): Declare _Jv_InitNewClassFields as a friend. (union _Jv_Self): Removed. From-SVN: r48081
Diffstat (limited to 'libjava/java/lang/Class.h')
-rw-r--r--libjava/java/lang/Class.h15
1 files changed, 2 insertions, 13 deletions
diff --git a/libjava/java/lang/Class.h b/libjava/java/lang/Class.h
index 2052391..73d81da 100644
--- a/libjava/java/lang/Class.h
+++ b/libjava/java/lang/Class.h
@@ -109,13 +109,6 @@ struct _Jv_ifaces
jshort count;
};
-// Used for vtable pointer manipulation.
-union _Jv_Self
-{
- char *vtable_ptr;
- jclass self;
-};
-
struct _Jv_MethodSymbol
{
_Jv_Utf8Const *class_name;
@@ -232,12 +225,7 @@ public:
// This constructor is used to create Class object for the primitive
// types. See prims.cc.
- Class ()
- {
- // 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.
- ((_Jv_Self *)this)->vtable_ptr -= 2 * sizeof (void *);
- }
+ Class ();
static java::lang::Class class$;
@@ -307,6 +295,7 @@ private:
_Jv_VTable *array_vtable = 0);
friend jclass _Jv_NewClass (_Jv_Utf8Const *name, jclass superclass,
java::lang::ClassLoader *loader);
+ friend void _Jv_InitNewClassFields (jclass klass);
// in prims.cc
friend void _Jv_InitPrimClass (jclass, char *, char, int, _Jv_ArrayVTable *);