diff options
author | Tom Tromey <tromey@redhat.com> | 2005-02-07 21:29:04 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2005-02-07 21:29:04 +0000 |
commit | f55db9c2fc24eff6cdbaa621851a4382f6dea939 (patch) | |
tree | 9321a4ce5d93e720f8ccef64c5a68a48525104d1 /libjava/defineclass.cc | |
parent | b0ad2de2032805ffbaff91d24647dc6fcc8a74ca (diff) | |
download | gcc-f55db9c2fc24eff6cdbaa621851a4382f6dea939.zip gcc-f55db9c2fc24eff6cdbaa621851a4382f6dea939.tar.gz gcc-f55db9c2fc24eff6cdbaa621851a4382f6dea939.tar.bz2 |
defineclass.cc (handleClassBegin): Use _Jv_RegisterInitiatingLoader.
* defineclass.cc (handleClassBegin): Use
_Jv_RegisterInitiatingLoader.
* java/lang/Class.h (_Jv_UnregisterInitiatingLoader): Declare.
* java/lang/natVMClassLoader.cc (resolveClass): Don't register
class. Use _Jv_UnregisterInitiatingLoader.
* java/lang/natClassLoader.cc (_Jv_UnregisterInitiatingLoader):
New function.
From-SVN: r94717
Diffstat (limited to 'libjava/defineclass.cc')
-rw-r--r-- | libjava/defineclass.cc | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/libjava/defineclass.cc b/libjava/defineclass.cc index a40bff1..382b321 100644 --- a/libjava/defineclass.cc +++ b/libjava/defineclass.cc @@ -908,16 +908,14 @@ _Jv_ClassReader::handleClassBegin (int access_flags, int this_class, int super_c throw_no_class_def_found_error ("loading java.lang.Object"); } - // In the pre-loading state, it can be looked up in the - // cache only by this thread! This allows the super-class - // to include references to this class. - def->state = JV_STATE_PRELOADING; - { - JvSynchronize sync (&java::lang::Class::class$); - _Jv_RegisterClass (def); - } + // Register this class with its defining loader as well (despite the + // name of the function we're calling), so that super class lookups + // work properly. If there is an error, our caller will unregister + // this class from the class loader. Also, we don't need to hold a + // lock here, as our caller has acquired it. + _Jv_RegisterInitiatingLoader (def, def->loader); if (super_class != 0) { |