diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 4221240d1eda..ac601a317fac 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,7 @@ +2006-05-10 Andrew Haley + + * java/lang/natClassLoader.cc: Add comments. + 2006-05-09 Andrew Haley * prims.cc (_Jv_soleIndirectCompiledEngine): New. diff --git a/libjava/java/lang/natClassLoader.cc b/libjava/java/lang/natClassLoader.cc index 43e624a3f747..6b3c3ef9cd53 100644 --- a/libjava/java/lang/natClassLoader.cc +++ b/libjava/java/lang/natClassLoader.cc @@ -156,6 +156,30 @@ _Jv_UnregisterInitiatingLoader (jclass klass, java::lang::ClassLoader *loader) loader->loadedClasses->remove(klass->name->toString()); } + +// Class registration. +// +// There are two kinds of functions that register classes. +// +// Type 1: +// +// These take the address of a class that is in an object file. +// Because these classes are not allocated on the heap, It is also +// necessary to register the address of the object for garbage +// collection. This is used with the "old" C++ ABI and with +// -findirect-dispatch -fno-indirect-classes. +// +// Type 2: +// +// These take an initializer struct, create the class, and return the +// address of the newly created class to their caller. These are used +// with -findirect-dispatch. +// +// _Jv_RegisterClasses() and _Jv_RegisterClasses_Counted() are +// functions of Type 1, and _Jv_NewClassFromInitializer() and +// _Jv_RegisterNewClasses() are of Type 2. + + // This function is called many times during startup, before main() is // run. At that point in time we know for certain we are running // single-threaded, so we don't need to lock when adding classes to the