diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-10-06 01:49:32 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-10-06 01:49:32 +0000 |
commit | 5d9a696ec262d3aeb20f6237637262be18994af9 (patch) | |
tree | 92945f2a30eaa7e0f3d79dd9f1dac801adf8bbf4 | |
parent | a9cff2c90fcb1cbdaa9bf68ba21abdf8798c6f76 (diff) | |
download | gcc-5d9a696ec262d3aeb20f6237637262be18994af9.tar.gz |
* java/lang/reflect/natField.cc (BooleanClass): Don't define.
* java/lang/reflect/natArray.cc (BooleanClass): Don't define.
* java/lang/Class.h (Object): Added `class$' field.
* java/lang/Object.h (Object): Added `class$' field.
* defineclass.cc (ClassClass): Use `class$' form.
(ClassObject): Likewise.
* resolve.cc (ClassObject): Use `class$' form.
(ObjectClass): Likewise.
* interpret.cc (ClassError): Removed.
* java/net/natPlainDatagramSocketImpl.cc (BooleanClass): Use
`class$' form.
(IntegerClass): Likewise.
* java/net/natPlainSocketImpl.cc (BooleanClass): Use `class$'
form.
* java/lang/natClassLoader.cc (CloneableClass): Use `class$' form.
(ObjectClass, ClassClass, VMClassLoaderClass, ClassLoaderClass,
SerializableClass): Likewise.
Include Serializable.h, Cloneable.h.
* java/lang/natSystem.cc (SystemClass): Removed.
(init_properties): Use `class$' form.
* java/lang/natObject.cc (CloneableClass): Removed.
(clone): Use `class$' form.
* java/lang/natClass.cc (CloneableClass): Use `class$' form.
(ObjectClass, ErrorClass, ClassClass, MethodClass, FieldClass,
ConstructorClass): Likewise.
* java/lang/reflect/natMethod.cc (ObjectClass): Use `class$' form.
(ClassClass, VoidClass, ByteClass, ShortClass, CharacterClass,
IntegerClass, LongClass, FloatClass, DoubleClass): Likewise.
* java/io/natObjectInputStream.cc (ObjectClass): Use `class$'
form.
(ClassClass): Likewise.
* include/jvm.h (StringClass): Use `class$' form.
* prims.cc (ObjectClass): Removed.
(_Jv_RunMain): Use `class$' form.
(_Jv_AllocObject): Likewise.
* jni.cc (ClassClass): Use `class$' form.
(ThrowableClass): Likewise.
(ObjectClass): Likewise.
(MethodClass): Likewise.
(ThreadGroupClass): Likewise.
(NativeThreadClass): Likewise.
* boehm.cc (ObjectClass): Removed.
(ClassClass): Removed.
(_Jv_MarkObj): Use `class$' form.
* gcj/field.h (JvFieldIsRef): Use `class$' form.
Include RawData.h.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@36740 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | libjava/ChangeLog | 49 | ||||
-rw-r--r-- | libjava/boehm.cc | 9 | ||||
-rw-r--r-- | libjava/defineclass.cc | 10 | ||||
-rw-r--r-- | libjava/gcj/field.h | 5 | ||||
-rw-r--r-- | libjava/include/jvm.h | 4 | ||||
-rw-r--r-- | libjava/interpret.cc | 3 | ||||
-rw-r--r-- | libjava/java/io/natObjectInputStream.cc | 8 | ||||
-rw-r--r-- | libjava/java/lang/Class.h | 2 | ||||
-rw-r--r-- | libjava/java/lang/Object.h | 2 | ||||
-rw-r--r-- | libjava/java/lang/natClass.cc | 22 | ||||
-rw-r--r-- | libjava/java/lang/natClassLoader.cc | 22 | ||||
-rw-r--r-- | libjava/java/lang/natObject.cc | 5 | ||||
-rw-r--r-- | libjava/java/lang/natSystem.cc | 5 | ||||
-rw-r--r-- | libjava/java/lang/reflect/natArray.cc | 5 | ||||
-rw-r--r-- | libjava/java/lang/reflect/natField.cc | 7 | ||||
-rw-r--r-- | libjava/java/lang/reflect/natMethod.cc | 32 | ||||
-rw-r--r-- | libjava/java/net/natPlainDatagramSocketImpl.cc | 7 | ||||
-rw-r--r-- | libjava/java/net/natPlainSocketImpl.cc | 3 | ||||
-rw-r--r-- | libjava/jni.cc | 20 | ||||
-rw-r--r-- | libjava/prims.cc | 8 | ||||
-rw-r--r-- | libjava/resolve.cc | 8 |
21 files changed, 116 insertions, 120 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index f85f2959bba..b93bb7ddaf6 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,52 @@ +2000-10-05 Tom Tromey <tromey@cygnus.com> + + * java/lang/reflect/natField.cc (BooleanClass): Don't define. + * java/lang/reflect/natArray.cc (BooleanClass): Don't define. + * java/lang/Class.h (Object): Added `class$' field. + * java/lang/Object.h (Object): Added `class$' field. + * defineclass.cc (ClassClass): Use `class$' form. + (ClassObject): Likewise. + * resolve.cc (ClassObject): Use `class$' form. + (ObjectClass): Likewise. + * interpret.cc (ClassError): Removed. + * java/net/natPlainDatagramSocketImpl.cc (BooleanClass): Use + `class$' form. + (IntegerClass): Likewise. + * java/net/natPlainSocketImpl.cc (BooleanClass): Use `class$' + form. + * java/lang/natClassLoader.cc (CloneableClass): Use `class$' form. + (ObjectClass, ClassClass, VMClassLoaderClass, ClassLoaderClass, + SerializableClass): Likewise. + Include Serializable.h, Cloneable.h. + * java/lang/natSystem.cc (SystemClass): Removed. + (init_properties): Use `class$' form. + * java/lang/natObject.cc (CloneableClass): Removed. + (clone): Use `class$' form. + * java/lang/natClass.cc (CloneableClass): Use `class$' form. + (ObjectClass, ErrorClass, ClassClass, MethodClass, FieldClass, + ConstructorClass): Likewise. + * java/lang/reflect/natMethod.cc (ObjectClass): Use `class$' form. + (ClassClass, VoidClass, ByteClass, ShortClass, CharacterClass, + IntegerClass, LongClass, FloatClass, DoubleClass): Likewise. + * java/io/natObjectInputStream.cc (ObjectClass): Use `class$' + form. + (ClassClass): Likewise. + * include/jvm.h (StringClass): Use `class$' form. + * prims.cc (ObjectClass): Removed. + (_Jv_RunMain): Use `class$' form. + (_Jv_AllocObject): Likewise. + * jni.cc (ClassClass): Use `class$' form. + (ThrowableClass): Likewise. + (ObjectClass): Likewise. + (MethodClass): Likewise. + (ThreadGroupClass): Likewise. + (NativeThreadClass): Likewise. + * boehm.cc (ObjectClass): Removed. + (ClassClass): Removed. + (_Jv_MarkObj): Use `class$' form. + * gcj/field.h (JvFieldIsRef): Use `class$' form. + Include RawData.h. + 2000-10-05 Warren Levy <warrenl@cygnus.com> * Makefile.am: Removed java/io/Replaceable.java and diff --git a/libjava/boehm.cc b/libjava/boehm.cc index f0d679c06ac..877d97c9d9c 100644 --- a/libjava/boehm.cc +++ b/libjava/boehm.cc @@ -49,11 +49,6 @@ extern "C" && (ptr_t) (Obj) <= GC_greatest_plausible_heap_addr) \ PUSH_CONTENTS (Obj, Top, Limit, Source, Exit) -#define ObjectClass _CL_Q34java4lang6Object -extern java::lang::Class ObjectClass; -#define ClassClass _CL_Q34java4lang5Class -extern java::lang::Class ClassClass; - // Nonzero if this module has been initialized. @@ -110,7 +105,7 @@ _Jv_MarkObj (void *addr, void *msp, void *msl, void * /* env */) p = (ptr_t) klass; MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, obj, o2label); - if (__builtin_expect (klass == &ClassClass, false)) + if (__builtin_expect (klass == &java::lang::Class::class$, false)) { // Currently we allocate some of the memory referenced from class objects // as pointerfree memory, and then mark it more intelligently here. @@ -263,7 +258,7 @@ _Jv_MarkObj (void *addr, void *msp, void *msl, void * /* env */) // Note: occasionally `klass' can be null. For instance, this // can happen if a GC occurs between the point where an object // is allocated and where the vtbl slot is set. - while (klass && klass != &ObjectClass) + while (klass && klass != &java::lang::Object::class$) { jfieldID field = JvGetFirstInstanceField (klass); jint max = JvNumInstanceFields (klass); diff --git a/libjava/defineclass.cc b/libjava/defineclass.cc index 7ddead0965b..06ca16274ea 100644 --- a/libjava/defineclass.cc +++ b/libjava/defineclass.cc @@ -43,11 +43,6 @@ details. */ #include <java/lang/IncompatibleClassChangeError.h> #include <java/lang/reflect/Modifier.h> -#define ClassClass _CL_Q34java4lang5Class -extern java::lang::Class ClassClass; -#define ClassObject _CL_Q34java4lang6Object -extern java::lang::Class ClassObject; - // we don't verify method names that match these. static _Jv_Utf8Const *clinit_name = _Jv_makeUtf8Const ("<clinit>", 8); static _Jv_Utf8Const *init_name = _Jv_makeUtf8Const ("<init>", 6); @@ -864,11 +859,12 @@ _Jv_ClassReader::handleClassBegin // interfaces have java.lang.Object as super. if (access_flags & Modifier::INTERFACE) { - def->superclass = (jclass)&ClassObject; + def->superclass = (jclass)&java::lang::Class::class$; } // FIXME: Consider this carefully! - else if (!_Jv_equalUtf8Consts (def->name, ClassObject.name)) + else if (!_Jv_equalUtf8Consts (def->name, + java::lang::Class::class$.name)) { throw_no_class_def_found_error ("loading java.lang.Object"); } diff --git a/libjava/gcj/field.h b/libjava/gcj/field.h index 0ad381c321f..9279c832964 100644 --- a/libjava/gcj/field.h +++ b/libjava/gcj/field.h @@ -14,6 +14,7 @@ details. */ #include <java/lang/Class.h> #include <java/lang/reflect/Field.h> #include <java/lang/reflect/Modifier.h> +#include <gnu/gcj/RawData.h> #define _Jv_FIELD_UNRESOLVED_FLAG 0x8000 #define _Jv_FIELD_CONSTANT_VALUE 0x4000 @@ -179,9 +180,7 @@ JvNumStaticFields (jclass klass) extern inline jboolean JvFieldIsRef (jfieldID field) { - // gnu.gcj.RawData.class is _CL_Q33gnu3gcj7RawData - extern java::lang::Class _CL_Q33gnu3gcj7RawData; - return field->isRef () && field->type != &_CL_Q33gnu3gcj7RawData; + return field->isRef () && field->type != &gnu::gcj::RawData::class$; } extern inline jobject diff --git a/libjava/include/jvm.h b/libjava/include/jvm.h index 8d93ed58f22..f453c9c351d 100644 --- a/libjava/include/jvm.h +++ b/libjava/include/jvm.h @@ -102,8 +102,8 @@ extern jboolean _Jv_equalUtf8Consts (_Jv_Utf8Const *, _Jv_Utf8Const *); extern jboolean _Jv_equal (_Jv_Utf8Const *, jstring, jint); extern jboolean _Jv_equaln (_Jv_Utf8Const *, jstring, jint); -#define StringClass _CL_Q34java4lang6String -extern java::lang::Class StringClass; +// FIXME: remove this define. +#define StringClass java::lang::String::class$ /* Type of pointer used as finalizer. */ typedef void _Jv_FinalizerFunc (jobject); diff --git a/libjava/interpret.cc b/libjava/interpret.cc index 74e87880a02..7f2ad62ae80 100644 --- a/libjava/interpret.cc +++ b/libjava/interpret.cc @@ -39,9 +39,6 @@ details. */ #include <alloca.h> #endif -#define ClassError _CL_Q34java4lang5Error -extern java::lang::Class ClassError; - static _Jv_Utf8Const *init_name = _Jv_makeUtf8Const ("<init>", 6); static void throw_internal_error (char *msg) diff --git a/libjava/java/io/natObjectInputStream.cc b/libjava/java/io/natObjectInputStream.cc index b7a8dcbc338..8b5151d04d9 100644 --- a/libjava/java/io/natObjectInputStream.cc +++ b/libjava/java/io/natObjectInputStream.cc @@ -1,6 +1,6 @@ // natObjectInputStream.cc - Native part of ObjectInputStream class. -/* Copyright (C) 1998, 1999 Free Software Foundation +/* Copyright (C) 1998, 1999, 2000 Free Software Foundation This ObjectInputStream is part of libgcj. @@ -46,10 +46,8 @@ java::io::ObjectInputStream::allocateObject (jclass klass) } -#define ObjectClass _CL_Q34java4lang6Object -extern java::lang::Class ObjectClass; -#define ClassClass _CL_Q34java4lang5Class -extern java::lang::Class ClassClass; +#define ObjectClass java::lang::Object::class$ +#define ClassClass java::lang::Class::class$ void java::io::ObjectInputStream::callConstructor (jclass klass, jobject obj) diff --git a/libjava/java/lang/Class.h b/libjava/java/lang/Class.h index 0300a59b871..0f26c54a8a9 100644 --- a/libjava/java/lang/Class.h +++ b/libjava/java/lang/Class.h @@ -190,6 +190,8 @@ public: // finalization void finalize (); + static java::lang::Class class$; + private: void checkMemberAccess (jint flags); diff --git a/libjava/java/lang/Object.h b/libjava/java/lang/Object.h index 2ed6d155a2e..21e8fb0918f 100644 --- a/libjava/java/lang/Object.h +++ b/libjava/java/lang/Object.h @@ -57,6 +57,8 @@ public: friend JV_MARKARRAY_DECL; #endif + static java::lang::Class class$; + protected: virtual jobject clone (void); virtual void finalize (void); diff --git a/libjava/java/lang/natClass.cc b/libjava/java/lang/natClass.cc index 1b403733821..e3d4785dc33 100644 --- a/libjava/java/lang/natClass.cc +++ b/libjava/java/lang/natClass.cc @@ -51,20 +51,14 @@ details. */ -#define CloneableClass _CL_Q34java4lang9Cloneable -extern java::lang::Class CloneableClass; -#define ObjectClass _CL_Q34java4lang6Object -extern java::lang::Class ObjectClass; -#define ErrorClass _CL_Q34java4lang5Error -extern java::lang::Class ErrorClass; -#define ClassClass _CL_Q34java4lang5Class -extern java::lang::Class ClassClass; -#define MethodClass _CL_Q44java4lang7reflect6Method -extern java::lang::Class MethodClass; -#define FieldClass _CL_Q44java4lang7reflect5Field -extern java::lang::Class FieldClass; -#define ConstructorClass _CL_Q44java4lang7reflect11Constructor -extern java::lang::Class ConstructorClass; +// FIXME: remove these. +#define CloneableClass java::lang::Cloneable::class$ +#define ObjectClass java::lang::Object::class$ +#define ErrorClass java::lang::Error::class$ +#define ClassClass java::lang::Class::class$ +#define MethodClass java::lang::reflect::Method::class$ +#define FieldClass java::lang::reflect::Field::class$ +#define ConstructorClass java::lang::reflect::Constructor::class$ // Some constants we use to look up the class initializer. static _Jv_Utf8Const *void_signature = _Jv_makeUtf8Const ("()V", 3); diff --git a/libjava/java/lang/natClassLoader.cc b/libjava/java/lang/natClassLoader.cc index b03b8c22a0f..f1704edd9aa 100644 --- a/libjava/java/lang/natClassLoader.cc +++ b/libjava/java/lang/natClassLoader.cc @@ -35,19 +35,17 @@ details. */ #include <java/lang/IncompatibleClassChangeError.h> #include <java/lang/reflect/Modifier.h> #include <java/lang/Runtime.h> +#include <java/io/Serializable.h> +#include <java/lang/Cloneable.h> + +// FIXME: remove these. +#define CloneableClass java::lang::Cloneable::class$ +#define ObjectClass java::lang::Object::class$ +#define ClassClass java::lang::Class::class$ +#define VMClassLoaderClass gnu::gcj::runtime::VMClassLoader::class$ +#define ClassLoaderClass java::lang::ClassLoader::class$ +#define SerializableClass java::io::Serializable::class$ -#define CloneableClass _CL_Q34java4lang9Cloneable -extern java::lang::Class CloneableClass; -#define ObjectClass _CL_Q34java4lang6Object -extern java::lang::Class ObjectClass; -#define ClassClass _CL_Q34java4lang5Class -extern java::lang::Class ClassClass; -#define VMClassLoaderClass _CL_Q34java4lang17VMClassLoader -extern java::lang::Class VMClassLoader; -#define ClassLoaderClass _CL_Q34java4lang11ClassLoader -extern java::lang::Class ClassLoaderClass; -#define SerializableClass _CL_Q34java2io12Serializable -extern java::lang::Class SerializableClass; /////////// java.lang.ClassLoader native methods //////////// java::lang::ClassLoader * diff --git a/libjava/java/lang/natObject.cc b/libjava/java/lang/natObject.cc index 26b3f96844d..43201f64d86 100644 --- a/libjava/java/lang/natObject.cc +++ b/libjava/java/lang/natObject.cc @@ -28,9 +28,6 @@ details. */ #include <java/lang/Cloneable.h> #include <java/lang/Thread.h> -#define CloneableClass _CL_Q34java4lang9Cloneable -extern java::lang::Class CloneableClass; - // This is used to represent synchronization information. @@ -92,7 +89,7 @@ java::lang::Object::clone (void) } else { - if (! CloneableClass.isAssignableFrom(klass)) + if (! java::lang::Cloneable::class$.isAssignableFrom(klass)) JvThrow (new CloneNotSupportedException); size = klass->size(); diff --git a/libjava/java/lang/natSystem.cc b/libjava/java/lang/natSystem.cc index 0022e2ed61f..35198fb9680 100644 --- a/libjava/java/lang/natSystem.cc +++ b/libjava/java/lang/natSystem.cc @@ -41,9 +41,6 @@ details. */ #include <java/io/PrintStream.h> #include <java/io/InputStream.h> -#define SystemClass _CL_Q34java4lang6System -extern java::lang::Class SystemClass; - void @@ -222,7 +219,7 @@ java::lang::System::init_properties (void) { { // We only need to synchronize around this gatekeeper. - JvSynchronize sync (&SystemClass); + JvSynchronize sync (&java::lang::System::class$); if (prop_init) return; prop_init = true; diff --git a/libjava/java/lang/reflect/natArray.cc b/libjava/java/lang/reflect/natArray.cc index 4bce9ce8c0a..b5a2124fb6d 100644 --- a/libjava/java/lang/reflect/natArray.cc +++ b/libjava/java/lang/reflect/natArray.cc @@ -25,9 +25,6 @@ details. */ #include <java/lang/Boolean.h> #include <java/lang/Character.h> -#define BooleanClass _CL_Q34java4lang7Boolean -extern java::lang::Class BooleanClass; - jobject java::lang::reflect::Array::newInstance (jclass componentType, jint length) { @@ -215,7 +212,7 @@ java::lang::reflect::Array::get (jobject array, jint index) return new java::lang::Character (elements ((jcharArray) array) [index]); if (elementType == JvPrimClass (boolean)) { - _Jv_InitClass (&BooleanClass); + _Jv_InitClass (&java::lang::Boolean::class$); if (elements ((jbooleanArray) array) [index]) return java::lang::Boolean::TRUE; else diff --git a/libjava/java/lang/reflect/natField.cc b/libjava/java/lang/reflect/natField.cc index 3cd296c7021..57421d690b4 100644 --- a/libjava/java/lang/reflect/natField.cc +++ b/libjava/java/lang/reflect/natField.cc @@ -1,6 +1,6 @@ // natField.cc - Implementation of java.lang.reflect.Field native methods. -/* Copyright (C) 1998, 1999 Free Software Foundation +/* Copyright (C) 1998, 1999, 2000 Free Software Foundation This file is part of libgcj. @@ -26,9 +26,6 @@ details. */ #include <java/lang/Boolean.h> #include <java/lang/Character.h> -#define BooleanClass _CL_Q34java4lang7Boolean -extern java::lang::Class BooleanClass; - jint java::lang::reflect::Field::getModifiers () { @@ -255,7 +252,7 @@ java::lang::reflect::Field::get (jclass caller, jobject obj) return new java::lang::Character (* (jchar*) addr); if (fld->type == JvPrimClass (boolean)) { - _Jv_InitClass (&BooleanClass); + _Jv_InitClass (&java::lang::Boolean::class$); if (* (jboolean*) addr) return java::lang::Boolean::TRUE; else diff --git a/libjava/java/lang/reflect/natMethod.cc b/libjava/java/lang/reflect/natMethod.cc index 0f829debd30..0e83e0d2511 100644 --- a/libjava/java/lang/reflect/natMethod.cc +++ b/libjava/java/lang/reflect/natMethod.cc @@ -38,31 +38,23 @@ details. */ #include <gcj/method.h> #include <gnu/gcj/RawData.h> -#define ObjectClass _CL_Q34java4lang6Object -extern java::lang::Class ObjectClass; -#define ClassClass _CL_Q34java4lang5Class -extern java::lang::Class ClassClass; +// FIXME: remove these +#define ObjectClass java::lang::Object::class$ +#define ClassClass java::lang::Class::class$ #include <stdlib.h> #include <ffi.h> -#define VoidClass _CL_Q34java4lang4Void -extern java::lang::Class VoidClass; -#define ByteClass _CL_Q34java4lang4Byte -extern java::lang::Class ByteClass; -#define ShortClass _CL_Q34java4lang5Short -extern java::lang::Class ShortClass; -#define CharacterClass _CL_Q34java4lang9Character -extern java::lang::Class CharacterClass; -#define IntegerClass _CL_Q34java4lang7Integer -extern java::lang::Class IntegerClass; -#define LongClass _CL_Q34java4lang4Long -extern java::lang::Class LongClass; -#define FloatClass _CL_Q34java4lang5Float -extern java::lang::Class FloatClass; -#define DoubleClass _CL_Q34java4lang6Double -extern java::lang::Class DoubleClass; +// FIXME: remove these. +#define VoidClass java::lang::Void::class$ +#define ByteClass java::lang::Byte::class$ +#define ShortClass java::lang::Short::class$ +#define CharacterClass java::lang::Character::class$ +#define IntegerClass java::lang::Integer::class$ +#define LongClass java::lang::Long::class$ +#define FloatClass java::lang::Float::class$ +#define DoubleClass java::lang::Double::class$ struct cpair { diff --git a/libjava/java/net/natPlainDatagramSocketImpl.cc b/libjava/java/net/natPlainDatagramSocketImpl.cc index 808fd011ca5..6934f090b82 100644 --- a/libjava/java/net/natPlainDatagramSocketImpl.cc +++ b/libjava/java/net/natPlainDatagramSocketImpl.cc @@ -50,10 +50,9 @@ details. */ #include <java/lang/Boolean.h> #include <java/lang/Integer.h> -#define BooleanClass _CL_Q34java4lang7Boolean -extern java::lang::Class BooleanClass; -#define IntegerClass _CL_Q34java4lang7Integer -extern java::lang::Class IntegerClass; +// FIXME: remove these +#define BooleanClass java::lang::Boolean::class$ +#define IntegerClass java::lang::Integer::class$ #ifdef DISABLE_JAVA_NET diff --git a/libjava/java/net/natPlainSocketImpl.cc b/libjava/java/net/natPlainSocketImpl.cc index ff7d8a3452f..3c6bc393429 100644 --- a/libjava/java/net/natPlainSocketImpl.cc +++ b/libjava/java/net/natPlainSocketImpl.cc @@ -49,8 +49,7 @@ details. */ #include <java/lang/Class.h> #include <java/lang/Integer.h> -#define BooleanClass _CL_Q34java4lang7Boolean -extern java::lang::Class BooleanClass; +#define BooleanClass java::lang::Boolean::class$ #ifdef DISABLE_JAVA_NET diff --git a/libjava/jni.cc b/libjava/jni.cc index db13cdfb1a3..d4040b2b6ee 100644 --- a/libjava/jni.cc +++ b/libjava/jni.cc @@ -46,19 +46,13 @@ details. */ #include <java-interp.h> -#define ClassClass _CL_Q34java4lang5Class -extern java::lang::Class ClassClass; -#define ObjectClass _CL_Q34java4lang6Object -extern java::lang::Class ObjectClass; - -#define ThrowableClass _CL_Q34java4lang9Throwable -extern java::lang::Class ThrowableClass; -#define MethodClass _CL_Q44java4lang7reflect6Method -extern java::lang::Class MethodClass; -#define ThreadGroupClass _CL_Q34java4lang11ThreadGroup -extern java::lang::Class ThreadGroupClass; -#define NativeThreadClass _CL_Q43gnu3gcj3jni12NativeThread -extern java::lang::Class ThreadGroupClass; +// FIXME: remove these defines. +#define ClassClass java::lang::Class::class$ +#define ObjectClass java::lang::Object::class$ +#define ThrowableClass java::lang::Throwable::class$ +#define MethodClass java::lang::reflect::Method::class$ +#define ThreadGroupClass java::lang::ThreadGroup::class$ +#define NativeThreadClass gnu::gcj::jni::NativeThread::class$ // This enum is used to select different template instantiations in // the invocation code. diff --git a/libjava/prims.cc b/libjava/prims.cc index ef881906800..8ca05da3905 100644 --- a/libjava/prims.cc +++ b/libjava/prims.cc @@ -67,9 +67,6 @@ details. */ #include <ltdl.h> #endif -#define ObjectClass _CL_Q34java4lang6Object -extern java::lang::Class ObjectClass; - // We allocate a single OutOfMemoryError exception which we keep // around for use if we run out of memory. static java::lang::OutOfMemoryError *no_memory; @@ -358,7 +355,8 @@ _Jv_AllocObject (jclass klass, jint size) // implementation would look for Object.finalize in Object's method // table at startup, and then use that information to find the // appropriate index in the method vector. - if (klass->vtable->get_finalizer() != ObjectClass.vtable->get_finalizer()) + if (klass->vtable->get_finalizer() + != java::lang::Object::class$.vtable->get_finalizer()) _Jv_RegisterFinalizer (obj, _Jv_FinalizeObject); #ifdef ENABLE_JVMPI @@ -915,7 +913,7 @@ _Jv_RunMain (const char *name, int argc, const char **argv, bool is_jar) arg_vec = JvConvertArgv (1, &_Jv_Jar_Class_Path); main_thread = - new gnu::gcj::runtime::FirstThread (&_CL_Q43gnu3gcj7runtime11FirstThread, + new gnu::gcj::runtime::FirstThread (&gnu::gcj::runtime::FirstThread::class$, arg_vec); main_thread->start(); _Jv_ThreadWait (); diff --git a/libjava/resolve.cc b/libjava/resolve.cc index 898de51ff5c..4a37365c94a 100644 --- a/libjava/resolve.cc +++ b/libjava/resolve.cc @@ -41,11 +41,6 @@ static void throw_class_format_error (jstring msg) static void throw_class_format_error (char *msg) __attribute__ ((__noreturn__)); -#define ClassObject _CL_Q34java4lang6Object -extern java::lang::Class ClassObject; -#define ObjectClass _CL_Q34java4lang6Object -extern java::lang::Class ObjectClass; - // Exceptional return values for _Jv_DetermineVTableIndex #define METHOD_NOT_THERE (-2) #define METHOD_INACCESSIBLE (-1) @@ -809,7 +804,8 @@ _Jv_InitField (jobject obj, jclass klass, int index) /* fall through */ case JV_CONSTANT_ResolvedString: - if (! (field->type == &StringClass || field->type == &ObjectClass)) + if (! (field->type == &StringClass + || field->type == &java::lang::Class::class$)) throw_class_format_error ("string initialiser to non-string field"); *(jstring*)addr = pool->data[init].string; |