src/share/vm/oops/klass.cpp
Print this page
rev 6841 : mq
rev 6842 : mq
@@ -182,10 +182,11 @@
set_last_biased_lock_bulk_revocation_time(0);
// The klass doesn't have any references at this point.
clear_modified_oops();
clear_accumulated_modified_oops();
+ _shared_class_path_index = -1;
}
jint Klass::array_layout_helper(BasicType etype) {
assert(etype >= T_BOOLEAN && etype <= T_OBJECT, "valid etype");
// Note that T_ARRAY is not allowed here.
@@ -498,31 +499,30 @@
// Null out class_loader_data because we don't share that yet.
set_class_loader_data(NULL);
}
-void Klass::restore_unshareable_info(TRAPS) {
+void Klass::restore_unshareable_info(ClassLoaderData* loader_data, Handle protection_domain, TRAPS) {
TRACE_INIT_ID(this);
// If an exception happened during CDS restore, some of these fields may already be
// set. We leave the class on the CLD list, even if incomplete so that we don't
// modify the CLD list outside a safepoint.
if (class_loader_data() == NULL) {
- ClassLoaderData* loader_data = ClassLoaderData::the_null_class_loader_data();
// Restore class_loader_data to the null class loader data
set_class_loader_data(loader_data);
// Add to null class loader list first before creating the mirror
// (same order as class file parsing)
loader_data->add_class(this);
}
- // Recreate the class mirror. The protection_domain is always null for
- // boot loader, for now.
+ // Recreate the class mirror.
// Only recreate it if not present. A previous attempt to restore may have
// gotten an OOM later but keep the mirror if it was created.
if (java_mirror() == NULL) {
- java_lang_Class::create_mirror(this, Handle(NULL), Handle(NULL), CHECK);
+ Handle loader = loader_data->class_loader();
+ java_lang_Class::create_mirror(this, loader, protection_domain, CHECK);
}
}
Klass* Klass::array_klass_or_null(int rank) {
EXCEPTION_MARK;