< prev index next >

src/hotspot/share/oops/constantPool.cpp

Print this page
@@ -459,10 +459,15 @@
          Handle refs_handle(THREAD, stom);  // must handleize.
          set_resolved_references(loader_data->add_handle(refs_handle));
        }
      }
    }
+ 
+   if (CDSConfig::is_dumping_final_static_archive() && resolved_references() != nullptr) {
+     objArrayOop scratch_references = oopFactory::new_objArray(vmClasses::Object_klass(), resolved_references()->length(), CHECK);
+     HeapShared::add_scratch_resolved_references(this, scratch_references);
+   }
  }
  
  void ConstantPool::remove_unshareable_info() {
    // Shared ConstantPools are in the RO region, so the _flags cannot be modified.
    // The _on_stack flag is used to prevent ConstantPools from deallocation during

@@ -504,10 +509,13 @@
  
    if (src_k->is_typeArray_klass()) {
      type = "prim";
    } else {
      InstanceKlass* src_ik = InstanceKlass::cast(src_k);
+     if (CDSConfig::is_dumping_final_static_archive() && src_ik->class_loader_data() == nullptr) {
+       return "unreg";
+     }
      oop loader = src_ik->class_loader();
      if (loader == nullptr) {
        type = "boot";
      } else if (loader == SystemDictionary::java_platform_loader()) {
        type = "plat";
< prev index next >