[RFA] JVMTI/JDWP GetAllLoadedClasses
Kyle Galloway
kgallowa@redhat.com
Tue Apr 24 15:53:00 GMT 2007
This patch implements the JVMTI and JDWP functions to get all loaded
classes in the VM. To accomplish this, each class is marked as loaded
in _Jv_PushClass, by calling ClassList::add () and stored as a referent
to an element of a list of WeakReferences. When retrieving the list of
loaded classes, the list is first checked to see if any of the classes
has been GCed (there is a WeakReference to null), which will remove its
entry from the list before it is returned. In order to avoid problems
with circular class loading(try to load a class, then try to add it to
the class list, whihc requires WeakReference to be loaded, which needs
to be stored in the list, whichi requires WeakReference to be
loaded...and so on), until it can be assured that WeakReference is
loaded (which is checked in ClassList::setup ()), the classes that have
been loaded are stored in a temporary linked list of jclass *. When
setup is called, these classes are transferred over to the WeakReference
list, and the memory used by this temporary list is freed.
ChangeLog
* jvmti.cc (_Jv_JVMTI_GetLoadedClasses): New method.
* prims.cc (_Jv_CreateJavaVM): Call ClassList::setup ().
* gnu/gcj/jvmti/ClassList.h: New file.
* gnu/gcj/jvmti/natClassList.cc: New file.
* gnu/classpath/jdwp/natVMVirtualMachine.cc (getAllLoadedClasses):
Implement.
* java/lang/natClassLosder.cc (_Jv_PushClass): Call ClassList::add ().
* Makefile.am: Add gnu/gcj/jvmti/natClassList.cc.
* Makefile.in: Regenerated.
Questions/comments/concerns?
Thanks,
Kyle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: combined.patch
Type: text/x-patch
Size: 11199 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20070424/d17f1a6b/attachment.bin>
More information about the Java-patches
mailing list