< prev index next >

src/hotspot/share/cds/dumpTimeClassInfo.inline.hpp

Print this page
*** 26,10 ***
--- 26,11 ---
  #ifndef SHARE_CDS_DUMPTIMECLASSINFO_INLINE_HPP
  #define SHARE_CDS_DUMPTIMECLASSINFO_INLINE_HPP
  
  #include "cds/dumpTimeClassInfo.hpp"
  
+ #include "cds/cdsConfig.hpp"
  #include "classfile/systemDictionaryShared.hpp"
  #include "classfile/classLoaderData.inline.hpp"
  #include "oops/instanceKlass.hpp"
  #include "oops/klass.inline.hpp"
  #include "runtime/safepoint.hpp"

*** 42,11 ***
  template<typename Function>
  void DumpTimeSharedClassTable::iterate_all_live_classes(Function function) const {
    auto wrapper = [&] (InstanceKlass* k, DumpTimeClassInfo& info) {
      assert(SafepointSynchronize::is_at_safepoint(), "invariant");
      assert_lock_strong(DumpTimeTable_lock);
!     if (k->is_loader_alive()) {
        function(k, info);
        assert(k->is_loader_alive(), "must not change");
      } else {
        if (!SystemDictionaryShared::is_excluded_class(k)) {
          SystemDictionaryShared::warn_excluded(k, "Class loader not alive");
--- 43,14 ---
  template<typename Function>
  void DumpTimeSharedClassTable::iterate_all_live_classes(Function function) const {
    auto wrapper = [&] (InstanceKlass* k, DumpTimeClassInfo& info) {
      assert(SafepointSynchronize::is_at_safepoint(), "invariant");
      assert_lock_strong(DumpTimeTable_lock);
!     if (CDSConfig::is_dumping_final_static_archive() && !k->is_loaded()) {
+       assert(k->is_shared_unregistered_class(), "must be");
+       function(k, info);
+     } else if (k->is_loader_alive()) {
        function(k, info);
        assert(k->is_loader_alive(), "must not change");
      } else {
        if (!SystemDictionaryShared::is_excluded_class(k)) {
          SystemDictionaryShared::warn_excluded(k, "Class loader not alive");

*** 55,10 ***
--- 59,23 ---
      }
    };
    DumpTimeSharedClassTableBaseType::iterate_all(wrapper);
  }
  
+ template<typename Function>
+ void DumpTimeSharedClassTable::iterate_all_classes_in_builtin_loaders(Function function) const {
+   auto wrapper = [&] (InstanceKlass* k, DumpTimeClassInfo& info) {
+     assert_lock_strong(DumpTimeTable_lock);
+     if (SystemDictionaryShared::is_builtin_loader(k->class_loader_data())) {
+        assert(k->is_loader_alive(), "must be");
+        function(k, info);
+        assert(k->is_loader_alive(), "must be");
+     }
+   };
+   DumpTimeSharedClassTableBaseType::iterate_all(wrapper);
+ }
+ 
  
  template<class ITER>
  void DumpTimeSharedClassTable::iterate_all_live_classes(ITER* iter) const {
    auto function = [&] (InstanceKlass* k, DumpTimeClassInfo& v) {
      iter->do_entry(k, v);
< prev index next >