16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_CLASSFILE_MODULES_HPP
26 #define SHARE_CLASSFILE_MODULES_HPP
27
28 #include "memory/allStatic.hpp"
29 #include "runtime/handles.hpp"
30
31 class ModuleEntryTable;
32 class SerializeClosure;
33 class Symbol;
34
35 class Modules : AllStatic {
36 static void check_cds_restrictions(TRAPS) NOT_CDS_JAVA_HEAP_RETURN;
37
38 public:
39 // define_module defines a module containing the specified packages. It binds the
40 // module to its class loader by creating the ModuleEntry record in the
41 // ClassLoader's ModuleEntry table, and creates PackageEntry records in the class
42 // loader's PackageEntry table. The jstring for all package names will convert "."
43 // to "/"
44 //
45 // IllegalArgumentExceptions are thrown for the following :
46 // * Module's Class loader is not a subclass of java.lang.ClassLoader
47 // * Module's Class loader already has a module with that name
48 // * Module's Class loader has already defined types for any of the module's packages
49 // * Module_name is syntactically bad
50 // * Packages contains an illegal package name or a non-String object
51 // * A package already exists in another module for this class loader
52 // * Module is an unnamed module
53 // NullPointerExceptions are thrown if module is null.
54 static void define_module(Handle module, jboolean is_open, jstring version,
55 jstring location, jobjectArray packages, TRAPS);
56
57 static void check_archived_module_oop(oop orig_module_obj) NOT_CDS_JAVA_HEAP_RETURN;
58 static void define_archived_modules(Handle h_platform_loader, Handle h_system_loader,
59 TRAPS) NOT_CDS_JAVA_HEAP_RETURN;
60 static void init_archived_modules(JavaThread* current, Handle h_platform_loader, Handle h_system_loader)
61 NOT_CDS_JAVA_HEAP_RETURN;
62 static void verify_archived_modules() NOT_CDS_JAVA_HEAP_RETURN;
63 static void dump_archived_module_info() NOT_CDS_JAVA_HEAP_RETURN;
64 static void serialize_archived_module_info(SerializeClosure* soc) NOT_CDS_JAVA_HEAP_RETURN;
65
66 #if INCLUDE_CDS_JAVA_HEAP
67 private:
68 class ArchivedProperty;
69
70 static ArchivedProperty _archived_props[];
71 static constexpr size_t num_archived_props();
72 static ArchivedProperty& archived_prop(size_t i);
73 public:
74 #endif
75
76 // Provides the java.lang.Module for the unnamed module defined
77 // to the boot loader.
78 //
79 // IllegalArgumentExceptions are thrown for the following :
80 // * Module has a name
81 // * Module is not a subclass of java.lang.Module
82 // * Module's class loader is not the boot loader
83 // NullPointerExceptions are thrown if module is null.
84 static void set_bootloader_unnamed_module(Handle module, TRAPS);
85
|
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_CLASSFILE_MODULES_HPP
26 #define SHARE_CLASSFILE_MODULES_HPP
27
28 #include "memory/allStatic.hpp"
29 #include "runtime/handles.hpp"
30
31 class ModuleEntryTable;
32 class SerializeClosure;
33 class Symbol;
34
35 class Modules : AllStatic {
36 static void check_cds_restrictions(Handle module1, Handle module2, TRAPS) NOT_CDS_JAVA_HEAP_RETURN;
37
38 public:
39 // define_module defines a module containing the specified packages. It binds the
40 // module to its class loader by creating the ModuleEntry record in the
41 // ClassLoader's ModuleEntry table, and creates PackageEntry records in the class
42 // loader's PackageEntry table. The jstring for all package names will convert "."
43 // to "/"
44 //
45 // IllegalArgumentExceptions are thrown for the following :
46 // * Module's Class loader is not a subclass of java.lang.ClassLoader
47 // * Module's Class loader already has a module with that name
48 // * Module's Class loader has already defined types for any of the module's packages
49 // * Module_name is syntactically bad
50 // * Packages contains an illegal package name or a non-String object
51 // * A package already exists in another module for this class loader
52 // * Module is an unnamed module
53 // NullPointerExceptions are thrown if module is null.
54 static void define_module(Handle module, jboolean is_open, jstring version,
55 jstring location, jobjectArray packages, TRAPS);
56
57 static void check_archived_module_oop(oop orig_module_obj) NOT_CDS_JAVA_HEAP_RETURN;
58 static void define_archived_modules(Handle h_platform_loader, Handle h_system_loader,
59 TRAPS) NOT_CDS_JAVA_HEAP_RETURN;
60 static void init_archived_modules(JavaThread* current, Handle h_platform_loader, Handle h_system_loader)
61 NOT_CDS_JAVA_HEAP_RETURN;
62 static void verify_archived_modules() NOT_CDS_JAVA_HEAP_RETURN;
63 static void dump_archived_module_info() NOT_CDS_JAVA_HEAP_RETURN;
64 static void serialize_archived_module_info(SerializeClosure* soc) NOT_CDS_JAVA_HEAP_RETURN;
65
66 static bool is_dynamic_proxy_module(Handle module);
67 static bool is_dynamic_proxy_module(ModuleEntry* module_entry);
68
69 static void check_archived_flag_consistency(char* archived_flag, const char* runtime_flag, const char* property) NOT_CDS_JAVA_HEAP_RETURN;
70
71 #if INCLUDE_CDS_JAVA_HEAP
72 private:
73 class ArchivedProperty;
74
75 static ArchivedProperty _archived_props[];
76 static constexpr size_t num_archived_props();
77 static ArchivedProperty& archived_prop(size_t i);
78 public:
79 #endif
80
81 // Provides the java.lang.Module for the unnamed module defined
82 // to the boot loader.
83 //
84 // IllegalArgumentExceptions are thrown for the following :
85 // * Module has a name
86 // * Module is not a subclass of java.lang.Module
87 // * Module's class loader is not the boot loader
88 // NullPointerExceptions are thrown if module is null.
89 static void set_bootloader_unnamed_module(Handle module, TRAPS);
90
|