diff --git a/.hgtags b/.hgtags index deb674b8d2f866f2dadd3ce2499fd546be8876bf..9d9e3599db744e0bf6710879613cfbab1a291f13 100644 --- a/.hgtags +++ b/.hgtags @@ -493,3 +493,4 @@ b15553cde967dfd7781a4a5c669e4cb7db734317 jdk8u20-b19 4f18dea0312d601d0515976bc0c643ea7acc829d hs25.20-b20 9e4d27da4ac04c6e19291087f7c68a5c5803c7ca jdk8u20-b20 4828415ebbf11e205dcc08e97ad5ae7dd03522f9 jdk8u20-b21 +e4a6e7f1b90b85270aee1c54edaca3ef737082f1 hs25.20-b21 diff --git a/make/hotspot_version b/make/hotspot_version index 52bd4ff081bae8b2c53dd3c42c0fed9e026561a9..c5fe26d62edbf6277f053d741048fb9b10427488 100644 --- a/make/hotspot_version +++ b/make/hotspot_version @@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2014 HS_MAJOR_VER=25 HS_MINOR_VER=20 -HS_BUILD_NUMBER=20 +HS_BUILD_NUMBER=21 JDK_MAJOR_VER=1 JDK_MINOR_VER=8 diff --git a/src/share/vm/classfile/classFileParser.cpp b/src/share/vm/classfile/classFileParser.cpp index e56f46d868f86cbc215043ab12925c61728c6709..c0d41431184ac573cf13c239e946075accf320ad 100644 --- a/src/share/vm/classfile/classFileParser.cpp +++ b/src/share/vm/classfile/classFileParser.cpp @@ -4038,6 +4038,11 @@ instanceKlassHandle ClassFileParser::parseClassFile(Symbol* name, this_klass->set_major_version(major_version); this_klass->set_has_default_methods(has_default_methods); + if (!host_klass.is_null()) { + assert (this_klass->is_anonymous(), "should be the same"); + this_klass->set_host_klass(host_klass()); + } + // Set up Method*::intrinsic_id as soon as we know the names of methods. // (We used to do this lazily, but now we query it in Rewriter, // which is eagerly done for every method, so we might as well do it now, diff --git a/src/share/vm/classfile/classLoaderData.cpp b/src/share/vm/classfile/classLoaderData.cpp index 033a8257d727de818f0ed435296f20a57fa4eb3e..2c613bd5b66db96050638a5e52d8a4433dcda447 100644 --- a/src/share/vm/classfile/classLoaderData.cpp +++ b/src/share/vm/classfile/classLoaderData.cpp @@ -531,6 +531,7 @@ bool ClassLoaderData::contains_klass(Klass* klass) { // 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; @@ -628,7 +629,9 @@ void ClassLoaderDataGraph::loaded_classes_do(KlassClosure* klass_closure) { 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); } } @@ -676,6 +679,11 @@ bool ClassLoaderDataGraph::do_unloading(BoolObjectClosure* is_alive_closure) { 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(); diff --git a/src/share/vm/classfile/classLoaderData.hpp b/src/share/vm/classfile/classLoaderData.hpp index adb8e95bd9f827f1400f7dc5e771f9e0a58b75ca..bd8dcc0ab6280075c94eb452aa15ff6d2e418575 100644 --- a/src/share/vm/classfile/classLoaderData.hpp +++ b/src/share/vm/classfile/classLoaderData.hpp @@ -66,6 +66,7 @@ class ClassLoaderDataGraph : public AllStatic { 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); diff --git a/src/share/vm/classfile/systemDictionary.cpp b/src/share/vm/classfile/systemDictionary.cpp index b2754ed3528f9ec06105209cb9226a99e445565f..3b0cf3cc4bad70e561fe0d42876c1afb0bd9ae3a 100644 --- a/src/share/vm/classfile/systemDictionary.cpp +++ b/src/share/vm/classfile/systemDictionary.cpp @@ -997,7 +997,6 @@ Klass* SystemDictionary::parse_stream(Symbol* class_name, if (host_klass.not_null() && k.not_null()) { assert(EnableInvokeDynamic, ""); - k->set_host_klass(host_klass()); // If it's anonymous, initialize it now, since nobody else will. {