src/hotspot/share/classfile/systemDictionaryShared.hpp
changeset 54927 1512d88b24c6
parent 54807 33fe50b6d707
child 58499 d62c7224d5b7
child 58678 9cf78a70fa4f
equal deleted inserted replaced
54926:d4e7ccaf1445 54927:1512d88b24c6
   107 class DumpTimeSharedClassTable;
   107 class DumpTimeSharedClassTable;
   108 class RunTimeSharedClassInfo;
   108 class RunTimeSharedClassInfo;
   109 class RunTimeSharedDictionary;
   109 class RunTimeSharedDictionary;
   110 
   110 
   111 class SystemDictionaryShared: public SystemDictionary {
   111 class SystemDictionaryShared: public SystemDictionary {
       
   112   friend class ExcludeDumpTimeSharedClasses;
   112 public:
   113 public:
   113   enum {
   114   enum {
   114     FROM_FIELD_IS_PROTECTED = 1 << 0,
   115     FROM_FIELD_IS_PROTECTED = 1 << 0,
   115     FROM_IS_ARRAY           = 1 << 1,
   116     FROM_IS_ARRAY           = 1 << 1,
   116     FROM_IS_OBJECT          = 1 << 2
   117     FROM_IS_OBJECT          = 1 << 2
   209                                  Handle class_loader,
   210                                  Handle class_loader,
   210                                  Handle protection_domain,
   211                                  Handle protection_domain,
   211                                  const ClassFileStream* cfs,
   212                                  const ClassFileStream* cfs,
   212                                  TRAPS);
   213                                  TRAPS);
   213   static DumpTimeSharedClassInfo* find_or_allocate_info_for(InstanceKlass* k);
   214   static DumpTimeSharedClassInfo* find_or_allocate_info_for(InstanceKlass* k);
   214   static void write_dictionary(RunTimeSharedDictionary* dictionary, bool is_builtin);
   215   static void write_dictionary(RunTimeSharedDictionary* dictionary,
       
   216                                bool is_builtin,
       
   217                                bool is_static_archive = true);
   215   static bool is_jfr_event_class(InstanceKlass *k);
   218   static bool is_jfr_event_class(InstanceKlass *k);
   216   static void warn_excluded(InstanceKlass* k, const char* reason);
   219   static void warn_excluded(InstanceKlass* k, const char* reason);
   217 
   220   static bool should_be_excluded(InstanceKlass* k);
   218   DEBUG_ONLY(static bool _checked_excluded_classes;)
   221 
       
   222   DEBUG_ONLY(static bool _no_class_loading_should_happen;)
   219 public:
   223 public:
   220   static InstanceKlass* find_builtin_class(Symbol* class_name);
   224   static InstanceKlass* find_builtin_class(Symbol* class_name);
   221 
   225 
   222   static const RunTimeSharedClassInfo* find_record(RunTimeSharedDictionary* dict, Symbol* name);
   226   static const RunTimeSharedClassInfo* find_record(RunTimeSharedDictionary* dict, Symbol* name);
       
   227 
       
   228   static bool has_platform_or_app_classes();
   223 
   229 
   224   // Called by PLATFORM/APP loader only
   230   // Called by PLATFORM/APP loader only
   225   static InstanceKlass* find_or_load_shared_class(Symbol* class_name,
   231   static InstanceKlass* find_or_load_shared_class(Symbol* class_name,
   226                                                Handle class_loader,
   232                                                Handle class_loader,
   227                                                TRAPS);
   233                                                TRAPS);
   286   static void check_verification_constraints(InstanceKlass* klass,
   292   static void check_verification_constraints(InstanceKlass* klass,
   287                                              TRAPS) NOT_CDS_RETURN;
   293                                              TRAPS) NOT_CDS_RETURN;
   288   static bool is_builtin(InstanceKlass* k) {
   294   static bool is_builtin(InstanceKlass* k) {
   289     return (k->shared_classpath_index() != UNREGISTERED_INDEX);
   295     return (k->shared_classpath_index() != UNREGISTERED_INDEX);
   290   }
   296   }
   291   static bool should_be_excluded(InstanceKlass* k);
       
   292   static void check_excluded_classes();
   297   static void check_excluded_classes();
   293   static void validate_before_archiving(InstanceKlass* k);
   298   static void validate_before_archiving(InstanceKlass* k);
   294   static bool is_excluded_class(InstanceKlass* k);
   299   static bool is_excluded_class(InstanceKlass* k);
   295   static void dumptime_classes_do(class MetaspaceClosure* it);
   300   static void dumptime_classes_do(class MetaspaceClosure* it);
   296   static void write_to_archive();
   301   static size_t estimate_size_for_archive();
   297   static void serialize_dictionary_headers(class SerializeClosure* soc);
   302   static void write_to_archive(bool is_static_archive = true);
   298   static void print();
   303   static void serialize_dictionary_headers(class SerializeClosure* soc,
       
   304                                            bool is_static_archive = true);
       
   305   static void print() { return print_on(tty); }
   299   static void print_on(outputStream* st) NOT_CDS_RETURN;
   306   static void print_on(outputStream* st) NOT_CDS_RETURN;
   300   static void print_table_statistics(outputStream* st) NOT_CDS_RETURN;
   307   static void print_table_statistics(outputStream* st) NOT_CDS_RETURN;
   301 
   308   static bool empty_dumptime_table() NOT_CDS_RETURN_(true);
   302   DEBUG_ONLY(static bool checked_excluded_classes() {return _checked_excluded_classes;})
   309 
       
   310   DEBUG_ONLY(static bool no_class_loading_should_happen() {return _no_class_loading_should_happen;})
       
   311 
       
   312 #ifdef ASSERT
       
   313   class NoClassLoadingMark: public StackObj {
       
   314   public:
       
   315     NoClassLoadingMark() {
       
   316       assert(!_no_class_loading_should_happen, "must not be nested");
       
   317       _no_class_loading_should_happen = true;
       
   318     }
       
   319     ~NoClassLoadingMark() {
       
   320       _no_class_loading_should_happen = false;
       
   321     }
       
   322   };
       
   323 #endif
       
   324 
   303 };
   325 };
   304 
   326 
   305 #endif // SHARE_CLASSFILE_SYSTEMDICTIONARYSHARED_HPP
   327 #endif // SHARE_CLASSFILE_SYSTEMDICTIONARYSHARED_HPP