equal
deleted
inserted
replaced
30 #include "classfile/vmSymbols.hpp" |
30 #include "classfile/vmSymbols.hpp" |
31 #include "oops/oopHandle.hpp" |
31 #include "oops/oopHandle.hpp" |
32 #include "oops/symbol.hpp" |
32 #include "oops/symbol.hpp" |
33 #include "runtime/jniHandles.hpp" |
33 #include "runtime/jniHandles.hpp" |
34 #include "runtime/mutexLocker.hpp" |
34 #include "runtime/mutexLocker.hpp" |
35 #include "trace/traceMacros.hpp" |
|
36 #include "utilities/growableArray.hpp" |
35 #include "utilities/growableArray.hpp" |
37 #include "utilities/hashtable.hpp" |
36 #include "utilities/hashtable.hpp" |
|
37 #include "utilities/macros.hpp" |
38 #include "utilities/ostream.hpp" |
38 #include "utilities/ostream.hpp" |
|
39 #if INCLUDE_JFR |
|
40 #include "jfr/support/jfrTraceIdExtension.hpp" |
|
41 #endif |
39 |
42 |
40 #define UNNAMED_MODULE "Unnamed Module" |
43 #define UNNAMED_MODULE "Unnamed Module" |
41 #define JAVAPKG "java" |
44 #define JAVAPKG "java" |
42 #define JAVAPKG_LEN 4 |
45 #define JAVAPKG_LEN 4 |
43 #define JAVA_BASE_NAME "java.base" |
46 #define JAVA_BASE_NAME "java.base" |
67 bool _can_read_all_unnamed; |
70 bool _can_read_all_unnamed; |
68 bool _has_default_read_edges; // JVMTI redefine/retransform support |
71 bool _has_default_read_edges; // JVMTI redefine/retransform support |
69 bool _must_walk_reads; // walk module's reads list at GC safepoints to purge out dead modules |
72 bool _must_walk_reads; // walk module's reads list at GC safepoints to purge out dead modules |
70 bool _is_open; // whether the packages in the module are all unqualifiedly exported |
73 bool _is_open; // whether the packages in the module are all unqualifiedly exported |
71 bool _is_patched; // whether the module is patched via --patch-module |
74 bool _is_patched; // whether the module is patched via --patch-module |
72 TRACE_DEFINE_TRACE_ID_FIELD; |
75 JFR_ONLY(DEFINE_TRACE_ID_FIELD;) |
73 enum {MODULE_READS_SIZE = 101}; // Initial size of list of modules that the module can read. |
76 enum {MODULE_READS_SIZE = 101}; // Initial size of list of modules that the module can read. |
74 |
77 |
75 public: |
78 public: |
76 void init() { |
79 void init() { |
77 _module = NULL; |
80 _module = NULL; |
162 } |
165 } |
163 |
166 |
164 // iteration support for readability |
167 // iteration support for readability |
165 void module_reads_do(ModuleClosure* const f); |
168 void module_reads_do(ModuleClosure* const f); |
166 |
169 |
167 TRACE_DEFINE_TRACE_ID_METHODS; |
|
168 |
|
169 // Purge dead weak references out of reads list when any given class loader is unloaded. |
170 // Purge dead weak references out of reads list when any given class loader is unloaded. |
170 void purge_reads(); |
171 void purge_reads(); |
171 void delete_reads(); |
172 void delete_reads(); |
172 |
173 |
173 // Special handling for unnamed module, one per class loader |
174 // Special handling for unnamed module, one per class loader |
176 static ModuleEntry* new_unnamed_module_entry(Handle module_handle, ClassLoaderData* cld); |
177 static ModuleEntry* new_unnamed_module_entry(Handle module_handle, ClassLoaderData* cld); |
177 void delete_unnamed_module(); |
178 void delete_unnamed_module(); |
178 |
179 |
179 void print(outputStream* st = tty); |
180 void print(outputStream* st = tty); |
180 void verify(); |
181 void verify(); |
|
182 |
|
183 JFR_ONLY(DEFINE_TRACE_ID_METHODS;) |
181 }; |
184 }; |
182 |
185 |
183 // Iterator interface |
186 // Iterator interface |
184 class ModuleClosure: public StackObj { |
187 class ModuleClosure: public StackObj { |
185 public: |
188 public: |
186 virtual void do_module(ModuleEntry* const module) = 0; |
189 virtual void do_module(ModuleEntry* module) = 0; |
187 }; |
190 }; |
188 |
191 |
189 |
192 |
190 // The ModuleEntryTable is a Hashtable containing a list of all modules defined |
193 // The ModuleEntryTable is a Hashtable containing a list of all modules defined |
191 // by a particular class loader. Each module is represented as a ModuleEntry node. |
194 // by a particular class loader. Each module is represented as a ModuleEntry node. |