510 } |
510 } |
511 |
511 |
512 void Klass::remove_unshareable_info() { |
512 void Klass::remove_unshareable_info() { |
513 assert (DumpSharedSpaces, "only called for DumpSharedSpaces"); |
513 assert (DumpSharedSpaces, "only called for DumpSharedSpaces"); |
514 TRACE_REMOVE_ID(this); |
514 TRACE_REMOVE_ID(this); |
|
515 if (log_is_enabled(Trace, cds, unshareable)) { |
|
516 ResourceMark rm; |
|
517 log_trace(cds, unshareable)("remove: %s", external_name()); |
|
518 } |
515 |
519 |
516 set_subklass(NULL); |
520 set_subklass(NULL); |
517 set_next_sibling(NULL); |
521 set_next_sibling(NULL); |
518 // Clear the java mirror |
|
519 set_java_mirror(NULL); |
|
520 set_next_link(NULL); |
522 set_next_link(NULL); |
521 |
523 |
522 // Null out class_loader_data because we don't share that yet. |
524 // Null out class_loader_data because we don't share that yet. |
523 set_class_loader_data(NULL); |
525 set_class_loader_data(NULL); |
524 set_is_shared(); |
526 set_is_shared(); |
|
527 } |
|
528 |
|
529 void Klass::remove_java_mirror() { |
|
530 assert (DumpSharedSpaces, "only called for DumpSharedSpaces"); |
|
531 if (log_is_enabled(Trace, cds, unshareable)) { |
|
532 ResourceMark rm; |
|
533 log_trace(cds, unshareable)("remove java_mirror: %s", external_name()); |
|
534 } |
|
535 set_java_mirror(NULL); |
525 } |
536 } |
526 |
537 |
527 void Klass::restore_unshareable_info(ClassLoaderData* loader_data, Handle protection_domain, TRAPS) { |
538 void Klass::restore_unshareable_info(ClassLoaderData* loader_data, Handle protection_domain, TRAPS) { |
528 assert(is_klass(), "ensure C++ vtable is restored"); |
539 assert(is_klass(), "ensure C++ vtable is restored"); |
529 assert(is_shared(), "must be set"); |
540 assert(is_shared(), "must be set"); |
530 TRACE_RESTORE_ID(this); |
541 TRACE_RESTORE_ID(this); |
|
542 if (log_is_enabled(Trace, cds, unshareable)) { |
|
543 ResourceMark rm; |
|
544 log_trace(cds, unshareable)("restore: %s", external_name()); |
|
545 } |
531 |
546 |
532 // If an exception happened during CDS restore, some of these fields may already be |
547 // If an exception happened during CDS restore, some of these fields may already be |
533 // set. We leave the class on the CLD list, even if incomplete so that we don't |
548 // set. We leave the class on the CLD list, even if incomplete so that we don't |
534 // modify the CLD list outside a safepoint. |
549 // modify the CLD list outside a safepoint. |
535 if (class_loader_data() == NULL) { |
550 if (class_loader_data() == NULL) { |