--- a/hotspot/src/share/vm/classfile/classLoaderData.cpp Thu Jun 26 18:55:29 2014 -0700
+++ b/hotspot/src/share/vm/classfile/classLoaderData.cpp Fri Jun 27 08:11:49 2014 -0700
@@ -550,6 +550,7 @@
// GC root of class loader data created.
ClassLoaderData* ClassLoaderDataGraph::_head = NULL;
ClassLoaderData* ClassLoaderDataGraph::_unloading = NULL;
+ClassLoaderData* ClassLoaderDataGraph::_saved_unloading = NULL;
ClassLoaderData* ClassLoaderDataGraph::_saved_head = NULL;
bool ClassLoaderDataGraph::_should_purge = false;
@@ -657,7 +658,9 @@
void ClassLoaderDataGraph::classes_unloading_do(void f(Klass* const)) {
assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint!");
- for (ClassLoaderData* cld = _unloading; cld != NULL; cld = cld->next()) {
+ // Only walk the head until any clds not purged from prior unloading
+ // (CMS doesn't purge right away).
+ for (ClassLoaderData* cld = _unloading; cld != _saved_unloading; cld = cld->next()) {
cld->classes_do(f);
}
}
@@ -705,6 +708,11 @@
ClassLoaderData* data = _head;
ClassLoaderData* prev = NULL;
bool seen_dead_loader = false;
+
+ // Save previous _unloading pointer for CMS which may add to unloading list before
+ // purging and we don't want to rewalk the previously unloaded class loader data.
+ _saved_unloading = _unloading;
+
// mark metadata seen on the stack and code cache so we can delete
// unneeded entries.
bool has_redefined_a_class = JvmtiExport::has_redefined_a_class();
--- a/hotspot/src/share/vm/classfile/classLoaderData.hpp Thu Jun 26 18:55:29 2014 -0700
+++ b/hotspot/src/share/vm/classfile/classLoaderData.hpp Fri Jun 27 08:11:49 2014 -0700
@@ -66,6 +66,7 @@
static ClassLoaderData* _unloading;
// CMS support.
static ClassLoaderData* _saved_head;
+ static ClassLoaderData* _saved_unloading;
static bool _should_purge;
static ClassLoaderData* add(Handle class_loader, bool anonymous, TRAPS);
--- a/hotspot/src/share/vm/trace/tracetypes.xml Thu Jun 26 18:55:29 2014 -0700
+++ b/hotspot/src/share/vm/trace/tracetypes.xml Fri Jun 27 08:11:49 2014 -0700
@@ -98,6 +98,7 @@
<value type="SYMBOL" field="name" label="Name"/>
<value type="SYMBOL" field="signature" label="Signature"/>
<value type="SHORT" field="modifiers" label="Access modifiers"/>
+ <value type="BOOLEAN" field="hidden" label="Hidden"/>
</content_type>
<content_type id="UTFConstant" hr_name="UTF constant"
--- a/hotspot/test/runtime/Unsafe/RangeCheck.java Thu Jun 26 18:55:29 2014 -0700
+++ b/hotspot/test/runtime/Unsafe/RangeCheck.java Fri Jun 27 08:11:49 2014 -0700
@@ -43,6 +43,7 @@
true,
"-Xmx32m",
"-XX:-TransmitErrorReport",
+ "-XX:-InlineUnsafeOps", // The compiler intrinsics doesn't have the assert
DummyClassWithMainRangeCheck.class.getName());
OutputAnalyzer output = new OutputAnalyzer(pb.start());