< prev index next >

src/hotspot/share/cds/dumpTimeClassInfo.hpp

Print this page
@@ -1,7 +1,7 @@
  /*
-  * Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved.
+  * Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.

@@ -40,11 +40,14 @@
  
  class DumpTimeClassInfo: public CHeapObj<mtClass> {
    bool                         _excluded;
    bool                         _is_early_klass;
    bool                         _has_checked_exclusion;
- 
+   bool                         _can_be_preinited;
+   bool                         _has_done_preinit_check;
+   bool                         _is_required;
+   bool                         _has_scanned_constant_pool;
    class DTLoaderConstraint {
      Symbol* _name;
      char _loader_type1;
      char _loader_type2;
    public:

@@ -135,10 +138,14 @@
      _klass = nullptr;
      _nest_host = nullptr;
      _failed_verification = false;
      _is_archived_lambda_proxy = false;
      _has_checked_exclusion = false;
+     _can_be_preinited = false;
+     _has_done_preinit_check = false;
+     _is_required = false;
+     _has_scanned_constant_pool = false;
      _id = -1;
      _clsfile_size = -1;
      _clsfile_crc32 = -1;
      _excluded = false;
      _is_early_klass = JvmtiExport::is_early_phase();

@@ -194,13 +201,11 @@
          _loader_constraints->adr_at(i)->metaspace_pointers_do(it);
        }
      }
    }
  
-   bool is_excluded() {
-     return _excluded || _failed_verification;
-   }
+   bool is_excluded();
  
    // Was this class loaded while JvmtiExport::is_early_phase()==true
    bool is_early_klass() {
      return _is_early_klass;
    }

@@ -212,10 +217,26 @@
    bool failed_verification() const                  { return _failed_verification; }
    void set_failed_verification()                    { _failed_verification = true; }
    InstanceKlass* nest_host() const                  { return _nest_host; }
    void set_nest_host(InstanceKlass* nest_host)      { _nest_host = nest_host; }
  
+   bool can_be_preinited() const                     { return _can_be_preinited; }
+   bool has_done_preinit_check() const               { return _has_done_preinit_check; }
+   bool is_required() const                          { return _is_required; }
+   void set_is_required()                            { _is_required = true; }
+   bool has_scanned_constant_pool() const            { return _has_scanned_constant_pool; }
+   void set_has_scanned_constant_pool()              { _has_scanned_constant_pool = true; }
+ 
+   void set_can_be_preinited(bool v) {
+     _can_be_preinited = v;
+     _has_done_preinit_check = true;
+   }
+   void reset_preinit_check() {
+     _can_be_preinited = false;
+     _has_done_preinit_check = false;
+   }
+ 
    size_t runtime_info_bytesize() const;
  };
  
  template <typename T>
  inline unsigned DumpTimeSharedClassTable_hash(T* const& k) {

@@ -260,10 +281,11 @@
      }
    }
  
    template<class ITER> void iterate_all_live_classes(ITER* iter) const;
    template<typename Function> void iterate_all_live_classes(Function function) const;
+   template<typename Function> void iterate_all_classes_in_builtin_loaders(Function function) const;
  
  private:
    // It's unsafe to iterate on classes whose loader is dead.
    // Declare these private and don't implement them. This forces users of
    // DumpTimeSharedClassTable to use the iterate_all_live_classes() methods
< prev index next >