diff options
author | Tom Tromey <tromey@redhat.com> | 2002-06-25 05:29:22 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2002-06-25 05:29:22 +0000 |
commit | d74bba04e8561896d2ba0ec5170216a38e1fd352 (patch) | |
tree | 5511f3352a20d4f21a558daeea7feda7f1cb7cbc /libjava | |
parent | b41e09a79f0a1f2de0dbd31963f1edd54287f99c (diff) | |
download | gcc-d74bba04e8561896d2ba0ec5170216a38e1fd352.zip gcc-d74bba04e8561896d2ba0ec5170216a38e1fd352.tar.gz gcc-d74bba04e8561896d2ba0ec5170216a38e1fd352.tar.bz2 |
natPlainDatagramSocketImpl.cc (BooleanClass): Removed.
* java/net/natPlainDatagramSocketImpl.cc (BooleanClass): Removed.
(IntegerClass): Likewise.
* java/lang/natClass.cc (CloneableClass): Removed.
(ObjectClass, ErrorClass, ClassClass, MethodClass, FieldClass,
ConstructorClass): Likewise.
* java/lang/natClassLoader.cc (CloneableClass): Removed.
(ObjectClass, ClassClass, VMClassLoaderClass, ClassLoaderClass,
SerializableClass): Likewise.
* java/lang/reflect/natMethod.cc (BooleanClass): Removed.
(VoidClass, ByteClass, ShortClass, CharacterClass, IntegerClass,
LongClass, FloatClass, DoubleClass): Likewise.
From-SVN: r54977
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/ChangeLog | 12 | ||||
-rw-r--r-- | libjava/java/lang/natClass.cc | 48 | ||||
-rw-r--r-- | libjava/java/lang/natClassLoader.cc | 47 | ||||
-rw-r--r-- | libjava/java/lang/reflect/natMethod.cc | 27 | ||||
-rw-r--r-- | libjava/java/net/natPlainDatagramSocketImpl.cc | 8 |
5 files changed, 67 insertions, 75 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index a7c6eb2..84ae3a2 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,5 +1,17 @@ 2002-06-24 Tom Tromey <tromey@redhat.com> + * java/net/natPlainDatagramSocketImpl.cc (BooleanClass): Removed. + (IntegerClass): Likewise. + * java/lang/natClass.cc (CloneableClass): Removed. + (ObjectClass, ErrorClass, ClassClass, MethodClass, FieldClass, + ConstructorClass): Likewise. + * java/lang/natClassLoader.cc (CloneableClass): Removed. + (ObjectClass, ClassClass, VMClassLoaderClass, ClassLoaderClass, + SerializableClass): Likewise. + * java/lang/reflect/natMethod.cc (BooleanClass): Removed. + (VoidClass, ByteClass, ShortClass, CharacterClass, IntegerClass, + LongClass, FloatClass, DoubleClass): Likewise. + * verify.cc (branch_prepass): Updated for change to exception handler type. (verify_instructions_0): Likewise. diff --git a/libjava/java/lang/natClass.cc b/libjava/java/lang/natClass.cc index 0e34f32..5399090 100644 --- a/libjava/java/lang/natClass.cc +++ b/libjava/java/lang/natClass.cc @@ -1,6 +1,6 @@ // natClass.cc - Implementation of java.lang.Class native methods. -/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation +/* Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation This file is part of libgcj. @@ -53,17 +53,6 @@ details. */ -// 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$ - - - using namespace gcj; jclass @@ -174,7 +163,9 @@ java::lang::Class::_getConstructors (jboolean declared) } JArray<java::lang::reflect::Constructor *> *result = (JArray<java::lang::reflect::Constructor *> *) - JvNewObjectArray (numConstructors, &ConstructorClass, NULL); + JvNewObjectArray (numConstructors, + &java::lang::reflect::Constructor::class$, + NULL); java::lang::reflect::Constructor** cptr = elements (result); for (i = 0; i < max; i++) { @@ -273,7 +264,7 @@ java::lang::Class::getDeclaredFields (void) s->checkMemberAccess (this, java::lang::reflect::Member::DECLARED); JArray<java::lang::reflect::Field *> *result = (JArray<java::lang::reflect::Field *> *) - JvNewObjectArray (field_count, &FieldClass, NULL); + JvNewObjectArray (field_count, &java::lang::reflect::Field::class$, NULL); java::lang::reflect::Field** fptr = elements (result); for (int i = 0; i < field_count; i++) { @@ -366,7 +357,7 @@ java::lang::Class::getDeclaredMethods (void) } JArray<java::lang::reflect::Method *> *result = (JArray<java::lang::reflect::Method *> *) - JvNewObjectArray (numMethods, &MethodClass, NULL); + JvNewObjectArray (numMethods, &java::lang::reflect::Method::class$, NULL); java::lang::reflect::Method** mptr = elements (result); for (i = 0; i < max; i++) { @@ -402,7 +393,8 @@ java::lang::Class::getClasses (void) // Until we have inner classes, it always makes sense to return an // empty array. JArray<jclass> *result - = (JArray<jclass> *) JvNewObjectArray (0, &ClassClass, NULL); + = (JArray<jclass> *) JvNewObjectArray (0, &java::lang::Class::class$, + NULL); return result; } @@ -413,7 +405,8 @@ java::lang::Class::getDeclaredClasses (void) // Until we have inner classes, it always makes sense to return an // empty array. JArray<jclass> *result - = (JArray<jclass> *) JvNewObjectArray (0, &ClassClass, NULL); + = (JArray<jclass> *) JvNewObjectArray (0, &java::lang::Class::class$, + NULL); return result; } @@ -474,7 +467,7 @@ java::lang::Class::getFields (void) JArray<java::lang::reflect::Field *> *result = ((JArray<java::lang::reflect::Field *> *) - JvNewObjectArray (count, &FieldClass, NULL)); + JvNewObjectArray (count, &java::lang::reflect::Field::class$, NULL)); _getFields (result, 0); @@ -614,7 +607,9 @@ java::lang::Class::getMethods (void) jint count = _getMethods (NULL, 0); JArray<Method *> *result - = ((JArray<Method *> *) JvNewObjectArray (count, &MethodClass, NULL)); + = ((JArray<Method *> *) JvNewObjectArray (count, + &Method::class$, + NULL)); // When filling the array for real, we get the actual count. Then // we resize the array. @@ -623,7 +618,8 @@ java::lang::Class::getMethods (void) if (real_count != count) { JArray<Method *> *r2 - = ((JArray<Method *> *) JvNewObjectArray (real_count, &MethodClass, + = ((JArray<Method *> *) JvNewObjectArray (real_count, + &Method::class$, NULL)); Method **destp = elements (r2); @@ -663,7 +659,7 @@ java::lang::Class::newInstance (void) // seem to be any way to do these. // FIXME: we special-case one check here just to pass a Plum Hall // test. Once access checking is implemented, remove this. - if (this == &ClassClass) + if (this == &java::lang::Class::class$) throw new java::lang::IllegalAccessException; if (isPrimitive () @@ -780,7 +776,7 @@ java::lang::Class::initializeClass (void) } catch (java::lang::Throwable *except) { - if (! ErrorClass.isInstance(except)) + if (! java::lang::Error::class$.isInstance(except)) { try { @@ -872,14 +868,14 @@ static void _Jv_AddMethodToCache (jclass klass, _Jv_Method *method) { - _Jv_MonitorEnter (&ClassClass); + _Jv_MonitorEnter (&java::lang::Class::class$); int index = method->name->hash & MCACHE_SIZE; method_cache[index].method = method; method_cache[index].klass = klass; - _Jv_MonitorExit (&ClassClass); + _Jv_MonitorExit (&java::lang::Class::class$); } void * @@ -967,7 +963,7 @@ _Jv_IsAssignableFrom (jclass target, jclass source) if (__builtin_expect (target->isPrimitive(), false)) return false; - if (target == &ObjectClass) + if (target == &java::lang::Object::class$) { if (source->isPrimitive()) return false; @@ -1067,7 +1063,7 @@ _Jv_PrepareConstantTimeTables (jclass klass) jclass klass0 = klass; jboolean has_interfaces = 0; - while (klass0 != &ObjectClass) + while (klass0 != &java::lang::Object::class$) { has_interfaces += klass0->interface_count; klass0 = klass0->superclass; diff --git a/libjava/java/lang/natClassLoader.cc b/libjava/java/lang/natClassLoader.cc index b98e965..9c83d59 100644 --- a/libjava/java/lang/natClassLoader.cc +++ b/libjava/java/lang/natClassLoader.cc @@ -41,14 +41,6 @@ details. */ #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$ - /////////// java.lang.ClassLoader native methods //////////// java::lang::Class * @@ -60,7 +52,8 @@ java::lang::ClassLoader::defineClass0 (jstring name, { #ifdef INTERPRETER jclass klass; - klass = (jclass) JvAllocObject (&ClassClass, sizeof (_Jv_InterpClass)); + klass = (jclass) JvAllocObject (&java::lang::Class::class$, + sizeof (_Jv_InterpClass)); _Jv_InitNewClassFields (klass); // synchronize on the class, so that it is not @@ -295,7 +288,7 @@ _Jv_PrepareCompiledClass (jclass klass) int mod = f->getModifiers (); // If we have a static String field with a non-null initial // value, we know it points to a Utf8Const. - if (f->getClass () == &StringClass + if (f->getClass () == &java::lang::String::class$ && java::lang::reflect::Modifier::isStatic (mod)) { jstring *strp = (jstring *) f->u.addr; @@ -353,7 +346,7 @@ static jclass loaded_classes[HASH_LEN]; jclass _Jv_FindClassInCache (_Jv_Utf8Const *name, java::lang::ClassLoader *loader) { - _Jv_MonitorEnter (&ClassClass); + _Jv_MonitorEnter (&java::lang::Class::class$); jint hash = HASH_UTF (name); // first, if LOADER is a defining loader, then it is also initiating @@ -381,7 +374,7 @@ _Jv_FindClassInCache (_Jv_Utf8Const *name, java::lang::ClassLoader *loader) } } - _Jv_MonitorExit (&ClassClass); + _Jv_MonitorExit (&java::lang::Class::class$); return klass; } @@ -389,7 +382,7 @@ _Jv_FindClassInCache (_Jv_Utf8Const *name, java::lang::ClassLoader *loader) void _Jv_UnregisterClass (jclass the_class) { - _Jv_MonitorEnter (&ClassClass); + _Jv_MonitorEnter (&java::lang::Class::class$); jint hash = HASH_UTF(the_class->name); jclass *klass = &(loaded_classes[hash]); @@ -414,7 +407,7 @@ _Jv_UnregisterClass (jclass the_class) break; } - _Jv_MonitorExit (&ClassClass); + _Jv_MonitorExit (&java::lang::Class::class$); } void @@ -424,12 +417,12 @@ _Jv_RegisterInitiatingLoader (jclass klass, java::lang::ClassLoader *loader) _Jv_LoaderInfo *info = (_Jv_LoaderInfo *) _Jv_Malloc (sizeof(_Jv_LoaderInfo)); jint hash = HASH_UTF(klass->name); - _Jv_MonitorEnter (&ClassClass); + _Jv_MonitorEnter (&java::lang::Class::class$); info->loader = loader; info->klass = klass; info->next = initiated_classes[hash]; initiated_classes[hash] = info; - _Jv_MonitorExit (&ClassClass); + _Jv_MonitorExit (&java::lang::Class::class$); } // This function is called many times during startup, before main() is @@ -582,7 +575,7 @@ jclass _Jv_NewClass (_Jv_Utf8Const *name, jclass superclass, java::lang::ClassLoader *loader) { - jclass ret = (jclass) JvAllocObject (&ClassClass); + jclass ret = (jclass) JvAllocObject (&java::lang::Class::class$); _Jv_InitNewClassFields (ret); ret->name = name; ret->superclass = superclass; @@ -646,13 +639,14 @@ _Jv_NewArrayClass (jclass element, java::lang::ClassLoader *loader, } // Create new array class. - jclass array_class = _Jv_NewClass (array_name, &ObjectClass, + jclass array_class = _Jv_NewClass (array_name, &java::lang::Object::class$, element->loader); // Note that `vtable_method_count' doesn't include the initial // gc_descr slot. - JvAssert (ObjectClass.vtable_method_count == NUM_OBJECT_METHODS); - int dm_count = ObjectClass.vtable_method_count; + JvAssert (java::lang::Object::class$.vtable_method_count + == NUM_OBJECT_METHODS); + int dm_count = java::lang::Object::class$.vtable_method_count; // Create a new vtable by copying Object's vtable. _Jv_VTable *vtable; @@ -661,18 +655,23 @@ _Jv_NewArrayClass (jclass element, java::lang::ClassLoader *loader, else vtable = _Jv_VTable::new_vtable (dm_count); vtable->clas = array_class; - vtable->gc_descr = ObjectClass.vtable->gc_descr; + vtable->gc_descr = java::lang::Object::class$.vtable->gc_descr; for (int i = 0; i < dm_count; ++i) - vtable->set_method (i, ObjectClass.vtable->get_method (i)); + vtable->set_method (i, java::lang::Object::class$.vtable->get_method (i)); array_class->vtable = vtable; - array_class->vtable_method_count = ObjectClass.vtable_method_count; + array_class->vtable_method_count + = java::lang::Object::class$.vtable_method_count; // Stash the pointer to the element type. array_class->methods = (_Jv_Method *) element; // Register our interfaces. - static jclass interfaces[] = { &CloneableClass, &SerializableClass }; + static jclass interfaces[] = + { + &java::lang::Cloneable::class$, + &java::io::Serializable::class$ + }; array_class->interfaces = interfaces; array_class->interface_count = sizeof interfaces / sizeof interfaces[0]; diff --git a/libjava/java/lang/reflect/natMethod.cc b/libjava/java/lang/reflect/natMethod.cc index d4cbb72..8e3b7b2 100644 --- a/libjava/java/lang/reflect/natMethod.cc +++ b/libjava/java/lang/reflect/natMethod.cc @@ -42,17 +42,6 @@ details. */ #include <java/lang/UnsupportedOperationException.h> #endif -// FIXME: remove these. -#define BooleanClass java::lang::Boolean::class$ -#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 { jclass prim; @@ -64,16 +53,16 @@ struct cpair static cpair primitives[] = { #define BOOLEAN 0 - { JvPrimClass (boolean), &BooleanClass }, - { JvPrimClass (byte), &ByteClass }, + { JvPrimClass (boolean), &java::lang::Boolean::class$ }, + { JvPrimClass (byte), &java::lang::Byte::class$ }, #define SHORT 2 - { JvPrimClass (short), &ShortClass }, + { JvPrimClass (short), &java::lang::Short::class$ }, #define CHAR 3 - { JvPrimClass (char), &CharacterClass }, - { JvPrimClass (int), &IntegerClass }, - { JvPrimClass (long), &LongClass }, - { JvPrimClass (float), &FloatClass }, - { JvPrimClass (double), &DoubleClass }, + { JvPrimClass (char), &java::lang::Character::class$ }, + { JvPrimClass (int), &java::lang::Integer::class$ }, + { JvPrimClass (long), &java::lang::Long::class$ }, + { JvPrimClass (float), &java::lang::Float::class$ }, + { JvPrimClass (double), &java::lang::Double::class$ }, { NULL, NULL } }; diff --git a/libjava/java/net/natPlainDatagramSocketImpl.cc b/libjava/java/net/natPlainDatagramSocketImpl.cc index 4db9912..2375bdb 100644 --- a/libjava/java/net/natPlainDatagramSocketImpl.cc +++ b/libjava/java/net/natPlainDatagramSocketImpl.cc @@ -69,10 +69,6 @@ _Jv_bind (int fd, struct sockaddr *addr, int addrlen) #include <java/lang/Boolean.h> #include <java/lang/Integer.h> -// FIXME: remove these -#define BooleanClass java::lang::Boolean::class$ -#define IntegerClass java::lang::Integer::class$ - #ifdef DISABLE_JAVA_NET void @@ -504,13 +500,13 @@ java::net::PlainDatagramSocketImpl::setOption (jint optID, if (fnum < 0) throw new java::net::SocketException (JvNewStringUTF ("Socket closed")); - if (_Jv_IsInstanceOf (value, &BooleanClass)) + if (_Jv_IsInstanceOf (value, &java::lang::Boolean::class$)) { java::lang::Boolean *boolobj = static_cast<java::lang::Boolean *> (value); val = boolobj->booleanValue() ? 1 : 0; } - else if (_Jv_IsInstanceOf (value, &IntegerClass)) + else if (_Jv_IsInstanceOf (value, &java::lang::Integer::class$)) { java::lang::Integer *intobj = static_cast<java::lang::Integer *> (value); |