< prev index next >

src/hotspot/share/oops/klass.cpp

Print this page
*** 389,11 ***
    if (length >= SECONDARY_SUPERS_TABLE_SIZE) {
      return SECONDARY_SUPERS_BITMAP_FULL;
    }
  
    {
!     PerfTraceTime ptt(ClassLoader::perf_secondary_hash_time());
  
      ResourceMark rm;
      uintx bitmap = SECONDARY_SUPERS_BITMAP_EMPTY;
      auto hashed_secondaries = new GrowableArray<Klass*>(SECONDARY_SUPERS_TABLE_SIZE,
                                                          SECONDARY_SUPERS_TABLE_SIZE, nullptr);
--- 389,11 ---
    if (length >= SECONDARY_SUPERS_TABLE_SIZE) {
      return SECONDARY_SUPERS_BITMAP_FULL;
    }
  
    {
!     //PerfTraceTime ptt(ClassLoader::perf_secondary_hash_time()); // Leyden FIXME
  
      ResourceMark rm;
      uintx bitmap = SECONDARY_SUPERS_BITMAP_EMPTY;
      auto hashed_secondaries = new GrowableArray<Klass*>(SECONDARY_SUPERS_TABLE_SIZE,
                                                          SECONDARY_SUPERS_TABLE_SIZE, nullptr);

*** 820,13 ***
  #if INCLUDE_CDS_JAVA_HEAP
    _archived_mirror_index = -1;
    if (CDSConfig::is_dumping_heap()) {
      Klass* src_k = ArchiveBuilder::current()->get_source_addr(this);
      oop orig_mirror = src_k->java_mirror();
!     oop scratch_mirror = HeapShared::scratch_java_mirror(orig_mirror);
!     if (scratch_mirror != nullptr) {
!       _archived_mirror_index = HeapShared::append_root(scratch_mirror);
      }
    }
  #endif
  
    // Just null out the mirror.  The class_loader_data() no longer exists.
--- 820,19 ---
  #if INCLUDE_CDS_JAVA_HEAP
    _archived_mirror_index = -1;
    if (CDSConfig::is_dumping_heap()) {
      Klass* src_k = ArchiveBuilder::current()->get_source_addr(this);
      oop orig_mirror = src_k->java_mirror();
!     if (orig_mirror == nullptr) {
!       assert(CDSConfig::is_dumping_final_static_archive(), "sanity");
!       assert(is_instance_klass(), "sanity");
+       assert(InstanceKlass::cast(this)->is_shared_unregistered_class(), "sanity");
+     } else {
+       oop scratch_mirror = HeapShared::scratch_java_mirror(orig_mirror);
+       if (scratch_mirror != nullptr) {
+         _archived_mirror_index = HeapShared::append_root(scratch_mirror);
+       }
      }
    }
  #endif
  
    // Just null out the mirror.  The class_loader_data() no longer exists.
< prev index next >