471 }
472
473 void Klass::oops_do(OopClosure* cl) {
474 cl->do_oop(&_java_mirror);
475 }
476
477 void Klass::remove_unshareable_info() {
478 assert (DumpSharedSpaces, "only called for DumpSharedSpaces");
479
480 set_subklass(NULL);
481 set_next_sibling(NULL);
482 // Clear the java mirror
483 set_java_mirror(NULL);
484 set_next_link(NULL);
485
486 // Null out class_loader_data because we don't share that yet.
487 set_class_loader_data(NULL);
488 }
489
490 void Klass::restore_unshareable_info(TRAPS) {
491 // If an exception happened during CDS restore, some of these fields may already be
492 // set. We leave the class on the CLD list, even if incomplete so that we don't
493 // modify the CLD list outside a safepoint.
494 if (class_loader_data() == NULL) {
495 ClassLoaderData* loader_data = ClassLoaderData::the_null_class_loader_data();
496 // Restore class_loader_data to the null class loader data
497 set_class_loader_data(loader_data);
498
499 // Add to null class loader list first before creating the mirror
500 // (same order as class file parsing)
501 loader_data->add_class(this);
502 }
503
504 // Recreate the class mirror. The protection_domain is always null for
505 // boot loader, for now.
506 // Only recreate it if not present. A previous attempt to restore may have
507 // gotten an OOM later but keep the mirror if it was created.
508 if (java_mirror() == NULL) {
509 java_lang_Class::create_mirror(this, Handle(NULL), CHECK);
510 }
|
471 }
472
473 void Klass::oops_do(OopClosure* cl) {
474 cl->do_oop(&_java_mirror);
475 }
476
477 void Klass::remove_unshareable_info() {
478 assert (DumpSharedSpaces, "only called for DumpSharedSpaces");
479
480 set_subklass(NULL);
481 set_next_sibling(NULL);
482 // Clear the java mirror
483 set_java_mirror(NULL);
484 set_next_link(NULL);
485
486 // Null out class_loader_data because we don't share that yet.
487 set_class_loader_data(NULL);
488 }
489
490 void Klass::restore_unshareable_info(TRAPS) {
491 TRACE_INIT_ID(this);
492 // If an exception happened during CDS restore, some of these fields may already be
493 // set. We leave the class on the CLD list, even if incomplete so that we don't
494 // modify the CLD list outside a safepoint.
495 if (class_loader_data() == NULL) {
496 ClassLoaderData* loader_data = ClassLoaderData::the_null_class_loader_data();
497 // Restore class_loader_data to the null class loader data
498 set_class_loader_data(loader_data);
499
500 // Add to null class loader list first before creating the mirror
501 // (same order as class file parsing)
502 loader_data->add_class(this);
503 }
504
505 // Recreate the class mirror. The protection_domain is always null for
506 // boot loader, for now.
507 // Only recreate it if not present. A previous attempt to restore may have
508 // gotten an OOM later but keep the mirror if it was created.
509 if (java_mirror() == NULL) {
510 java_lang_Class::create_mirror(this, Handle(NULL), CHECK);
511 }
|