< prev index next >

src/hotspot/share/cds/aotArtifactFinder.cpp

Print this page
@@ -30,10 +30,11 @@
  #include "classfile/systemDictionaryShared.hpp"
  #include "logging/log.hpp"
  #include "memory/metaspaceClosure.hpp"
  #include "oops/instanceKlass.hpp"
  #include "oops/objArrayKlass.hpp"
+ #include "oops/trainingData.hpp"
  #include "utilities/resourceHash.hpp"
  
  // All the classes that should be included in the AOT cache (in at least the "allocated" state)
  static GrowableArrayCHeap<Klass*, mtClassShared>* _all_cached_classes = nullptr;
  

@@ -146,19 +147,22 @@
  
    // Exclude all the (hidden) classes that have not been discovered by the code above.
    SystemDictionaryShared::dumptime_table()->iterate_all_live_classes([&] (InstanceKlass* k, DumpTimeClassInfo& info) {
      if (!info.is_excluded() && _seen_classes->get(k) == nullptr) {
        info.set_excluded();
+       info.set_has_checked_exclusion();
        assert(k->is_hidden(), "must be");
        if (log_is_enabled(Info, cds)) {
          ResourceMark rm;
-         log_info(cds)("Skipping %s: Hidden class", k->name()->as_C_string());
+         log_debug(cds)("Skipping %s: Unreferenced hidden class", k->name()->as_C_string());
        }
      }
    });
  
    end_scanning_for_oops();
+ 
+   TrainingData::cleanup_training_data();
  }
  
  void AOTArtifactFinder::start_scanning_for_oops() {
  #if INCLUDE_CDS_JAVA_HEAP
    if (CDSConfig::is_dumping_heap()) {

@@ -205,10 +209,14 @@
  void AOTArtifactFinder::add_cached_instance_class(InstanceKlass* ik) {
    bool created;
    _seen_classes->put_if_absent(ik, &created);
    if (created) {
      _all_cached_classes->append(ik);
+     if (CDSConfig::is_dumping_final_static_archive() && ik->is_shared_unregistered_class()) {
+       // The following are not appliable to unregistered classes
+       return;
+     }
      scan_oops_in_instance_class(ik);
      if (ik->is_hidden() && CDSConfig::is_initing_classes_at_dump_time()) {
        bool succeed = AOTClassLinker::try_add_candidate(ik);
        guarantee(succeed, "All cached hidden classes must be aot-linkable");
        add_aot_inited_class(ik);
< prev index next >