hotspot Udiff src/share/vm/classfile/classLoaderData.cpp (original) (raw)

Print this page

rev 9245 : [mq]: class_loading_log


@@ -52,16 +52,18 @@ #include "classfile/javaClasses.hpp" #include "classfile/metadataOnStackMark.hpp" #include "classfile/systemDictionary.hpp" #include "code/codeCache.hpp" #include "gc/shared/gcLocker.hpp" +#include "logging/log.hpp" #include "memory/metadataFactory.hpp" #include "memory/metaspaceShared.hpp" #include "memory/oopFactory.hpp" #include "oops/objArrayOop.inline.hpp" #include "oops/oop.inline.hpp" #include "runtime/atomic.inline.hpp" +#include "runtime/javaCalls.hpp" #include "runtime/jniHandles.hpp" #include "runtime/mutex.hpp" #include "runtime/safepoint.hpp" #include "runtime/synchronizer.hpp" #include "utilities/growableArray.hpp"


@@ -280,13 +282,14 @@ // Make sure linked class is stable, since the class list is walked without a lock OrderAccess::storestore(); // link the new item into the list _klasses = k;


@@ -320,19 +323,20 @@ _unloading = true;

// Tell serviceability tools these classes are unloading classes_do(InstanceKlass::notify_unload_class);

} }

oop ClassLoaderData::keep_alive_object() const { assert(!keep_alive(), "Don't use with CLDs that are artificially kept alive");


@@ -402,17 +406,19 @@ } if (this == the_null_class_loader_data()) { assert (class_loader() == NULL, "Must be"); set_metaspace(new Metaspace(_metaspace_lock, Metaspace::BootMetaspaceType)); } else if (is_anonymous()) {


@@ -567,17 +573,20 @@ // ClassLoaderData into the java/lang/ClassLoader object as a hidden field ClassLoaderData* ClassLoaderDataGraph::add(Handle loader, bool is_anonymous, TRAPS) { // We need to allocate all the oops for the ClassLoaderData before allocating the // actual ClassLoaderData object. ClassLoaderData::Dependencies dependencies(CHECK_NULL); + ClassLoaderData* cld; + +//BEGIN no_safepoints +{ No_Safepoint_Verifier no_safepoints; // we mustn't GC until we've installed the // ClassLoaderData in the graph since the CLD // contains unhandled oops - ClassLoaderData* cld = new ClassLoaderData(loader, is_anonymous, dependencies);


@@ -595,23 +604,48 @@

do { cld->set_next(next); ClassLoaderData* exchanged = (ClassLoaderData*)Atomic::cmpxchg_ptr(cld, list_head, next); if (exchanged == next) {

void ClassLoaderDataGraph::oops_do(OopClosure* f, KlassClosure* klass_closure, bool must_claim) { for (ClassLoaderData* cld = _head; cld != NULL; cld = cld->next()) { cld->oops_do(f, klass_closure, must_claim);


@@ -703,14 +737,15 @@ ClassLoaderData* curr = _head; while (curr != _saved_head) { if (!curr->claimed()) { array->push(curr);