186 static ModuleEntry* new_unnamed_module_entry(Handle module_handle, ClassLoaderData* cld);
187
188 // Note caller requires ResourceMark
189 const char* name_as_C_string() const {
190 return is_named() ? name()->as_C_string() : UNNAMED_MODULE;
191 }
192 void print(outputStream* st = tty) const;
193 void verify();
194
195 CDS_ONLY(int shared_path_index() { return _shared_path_index;})
196
197 JFR_ONLY(DEFINE_TRACE_ID_METHODS;)
198
199 #if INCLUDE_CDS_JAVA_HEAP
200 bool should_be_archived() const;
201 void iterate_symbols(MetaspaceClosure* closure);
202 ModuleEntry* allocate_archived_entry() const;
203 void init_as_archived_entry();
204 static ModuleEntry* get_archived_entry(ModuleEntry* orig_entry);
205 bool has_been_archived();
206 static Array<ModuleEntry*>* write_growable_array(GrowableArray<ModuleEntry*>* array);
207 static GrowableArray<ModuleEntry*>* restore_growable_array(Array<ModuleEntry*>* archived_array);
208 void load_from_archive(ClassLoaderData* loader_data);
209 void restore_archived_oops(ClassLoaderData* loader_data);
210 void clear_archived_oops();
211 static void verify_archived_module_entries() PRODUCT_RETURN;
212 #endif
213 };
214
215 // Iterator interface
216 class ModuleClosure: public StackObj {
217 public:
218 virtual void do_module(ModuleEntry* module) = 0;
219 };
220
221
222 // The ModuleEntryTable is a Hashtable containing a list of all modules defined
223 // by a particular class loader. Each module is represented as a ModuleEntry node.
224 //
225 // Each ModuleEntryTable contains a _javabase_module field which allows for the
226 // creation of java.base's ModuleEntry very early in bootstrapping before the
|
186 static ModuleEntry* new_unnamed_module_entry(Handle module_handle, ClassLoaderData* cld);
187
188 // Note caller requires ResourceMark
189 const char* name_as_C_string() const {
190 return is_named() ? name()->as_C_string() : UNNAMED_MODULE;
191 }
192 void print(outputStream* st = tty) const;
193 void verify();
194
195 CDS_ONLY(int shared_path_index() { return _shared_path_index;})
196
197 JFR_ONLY(DEFINE_TRACE_ID_METHODS;)
198
199 #if INCLUDE_CDS_JAVA_HEAP
200 bool should_be_archived() const;
201 void iterate_symbols(MetaspaceClosure* closure);
202 ModuleEntry* allocate_archived_entry() const;
203 void init_as_archived_entry();
204 static ModuleEntry* get_archived_entry(ModuleEntry* orig_entry);
205 bool has_been_archived();
206 static Array<ModuleEntry*>* write_growable_array(ModuleEntry* module, GrowableArray<ModuleEntry*>* array);
207 static GrowableArray<ModuleEntry*>* restore_growable_array(Array<ModuleEntry*>* archived_array);
208 void load_from_archive(ClassLoaderData* loader_data);
209 void restore_archived_oops(ClassLoaderData* loader_data);
210 void clear_archived_oops();
211 static void verify_archived_module_entries() PRODUCT_RETURN;
212 #endif
213 };
214
215 // Iterator interface
216 class ModuleClosure: public StackObj {
217 public:
218 virtual void do_module(ModuleEntry* module) = 0;
219 };
220
221
222 // The ModuleEntryTable is a Hashtable containing a list of all modules defined
223 // by a particular class loader. Each module is represented as a ModuleEntry node.
224 //
225 // Each ModuleEntryTable contains a _javabase_module field which allows for the
226 // creation of java.base's ModuleEntry very early in bootstrapping before the
|