From e68dbbf5a350cef4a1328be3b7df5c0795eaf490 Mon Sep 17 00:00:00 2001 From: Andrew Haley Date: Wed, 10 May 2006 17:50:09 +0000 Subject: [PATCH] natClassLoader.cc: Add comments. 2006-05-10 Andrew Haley * java/lang/natClassLoader.cc: Add comments. From-SVN: r113677 --- libjava/ChangeLog | 4 ++++ libjava/java/lang/natClassLoader.cc | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 4221240d1ed..ac601a317fa 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 43e624a3f74..6b3c3ef9cd5 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 -- 2.30.2