mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8206115: Use shared macros for JavaClasses::compute_offsets and MetaspaceShared::serialize_well_known_classes
Added BASIC_JAVA_CLASSES_DO in javaClasses.hpp Reviewed-by: jiangli, redestad, coleenp
This commit is contained in:
parent
efa05e1c62
commit
e12ee81ff0
4 changed files with 136 additions and 157 deletions
|
@ -47,6 +47,52 @@
|
|||
// correspondingly. The names in the enums must be identical to the actual field
|
||||
// names in order for the verification code to work.
|
||||
|
||||
#define BASIC_JAVA_CLASSES_DO_PART1(f) \
|
||||
f(java_lang_Class) \
|
||||
f(java_lang_String) \
|
||||
//end
|
||||
|
||||
#define BASIC_JAVA_CLASSES_DO_PART2(f) \
|
||||
f(java_lang_System) \
|
||||
f(java_lang_ClassLoader) \
|
||||
f(java_lang_Throwable) \
|
||||
f(java_lang_Thread) \
|
||||
f(java_lang_ThreadGroup) \
|
||||
f(java_lang_AssertionStatusDirectives) \
|
||||
f(java_lang_ref_SoftReference) \
|
||||
f(java_lang_invoke_MethodHandle) \
|
||||
f(java_lang_invoke_DirectMethodHandle) \
|
||||
f(java_lang_invoke_MemberName) \
|
||||
f(java_lang_invoke_ResolvedMethodName) \
|
||||
f(java_lang_invoke_LambdaForm) \
|
||||
f(java_lang_invoke_MethodType) \
|
||||
f(java_lang_invoke_CallSite) \
|
||||
f(java_lang_invoke_MethodHandleNatives_CallSiteContext) \
|
||||
f(java_security_AccessControlContext) \
|
||||
f(java_lang_reflect_AccessibleObject) \
|
||||
f(java_lang_reflect_Method) \
|
||||
f(java_lang_reflect_Constructor) \
|
||||
f(java_lang_reflect_Field) \
|
||||
f(java_nio_Buffer) \
|
||||
f(reflect_ConstantPool) \
|
||||
f(reflect_UnsafeStaticFieldAccessorImpl) \
|
||||
f(java_lang_reflect_Parameter) \
|
||||
f(java_lang_Module) \
|
||||
f(java_lang_StackTraceElement) \
|
||||
f(java_lang_StackFrameInfo) \
|
||||
f(java_lang_LiveStackFrameInfo) \
|
||||
f(java_util_concurrent_locks_AbstractOwnableSynchronizer) \
|
||||
f(jdk_internal_module_ArchivedModuleGraph) \
|
||||
f(java_lang_Integer_IntegerCache) \
|
||||
f(java_lang_module_Configuration) \
|
||||
f(java_util_ImmutableCollections_ListN) \
|
||||
f(java_util_ImmutableCollections_MapN) \
|
||||
f(java_util_ImmutableCollections_SetN) \
|
||||
//end
|
||||
|
||||
#define BASIC_JAVA_CLASSES_DO(f) \
|
||||
BASIC_JAVA_CLASSES_DO_PART1(f) \
|
||||
BASIC_JAVA_CLASSES_DO_PART2(f)
|
||||
|
||||
// Interface to java.lang.String objects
|
||||
|
||||
|
@ -71,7 +117,7 @@ class java_lang_String : AllStatic {
|
|||
};
|
||||
|
||||
static void compute_offsets();
|
||||
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
|
||||
// Instance creation
|
||||
static Handle create_from_unicode(jchar* unicode, int len, TRAPS);
|
||||
|
@ -224,7 +270,7 @@ class java_lang_Class : AllStatic {
|
|||
static oop create_basic_type_mirror(const char* basic_type_name, BasicType type, TRAPS);
|
||||
|
||||
// Archiving
|
||||
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
static void archive_basic_type_mirrors(TRAPS) NOT_CDS_JAVA_HEAP_RETURN;
|
||||
static oop archive_mirror(Klass* k, TRAPS) NOT_CDS_JAVA_HEAP_RETURN_(NULL);
|
||||
static oop process_archived_mirror(Klass* k, oop mirror, oop archived_mirror, Thread *THREAD)
|
||||
|
@ -317,7 +363,7 @@ class java_lang_Thread : AllStatic {
|
|||
static void compute_offsets();
|
||||
|
||||
public:
|
||||
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
|
||||
// Instance creation
|
||||
static oop create();
|
||||
|
@ -419,7 +465,7 @@ class java_lang_ThreadGroup : AllStatic {
|
|||
static void compute_offsets();
|
||||
|
||||
public:
|
||||
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
|
||||
// parent ThreadGroup
|
||||
static oop parent(oop java_thread_group);
|
||||
|
@ -500,7 +546,7 @@ class java_lang_Throwable: AllStatic {
|
|||
static void print_stack_usage(Handle stream);
|
||||
|
||||
static void compute_offsets();
|
||||
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
|
||||
// Allocate space for backtrace (created but stack trace not filled in)
|
||||
static void allocate_backtrace(Handle throwable, TRAPS);
|
||||
|
@ -531,7 +577,7 @@ class java_lang_reflect_AccessibleObject: AllStatic {
|
|||
static void compute_offsets();
|
||||
|
||||
public:
|
||||
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
|
||||
// Accessors
|
||||
static jboolean override(oop reflect);
|
||||
|
@ -564,7 +610,7 @@ class java_lang_reflect_Method : public java_lang_reflect_AccessibleObject {
|
|||
static void compute_offsets();
|
||||
|
||||
public:
|
||||
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
|
||||
// Allocation
|
||||
static Handle create(TRAPS);
|
||||
|
@ -635,7 +681,7 @@ class java_lang_reflect_Constructor : public java_lang_reflect_AccessibleObject
|
|||
static void compute_offsets();
|
||||
|
||||
public:
|
||||
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
|
||||
// Allocation
|
||||
static Handle create(TRAPS);
|
||||
|
@ -695,7 +741,7 @@ class java_lang_reflect_Field : public java_lang_reflect_AccessibleObject {
|
|||
static void compute_offsets();
|
||||
|
||||
public:
|
||||
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
|
||||
// Allocation
|
||||
static Handle create(TRAPS);
|
||||
|
@ -752,7 +798,7 @@ class java_lang_reflect_Parameter {
|
|||
static void compute_offsets();
|
||||
|
||||
public:
|
||||
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
|
||||
// Allocation
|
||||
static Handle create(TRAPS);
|
||||
|
@ -784,7 +830,7 @@ class java_lang_Module {
|
|||
static void compute_offsets();
|
||||
|
||||
public:
|
||||
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
|
||||
// Allocation
|
||||
static Handle create(Handle loader, Handle module_name, TRAPS);
|
||||
|
@ -815,7 +861,7 @@ class reflect_ConstantPool {
|
|||
static void compute_offsets();
|
||||
|
||||
public:
|
||||
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
|
||||
// Allocation
|
||||
static Handle create(TRAPS);
|
||||
|
@ -839,7 +885,7 @@ class reflect_UnsafeStaticFieldAccessorImpl {
|
|||
static void compute_offsets();
|
||||
|
||||
public:
|
||||
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
|
||||
static int base_offset() {
|
||||
return _base_offset;
|
||||
|
@ -944,7 +990,7 @@ class java_lang_ref_SoftReference: public java_lang_ref_Reference {
|
|||
static void set_clock(jlong value);
|
||||
|
||||
static void compute_offsets();
|
||||
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
};
|
||||
|
||||
// Interface to java.lang.invoke.MethodHandle objects
|
||||
|
@ -961,7 +1007,7 @@ class java_lang_invoke_MethodHandle: AllStatic {
|
|||
static void compute_offsets();
|
||||
|
||||
public:
|
||||
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
|
||||
// Accessors
|
||||
static oop type(oop mh);
|
||||
|
@ -992,7 +1038,7 @@ class java_lang_invoke_DirectMethodHandle: AllStatic {
|
|||
static void compute_offsets();
|
||||
|
||||
public:
|
||||
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
|
||||
// Accessors
|
||||
static oop member(oop mh);
|
||||
|
@ -1019,7 +1065,7 @@ class java_lang_invoke_LambdaForm: AllStatic {
|
|||
static void compute_offsets();
|
||||
|
||||
public:
|
||||
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
|
||||
// Accessors
|
||||
static oop vmentry(oop lform);
|
||||
|
@ -1052,7 +1098,7 @@ class java_lang_invoke_ResolvedMethodName : AllStatic {
|
|||
|
||||
static void compute_offsets();
|
||||
public:
|
||||
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
|
||||
static int vmtarget_offset_in_bytes() { return _vmtarget_offset; }
|
||||
|
||||
|
@ -1091,7 +1137,7 @@ class java_lang_invoke_MemberName: AllStatic {
|
|||
static void compute_offsets();
|
||||
|
||||
public:
|
||||
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
// Accessors
|
||||
static oop clazz(oop mname);
|
||||
static void set_clazz(oop mname, oop clazz);
|
||||
|
@ -1156,7 +1202,7 @@ class java_lang_invoke_MethodType: AllStatic {
|
|||
static void compute_offsets();
|
||||
|
||||
public:
|
||||
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
// Accessors
|
||||
static oop rtype(oop mt);
|
||||
static objArrayOop ptypes(oop mt);
|
||||
|
@ -1192,7 +1238,7 @@ private:
|
|||
static void compute_offsets();
|
||||
|
||||
public:
|
||||
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
// Accessors
|
||||
static oop target( oop site);
|
||||
static void set_target( oop site, oop target);
|
||||
|
@ -1226,7 +1272,7 @@ private:
|
|||
static void compute_offsets();
|
||||
|
||||
public:
|
||||
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
// Accessors
|
||||
static DependencyContext vmdependencies(oop context);
|
||||
|
||||
|
@ -1250,7 +1296,7 @@ class java_security_AccessControlContext: AllStatic {
|
|||
|
||||
static void compute_offsets();
|
||||
public:
|
||||
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
static oop create(objArrayHandle context, bool isPrivileged, Handle privileged_context, TRAPS);
|
||||
|
||||
static bool is_authorized(Handle context);
|
||||
|
@ -1277,7 +1323,7 @@ class java_lang_ClassLoader : AllStatic {
|
|||
|
||||
public:
|
||||
static void compute_offsets();
|
||||
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
|
||||
static ClassLoaderData* loader_data(oop loader);
|
||||
static ClassLoaderData* cmpxchg_loader_data(ClassLoaderData* new_data, oop loader, ClassLoaderData* expected_data);
|
||||
|
@ -1330,7 +1376,7 @@ class java_lang_System : AllStatic {
|
|||
static bool has_security_manager();
|
||||
|
||||
static void compute_offsets();
|
||||
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
|
||||
// Debugging
|
||||
friend class JavaClasses;
|
||||
|
@ -1368,7 +1414,7 @@ class java_lang_StackTraceElement: AllStatic {
|
|||
int version, int bci, Symbol* name, TRAPS);
|
||||
|
||||
static void compute_offsets();
|
||||
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
|
||||
// Debugging
|
||||
friend class JavaClasses;
|
||||
|
@ -1412,7 +1458,7 @@ public:
|
|||
static void set_version(oop info, short value);
|
||||
|
||||
static void compute_offsets();
|
||||
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
|
||||
static void to_stack_trace_element(Handle stackFrame, Handle stack_trace_element, TRAPS);
|
||||
|
||||
|
@ -1434,7 +1480,7 @@ class java_lang_LiveStackFrameInfo: AllStatic {
|
|||
static void set_mode(oop info, int value);
|
||||
|
||||
static void compute_offsets();
|
||||
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
|
||||
// Debugging
|
||||
friend class JavaClasses;
|
||||
|
@ -1459,7 +1505,7 @@ class java_lang_AssertionStatusDirectives: AllStatic {
|
|||
static void set_deflt(oop obj, bool val);
|
||||
|
||||
static void compute_offsets();
|
||||
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
|
||||
// Debugging
|
||||
friend class JavaClasses;
|
||||
|
@ -1473,7 +1519,7 @@ class java_nio_Buffer: AllStatic {
|
|||
public:
|
||||
static int limit_offset();
|
||||
static void compute_offsets();
|
||||
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
};
|
||||
|
||||
class java_util_concurrent_locks_AbstractOwnableSynchronizer : AllStatic {
|
||||
|
@ -1482,7 +1528,7 @@ class java_util_concurrent_locks_AbstractOwnableSynchronizer : AllStatic {
|
|||
public:
|
||||
static void compute_offsets();
|
||||
static oop get_owner_threadObj(oop obj);
|
||||
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
};
|
||||
|
||||
class java_lang_Integer_IntegerCache: AllStatic {
|
||||
|
@ -1491,7 +1537,7 @@ class java_lang_Integer_IntegerCache: AllStatic {
|
|||
public:
|
||||
static int archivedCache_offset() { return _archivedCache_offset; }
|
||||
static void compute_offsets();
|
||||
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
};
|
||||
|
||||
class jdk_internal_module_ArchivedModuleGraph: AllStatic {
|
||||
|
@ -1506,7 +1552,7 @@ class jdk_internal_module_ArchivedModuleGraph: AllStatic {
|
|||
static int archivedMainModule_offset() { return _archivedMainModule_offset; }
|
||||
static int archivedConfiguration_offset() { return _archivedConfiguration_offset; }
|
||||
static void compute_offsets();
|
||||
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
};
|
||||
|
||||
class java_lang_module_Configuration: AllStatic {
|
||||
|
@ -1515,7 +1561,7 @@ class java_lang_module_Configuration: AllStatic {
|
|||
public:
|
||||
static int EMPTY_CONFIGURATION_offset() { return _EMPTY_CONFIGURATION_offset; }
|
||||
static void compute_offsets();
|
||||
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
};
|
||||
|
||||
class java_util_ImmutableCollections_ListN : AllStatic {
|
||||
|
@ -1524,7 +1570,7 @@ class java_util_ImmutableCollections_ListN : AllStatic {
|
|||
public:
|
||||
static int EMPTY_LIST_offset() { return _EMPTY_LIST_offset; }
|
||||
static void compute_offsets();
|
||||
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
};
|
||||
|
||||
class java_util_ImmutableCollections_SetN : AllStatic {
|
||||
|
@ -1533,7 +1579,7 @@ class java_util_ImmutableCollections_SetN : AllStatic {
|
|||
public:
|
||||
static int EMPTY_SET_offset() { return _EMPTY_SET_offset; }
|
||||
static void compute_offsets();
|
||||
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
};
|
||||
|
||||
class java_util_ImmutableCollections_MapN : AllStatic {
|
||||
|
@ -1542,7 +1588,7 @@ class java_util_ImmutableCollections_MapN : AllStatic {
|
|||
public:
|
||||
static int EMPTY_MAP_offset() { return _EMPTY_MAP_offset; }
|
||||
static void compute_offsets();
|
||||
static void serialize(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
|
||||
};
|
||||
|
||||
// Use to declare fields that need to be injected into Java classes
|
||||
|
@ -1605,7 +1651,7 @@ class JavaClasses : AllStatic {
|
|||
static void compute_hard_coded_offsets();
|
||||
static void compute_offsets();
|
||||
static void check_offsets() PRODUCT_RETURN;
|
||||
|
||||
static void serialize_offsets(SerializeClosure* soc) NOT_CDS_RETURN;
|
||||
static InjectedField* get_injected(Symbol* class_name, int* field_count);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue