< prev index next >

src/hotspot/share/classfile/systemDictionaryShared.hpp

Print this page
@@ -33,10 +33,11 @@
  #include "classfile/classLoaderData.hpp"
  #include "classfile/packageEntry.hpp"
  #include "classfile/systemDictionary.hpp"
  #include "oops/klass.hpp"
  #include "oops/oopHandle.hpp"
+ #include "oops/trainingData.hpp"
  
  
  /*===============================================================================
  
      Handling of the classes in the AppCDS archive

@@ -181,33 +182,36 @@
                                   Handle class_loader,
                                   Handle protection_domain,
                                   const ClassFileStream* cfs,
                                   TRAPS);
  
-   // Guaranteed to return non-null value for non-shared classes.
-   // k must not be a shared class.
-   static DumpTimeClassInfo* get_info(InstanceKlass* k);
-   static DumpTimeClassInfo* get_info_locked(InstanceKlass* k);
  
    static void find_all_archivable_classes_impl();
    static void write_dictionary(RunTimeSharedDictionary* dictionary,
                                 bool is_builtin);
    static void write_lambda_proxy_class_dictionary(LambdaProxyClassDictionary* dictionary);
    static void cleanup_lambda_proxy_class_dictionary();
    static void reset_registered_lambda_proxy_class(InstanceKlass* ik);
-   static bool is_jfr_event_class(InstanceKlass *k);
    static bool is_registered_lambda_proxy_class(InstanceKlass* ik);
    static bool check_for_exclusion_impl(InstanceKlass* k);
    static void remove_dumptime_info(InstanceKlass* k) NOT_CDS_RETURN;
-   static bool has_been_redefined(InstanceKlass* k);
    static InstanceKlass* retrieve_lambda_proxy_class(const RunTimeLambdaProxyClassInfo* info) NOT_CDS_RETURN_(nullptr);
    static void scan_constant_pool(InstanceKlass* k);
    DEBUG_ONLY(static bool _class_loading_may_happen;)
  
  public:
+   // Guaranteed to return non-null value for non-shared classes.
+   // k must not be a shared class.
+   static DumpTimeClassInfo* get_info(InstanceKlass* k);
+   static DumpTimeClassInfo* get_info_locked(InstanceKlass* k);
+   static DumpTimeSharedClassTable* dumptime_table() { return _dumptime_table; }
+ 
    static bool should_hidden_class_be_archived(InstanceKlass* k);
    static void mark_required_hidden_class(InstanceKlass* k);
+   static bool has_been_redefined(InstanceKlass* k);
+   static bool is_jfr_event_class(InstanceKlass *k);
+ 
    static bool is_hidden_lambda_proxy(InstanceKlass* ik);
    static bool is_early_klass(InstanceKlass* k);   // Was k loaded while JvmtiExport::is_early_phase()==true
    static bool has_archived_enum_objs(InstanceKlass* ik);
    static void set_has_archived_enum_objs(InstanceKlass* ik);
  

@@ -234,10 +238,14 @@
  
    static void initialize() NOT_CDS_RETURN;
    static void init_dumptime_info(InstanceKlass* k) NOT_CDS_RETURN;
    static void handle_class_unloading(InstanceKlass* k) NOT_CDS_RETURN;
  
+   static bool can_be_preinited(InstanceKlass* ik);
+   static bool can_be_preinited_locked(InstanceKlass* ik);
+   static void reset_preinit_check();
+ 
    static Dictionary* boot_loader_dictionary() {
      return ClassLoaderData::the_null_class_loader_data()->dictionary();
    }
  
    static void update_shared_entry(InstanceKlass* klass, int id);

@@ -284,11 +292,11 @@
    static InstanceKlass* prepare_shared_lambda_proxy_class(InstanceKlass* lambda_ik,
                                                            InstanceKlass* caller_ik, TRAPS) NOT_CDS_RETURN_(nullptr);
    static bool check_linking_constraints(Thread* current, InstanceKlass* klass) NOT_CDS_RETURN_(false);
    static void record_linking_constraint(Symbol* name, InstanceKlass* klass,
                                       Handle loader1, Handle loader2) NOT_CDS_RETURN;
-   static bool is_builtin(InstanceKlass* k) {
+   static bool is_builtin(const InstanceKlass* k) {
      return (k->shared_classpath_index() != UNREGISTERED_INDEX);
    }
    static bool add_unregistered_class(Thread* current, InstanceKlass* k);
  
    static void find_all_archivable_classes();

@@ -301,20 +309,24 @@
    static bool warn_excluded(InstanceKlass* k, const char* reason);
    static void dumptime_classes_do(class MetaspaceClosure* it);
    static size_t estimate_size_for_archive();
    static void write_to_archive(bool is_static_archive = true);
    static void adjust_lambda_proxy_class_dictionary();
+ 
    static void serialize_dictionary_headers(class SerializeClosure* soc,
                                             bool is_static_archive = true);
    static void serialize_vm_classes(class SerializeClosure* soc);
    static void print() { return print_on(tty); }
    static void print_on(outputStream* st) NOT_CDS_RETURN;
    static void print_shared_archive(outputStream* st, bool is_static = true) NOT_CDS_RETURN;
    static void print_table_statistics(outputStream* st) NOT_CDS_RETURN;
    static bool is_dumptime_table_empty() NOT_CDS_RETURN_(true);
    static bool is_supported_invokedynamic(BootstrapInfo* bsi) NOT_CDS_RETURN_(false);
    DEBUG_ONLY(static bool class_loading_may_happen() {return _class_loading_may_happen;})
+   // Do not archive any new InstanceKlasses that are loaded after this method is called.
+   // This avoids polluting the archive with classes that are only used by GenerateJLIClassesHelper.
+   static void ignore_new_classes();
  
  #ifdef ASSERT
    // This object marks a critical period when writing the CDS archive. During this
    // period, the JVM must not load any new classes, so as to avoid adding new
    // items in the SystemDictionaryShared::_dumptime_table.

@@ -337,8 +349,10 @@
      uintx offset = uintx(ptr) - uintx(SharedBaseAddress);
      return primitive_hash<uintx>(offset);
    }
  
    static unsigned int hash_for_shared_dictionary(address ptr);
+   static const char* class_loader_name_for_shared(Klass* k);
+   static void create_loader_positive_lookup_cache(TRAPS);
  };
  
  #endif // SHARE_CLASSFILE_SYSTEMDICTIONARYSHARED_HPP
< prev index next >