mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8142968: Module System implementation
Initial integration of JEP 200, JEP 260, JEP 261, and JEP 282 Co-authored-by: Alex Buckley <alex.buckley@oracle.com> Co-authored-by: Jonathan Gibbons <jonathan.gibbons@oracle.com> Co-authored-by: Karen Kinnear <karen.kinnear@oracle.com> Co-authored-by: Mandy Chung <mandy.chung@oracle.com> Co-authored-by: Mark Reinhold <mark.reinhold@oracle.com> Co-authored-by: Harold Seigel <harold.seigel@oracle.com> Co-authored-by: Lois Foltan <lois.foltan@oracle.com> Co-authored-by: Calvin Cheung <calvin.cheung@oracle.com> Co-authored-by: Christian Tornqvist <christian.tornqvist@oracle.com> Co-authored-by: Erik Joelsson <erik.joelsson@oracle.com> Co-authored-by: George Triantafillou <george.triantafillou@oracle.com> Co-authored-by: Igor Ignatyev <igor.ignatyev@oracle.com> Co-authored-by: Ioi Lam <ioi.lam@oracle.com> Co-authored-by: James Laskey <james.laskey@oracle.com> Co-authored-by: Jean-Francois Denise <jean-francois.denise@oracle.com> Co-authored-by: Jiangli Zhou <jiangli.zhou@oracle.com> Co-authored-by: Markus Gronlund <markus.gronlund@oracle.com> Co-authored-by: Serguei Spitsyn <serguei.spitsyn@oracle.com> Co-authored-by: Staffan Larsen <staffan.larsen@oracle.com> Co-authored-by: Sundararajan Athijegannathan <sundararajan.athijegannathan@oracle.com> Reviewed-by: acorn, ccheung, coleenp, ctornqvi, dholmes, dsimms, gtriantafill, iklam, jiangli, mgronlun, mseledtsov, cjplummer, sspitsyn, stefank, twisti, hseigel, lfoltan, alanb, mchung, dfazunen
This commit is contained in:
parent
007b0fa3db
commit
f30fc1c88b
297 changed files with 15848 additions and 2302 deletions
|
@ -210,12 +210,14 @@ class java_lang_Class : AllStatic {
|
|||
static int _init_lock_offset;
|
||||
static int _signers_offset;
|
||||
static int _class_loader_offset;
|
||||
static int _module_offset;
|
||||
static int _component_mirror_offset;
|
||||
|
||||
static bool offsets_computed;
|
||||
static int classRedefinedCount_offset;
|
||||
|
||||
static GrowableArray<Klass*>* _fixup_mirror_list;
|
||||
static GrowableArray<Klass*>* _fixup_module_field_list;
|
||||
|
||||
static void set_init_lock(oop java_class, oop init_lock);
|
||||
static void set_protection_domain(oop java_class, oop protection_domain);
|
||||
|
@ -226,10 +228,13 @@ class java_lang_Class : AllStatic {
|
|||
static void compute_offsets();
|
||||
|
||||
// Instance creation
|
||||
static void create_mirror(KlassHandle k, Handle class_loader,
|
||||
static void create_mirror(KlassHandle k, Handle class_loader, Handle module,
|
||||
Handle protection_domain, TRAPS);
|
||||
static void fixup_mirror(KlassHandle k, TRAPS);
|
||||
static oop create_basic_type_mirror(const char* basic_type_name, BasicType type, TRAPS);
|
||||
|
||||
static void fixup_module_field(KlassHandle k, Handle module);
|
||||
|
||||
// Conversion
|
||||
static Klass* as_Klass(oop java_class);
|
||||
static void set_klass(oop java_class, Klass* klass);
|
||||
|
@ -267,18 +272,29 @@ class java_lang_Class : AllStatic {
|
|||
static void set_signers(oop java_class, objArrayOop signers);
|
||||
|
||||
static oop class_loader(oop java_class);
|
||||
static void set_module(oop java_class, oop module);
|
||||
static oop module(oop java_class);
|
||||
|
||||
static int oop_size(oop java_class);
|
||||
static void set_oop_size(oop java_class, int size);
|
||||
static int static_oop_field_count(oop java_class);
|
||||
static void set_static_oop_field_count(oop java_class, int size);
|
||||
|
||||
|
||||
static GrowableArray<Klass*>* fixup_mirror_list() {
|
||||
return _fixup_mirror_list;
|
||||
}
|
||||
static void set_fixup_mirror_list(GrowableArray<Klass*>* v) {
|
||||
_fixup_mirror_list = v;
|
||||
}
|
||||
|
||||
static GrowableArray<Klass*>* fixup_module_field_list() {
|
||||
return _fixup_module_field_list;
|
||||
}
|
||||
static void set_fixup_module_field_list(GrowableArray<Klass*>* v) {
|
||||
_fixup_module_field_list = v;
|
||||
}
|
||||
|
||||
// Debugging
|
||||
friend class JavaClasses;
|
||||
friend class InstanceKlass; // verification code accesses offsets
|
||||
|
@ -758,6 +774,39 @@ class java_lang_reflect_Parameter {
|
|||
friend class JavaClasses;
|
||||
};
|
||||
|
||||
#define MODULE_INJECTED_FIELDS(macro) \
|
||||
macro(java_lang_reflect_Module, module_entry, intptr_signature, false)
|
||||
|
||||
class java_lang_reflect_Module {
|
||||
private:
|
||||
static int loader_offset;
|
||||
static int name_offset;
|
||||
static int _module_entry_offset;
|
||||
static void compute_offsets();
|
||||
|
||||
public:
|
||||
// Allocation
|
||||
static Handle create(Handle loader, Handle module_name, TRAPS);
|
||||
|
||||
// Testers
|
||||
static bool is_subclass(Klass* klass) {
|
||||
return klass->is_subclass_of(SystemDictionary::reflect_Module_klass());
|
||||
}
|
||||
static bool is_instance(oop obj);
|
||||
|
||||
// Accessors
|
||||
static oop loader(oop module);
|
||||
static void set_loader(oop module, oop value);
|
||||
|
||||
static oop name(oop module);
|
||||
static void set_name(oop module, oop value);
|
||||
|
||||
static ModuleEntry* module_entry(oop module, TRAPS);
|
||||
static void set_module_entry(oop module, ModuleEntry* module_entry);
|
||||
|
||||
friend class JavaClasses;
|
||||
};
|
||||
|
||||
// Interface to sun.reflect.ConstantPool objects
|
||||
class sun_reflect_ConstantPool {
|
||||
private:
|
||||
|
@ -1203,6 +1252,7 @@ class java_lang_ClassLoader : AllStatic {
|
|||
static bool offsets_computed;
|
||||
static int parent_offset;
|
||||
static int parallelCapable_offset;
|
||||
static int unnamedModule_offset;
|
||||
|
||||
public:
|
||||
static void compute_offsets();
|
||||
|
@ -1227,6 +1277,8 @@ class java_lang_ClassLoader : AllStatic {
|
|||
}
|
||||
static bool is_instance(oop obj);
|
||||
|
||||
static oop unnamedModule(oop loader);
|
||||
|
||||
// Debugging
|
||||
friend class JavaClasses;
|
||||
friend class ClassFileParser; // access to number_of_fake_fields
|
||||
|
@ -1266,12 +1318,16 @@ class java_lang_System : AllStatic {
|
|||
class java_lang_StackTraceElement: AllStatic {
|
||||
private:
|
||||
enum {
|
||||
hc_declaringClass_offset = 0,
|
||||
hc_methodName_offset = 1,
|
||||
hc_fileName_offset = 2,
|
||||
hc_lineNumber_offset = 3
|
||||
hc_moduleName_offset = 0,
|
||||
hc_moduleVersion_offset = 1,
|
||||
hc_declaringClass_offset = 2,
|
||||
hc_methodName_offset = 3,
|
||||
hc_fileName_offset = 4,
|
||||
hc_lineNumber_offset = 5
|
||||
};
|
||||
|
||||
static int moduleName_offset;
|
||||
static int moduleVersion_offset;
|
||||
static int declaringClass_offset;
|
||||
static int methodName_offset;
|
||||
static int fileName_offset;
|
||||
|
@ -1279,6 +1335,8 @@ class java_lang_StackTraceElement: AllStatic {
|
|||
|
||||
public:
|
||||
// Setters
|
||||
static void set_moduleName(oop element, oop value);
|
||||
static void set_moduleVersion(oop element, oop value);
|
||||
static void set_declaringClass(oop element, oop value);
|
||||
static void set_methodName(oop element, oop value);
|
||||
static void set_fileName(oop element, oop value);
|
||||
|
@ -1456,8 +1514,8 @@ class InjectedField {
|
|||
CLASSLOADER_INJECTED_FIELDS(macro) \
|
||||
MEMBERNAME_INJECTED_FIELDS(macro) \
|
||||
CALLSITECONTEXT_INJECTED_FIELDS(macro) \
|
||||
STACKFRAMEINFO_INJECTED_FIELDS(macro)
|
||||
|
||||
STACKFRAMEINFO_INJECTED_FIELDS(macro) \
|
||||
MODULE_INJECTED_FIELDS(macro)
|
||||
|
||||
// Interface to hard-coded offset checking
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue