< prev index next >
src/hotspot/share/classfile/systemDictionary.cpp
Print this page
*** 1010,1020 ****
host_klass,
cp_patches,
CHECK_NULL);
if (host_klass != NULL && k != NULL) {
! // If it's anonymous, initialize it now, since nobody else will.
{
MutexLocker mu_r(Compile_lock, THREAD);
// Add to class hierarchy, initialize vtables, and do possible
--- 1010,1022 ----
host_klass,
cp_patches,
CHECK_NULL);
if (host_klass != NULL && k != NULL) {
! // Anonymous classes must update ClassLoaderData holder (was host_klass loader)
! // so that they can be unloaded when the mirror is no longer referenced.
! k->class_loader_data()->update_holder(Handle(THREAD, k->java_mirror()));
{
MutexLocker mu_r(Compile_lock, THREAD);
// Add to class hierarchy, initialize vtables, and do possible
*** 1030,1039 ****
--- 1032,1043 ----
// Rewrite and patch constant pool here.
k->link_class(CHECK_NULL);
if (cp_patches != NULL) {
k->constants()->patch_resolved_references(cp_patches);
}
+
+ // If it's anonymous, initialize it now, since nobody else will.
k->eager_initialize(CHECK_NULL);
// notify jvmti
if (JvmtiExport::should_post_class_load()) {
assert(THREAD->is_Java_thread(), "thread->is_Java_thread()");
< prev index next >