diff options
author | bryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-01-17 10:22:33 +0000 |
---|---|---|
committer | bryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-01-17 10:22:33 +0000 |
commit | 2da009a9c5fa4c8c7c54f32a02ad1adc5846c11f (patch) | |
tree | 611e7282c479126e4aaf4a31ed1c07a8bd3e6df8 /libjava/java | |
parent | 9bf46465f5f74b01122d1855a81d459606e17fe2 (diff) | |
download | ppe42-gcc-2da009a9c5fa4c8c7c54f32a02ad1adc5846c11f.tar.gz ppe42-gcc-2da009a9c5fa4c8c7c54f32a02ad1adc5846c11f.zip |
* java/lang/Class.h (isInterface): Move implementation from
natClass.cc. Declare inline.
(Class): Add default constructor.
* java/lang/Object.h: Update comments.
* java/lang/natClass.cc (initializeClass): Use _Jv_InitClass to
initialize superclass, saving a call if super is already initialized.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@39091 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java')
-rw-r--r-- | libjava/java/lang/Class.h | 16 | ||||
-rw-r--r-- | libjava/java/lang/Object.h | 8 | ||||
-rw-r--r-- | libjava/java/lang/natClass.cc | 2 |
3 files changed, 13 insertions, 13 deletions
diff --git a/libjava/java/lang/Class.h b/libjava/java/lang/Class.h index febe74816f9..9736b78829b 100644 --- a/libjava/java/lang/Class.h +++ b/libjava/java/lang/Class.h @@ -174,7 +174,8 @@ public: jboolean isAssignableFrom (jclass cls); jboolean isInstance (jobject obj); - jboolean isInterface (void) + + inline jboolean isInterface (void) { return (accflags & java::lang::reflect::Modifier::INTERFACE) != 0; } @@ -196,16 +197,17 @@ public: // finalization void finalize (); + Class () {}; + // This constructor is used to create Class object for the primitive - // types. - Class (jobject cname, jbyte sig, jint len, jobject array_vtable) { - + // types. See prims.cc. + Class (jobject cname, jbyte sig, jint len, jobject array_vtable) + { using namespace java::lang::reflect; _Jv_Utf8Const *_Jv_makeUtf8Const (char *s, int len); - // C++ ctors are fixing the vtbl in a way that doesn't fit Java. - // We can fix the C++ compiler, or we can hack our runtime. What's - // below fix the vtable so that it starts at -2. + // 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 *)); diff --git a/libjava/java/lang/Object.h b/libjava/java/lang/Object.h index 81b5a66dfb6..352d48b501d 100644 --- a/libjava/java/lang/Object.h +++ b/libjava/java/lang/Object.h @@ -16,15 +16,13 @@ details. */ #include <gcj/javaprims.h> // This class is mainly here as a kludge to get G++ to allocate two -// extra entries in the vtable. We will use them to store data. This -// allows us to support the new C++ ABI. - +// extra entries in each vtable. struct _JvObjectPrefix { protected: // New ABI Compatibility Dummy, #1 and 2. - virtual void nacd_1 (void) {}; - virtual void nacd_2 (void) {}; + virtual void nacd_1 (void) {}; // This slot really contains the Class pointer. + virtual void nacd_2 (void) {}; // Actually the GC bitmap marking descriptor. }; class java::lang::Object : public _JvObjectPrefix diff --git a/libjava/java/lang/natClass.cc b/libjava/java/lang/natClass.cc index 2d8a1254542..9a97411d0a8 100644 --- a/libjava/java/lang/natClass.cc +++ b/libjava/java/lang/natClass.cc @@ -732,7 +732,7 @@ java::lang::Class::initializeClass (void) { try { - superclass->initializeClass (); + _Jv_InitClass (superclass); } catch (java::lang::Throwable *except) { |