< prev index next >
src/hotspot/share/classfile/moduleEntry.hpp
Print this page
@@ -45,10 +45,11 @@
#define JAVAPKG "java"
#define JAVAPKG_LEN 4
#define JAVA_BASE_NAME "java.base"
#define JAVA_BASE_NAME_LEN 9
+template <class T> class Array;
class ModuleClosure;
// A ModuleEntry describes a module that has been defined by a call to JVM_DefineModule.
// It contains:
// - Symbol* containing the module's name.
@@ -61,11 +62,11 @@
// The Mutex Module_lock is shared between ModuleEntry and PackageEntry, to lock either
// data structure.
class ModuleEntry : public HashtableEntry<Symbol*, mtModule> {
private:
OopHandle _module; // java.lang.Module
- OopHandle _pd; // java.security.ProtectionDomain, cached
+ OopHandle _shared_pd; // java.security.ProtectionDomain, cached
// for shared classes from this module
ClassLoaderData* _loader_data;
GrowableArray<ModuleEntry*>* _reads; // list of modules that are readable by this module
Symbol* _version; // module version number
Symbol* _location; // module location
@@ -73,17 +74,19 @@
bool _can_read_all_unnamed;
bool _has_default_read_edges; // JVMTI redefine/retransform support
bool _must_walk_reads; // walk module's reads list at GC safepoints to purge out dead modules
bool _is_open; // whether the packages in the module are all unqualifiedly exported
bool _is_patched; // whether the module is patched via --patch-module
+ CDS_JAVA_HEAP_ONLY(narrowOop _archived_module_narrow_oop;)
+
JFR_ONLY(DEFINE_TRACE_ID_FIELD;)
enum {MODULE_READS_SIZE = 101}; // Initial size of list of modules that the module can read.
public:
void init() {
_module = OopHandle();
- _pd = OopHandle();
+ _shared_pd = OopHandle();
_loader_data = NULL;
_reads = NULL;
_version = NULL;
_location = NULL;
_can_read_all_unnamed = false;
@@ -186,10 +189,21 @@
void verify();
CDS_ONLY(int shared_path_index() { return _shared_path_index;})
JFR_ONLY(DEFINE_TRACE_ID_METHODS;)
+
+#if INCLUDE_CDS_JAVA_HEAP
+ ModuleEntry* allocate_archived_entry() const;
+ void init_as_archived_entry();
+ void init_archived_oops();
+ static ModuleEntry* get_archived_entry(ModuleEntry* orig_entry);
+ static Array<ModuleEntry*>* write_archived_entry_array(GrowableArray<ModuleEntry*>* array);
+ static GrowableArray<ModuleEntry*>* read_archived_entry_array(Array<ModuleEntry*>* archived_array);
+ void load_from_archive(ClassLoaderData* loader_data);
+ void restore_archive_oops(ClassLoaderData* loader_data);
+#endif
};
// Iterator interface
class ModuleClosure: public StackObj {
public:
@@ -268,8 +282,18 @@
static void finalize_javabase(Handle module_handle, Symbol* version, Symbol* location);
static void patch_javabase_entries(Handle module_handle);
void print(outputStream* st = tty);
void verify();
+
+#if INCLUDE_CDS_JAVA_HEAP
+ Array<ModuleEntry*>* allocate_archived_entries();
+ void init_archived_entries(Array<ModuleEntry*>* archived_modules);
+ void init_archived_oops(Array<ModuleEntry*>* archived_modules);
+ void load_archived_entries(ClassLoaderData* loader_data,
+ Array<ModuleEntry*>* archived_modules);
+ void restore_archived_oops(ClassLoaderData* loader_data,
+ Array<ModuleEntry*>* archived_modules);
+#endif
};
#endif // SHARE_CLASSFILE_MODULEENTRY_HPP
< prev index next >