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
This commit is contained in:
Tom Tromey 2005-02-07 21:29:04 +00:00 committed by Tom Tromey
parent b0ad2de203
commit f55db9c2fc
5 changed files with 30 additions and 15 deletions

View file

@ -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)
{