< prev index next >

src/hotspot/share/oops/klass.cpp

Print this page




 592     log_debug(cds, mirror)("%s has raw archived mirror", external_name());
 593     if (HeapShared::open_archive_heap_region_mapped()) {
 594       bool present = java_lang_Class::restore_archived_mirror(this, loader, module_handle,
 595                                                               protection_domain,
 596                                                               CHECK);
 597       if (present) {
 598         return;
 599       }
 600     }
 601 
 602     // No archived mirror data
 603     log_debug(cds, mirror)("No archived mirror data for %s", external_name());
 604     _java_mirror = NULL;
 605     this->clear_has_raw_archived_mirror();
 606   }
 607 
 608   // Only recreate it if not present.  A previous attempt to restore may have
 609   // gotten an OOM later but keep the mirror if it was created.
 610   if (java_mirror() == NULL) {
 611     log_trace(cds, mirror)("Recreate mirror for %s", external_name());
 612     java_lang_Class::create_mirror(this, loader, module_handle, protection_domain, CHECK);
 613   }
 614 }
 615 
 616 #if INCLUDE_CDS_JAVA_HEAP
 617 // Used at CDS dump time to access the archived mirror. No GC barrier.
 618 oop Klass::archived_java_mirror_raw() {
 619   assert(has_raw_archived_mirror(), "must have raw archived mirror");
 620   return CompressedOops::decode(_archived_mirror);
 621 }
 622 
 623 narrowOop Klass::archived_java_mirror_raw_narrow() {
 624   assert(has_raw_archived_mirror(), "must have raw archived mirror");
 625   return _archived_mirror;
 626 }
 627 
 628 // No GC barrier
 629 void Klass::set_archived_java_mirror_raw(oop m) {
 630   assert(DumpSharedSpaces, "called only during runtime");
 631   _archived_mirror = CompressedOops::encode(m);
 632 }




 592     log_debug(cds, mirror)("%s has raw archived mirror", external_name());
 593     if (HeapShared::open_archive_heap_region_mapped()) {
 594       bool present = java_lang_Class::restore_archived_mirror(this, loader, module_handle,
 595                                                               protection_domain,
 596                                                               CHECK);
 597       if (present) {
 598         return;
 599       }
 600     }
 601 
 602     // No archived mirror data
 603     log_debug(cds, mirror)("No archived mirror data for %s", external_name());
 604     _java_mirror = NULL;
 605     this->clear_has_raw_archived_mirror();
 606   }
 607 
 608   // Only recreate it if not present.  A previous attempt to restore may have
 609   // gotten an OOM later but keep the mirror if it was created.
 610   if (java_mirror() == NULL) {
 611     log_trace(cds, mirror)("Recreate mirror for %s", external_name());
 612     java_lang_Class::create_mirror(this, loader, module_handle, protection_domain, Handle(), CHECK);
 613   }
 614 }
 615 
 616 #if INCLUDE_CDS_JAVA_HEAP
 617 // Used at CDS dump time to access the archived mirror. No GC barrier.
 618 oop Klass::archived_java_mirror_raw() {
 619   assert(has_raw_archived_mirror(), "must have raw archived mirror");
 620   return CompressedOops::decode(_archived_mirror);
 621 }
 622 
 623 narrowOop Klass::archived_java_mirror_raw_narrow() {
 624   assert(has_raw_archived_mirror(), "must have raw archived mirror");
 625   return _archived_mirror;
 626 }
 627 
 628 // No GC barrier
 629 void Klass::set_archived_java_mirror_raw(oop m) {
 630   assert(DumpSharedSpaces, "called only during runtime");
 631   _archived_mirror = CompressedOops::encode(m);
 632 }


< prev index next >