From b2a76ef91bae994a313a9bf8ee21c82baf3fad1c Mon Sep 17 00:00:00 2001 From: Francesco Andreuzzi Date: Tue, 16 Sep 2025 15:39:23 +0000 Subject: [PATCH 01/11] bring back fields --- src/hotspot/cpu/aarch64/vmStructs_aarch64.hpp | 4 +- src/hotspot/cpu/arm/vmStructs_arm.hpp | 18 ++-- src/hotspot/cpu/ppc/vmStructs_ppc.hpp | 4 +- src/hotspot/cpu/riscv/vmStructs_riscv.hpp | 4 +- src/hotspot/cpu/s390/vmStructs_s390.hpp | 4 +- src/hotspot/cpu/x86/vmStructs_x86.hpp | 4 +- src/hotspot/cpu/zero/vmStructs_zero.hpp | 4 +- src/hotspot/os/aix/vmStructs_aix.hpp | 4 +- src/hotspot/os/bsd/vmStructs_bsd.hpp | 4 +- src/hotspot/os/linux/vmStructs_linux.hpp | 4 +- src/hotspot/os/windows/vmStructs_windows.hpp | 4 +- src/hotspot/share/ci/ciClassList.hpp | 1 + src/hotspot/share/jvmci/vmStructs_jvmci.cpp | 12 +-- src/hotspot/share/opto/compile.hpp | 1 + src/hotspot/share/runtime/vmStructs.cpp | 90 ++++++++++++++++--- 15 files changed, 115 insertions(+), 47 deletions(-) diff --git a/src/hotspot/cpu/aarch64/vmStructs_aarch64.hpp b/src/hotspot/cpu/aarch64/vmStructs_aarch64.hpp index 2ec901f6a2ed9..ba3d86b21bc3b 100644 --- a/src/hotspot/cpu/aarch64/vmStructs_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/vmStructs_aarch64.hpp @@ -30,12 +30,12 @@ // constants required by the Serviceability Agent. This file is // referenced by vmStructs.cpp. -#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field) \ +#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field) \ volatile_nonstatic_field(JavaFrameAnchor, _last_Java_fp, intptr_t*) \ static_field(VM_Version, _rop_protection, bool) \ static_field(VM_Version, _pac_mask, uintptr_t) -#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type) +#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c2_toplevel_type) #define VM_INT_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant) diff --git a/src/hotspot/cpu/arm/vmStructs_arm.hpp b/src/hotspot/cpu/arm/vmStructs_arm.hpp index 453938a824e8b..9ad16c7128137 100644 --- a/src/hotspot/cpu/arm/vmStructs_arm.hpp +++ b/src/hotspot/cpu/arm/vmStructs_arm.hpp @@ -29,17 +29,17 @@ // constants required by the Serviceability Agent. This file is // referenced by vmStructs.cpp. -#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field) \ - \ - /******************************/ \ - /* JavaCallWrapper */ \ - /******************************/ \ - /******************************/ \ - /* JavaFrameAnchor */ \ - /******************************/ \ +#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field) \ + \ + /******************************/ \ + /* JavaCallWrapper */ \ + /******************************/ \ + /******************************/ \ + /* JavaFrameAnchor */ \ + /******************************/ \ volatile_nonstatic_field(JavaFrameAnchor, _last_Java_fp, intptr_t*) -#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type) +#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c2_toplevel_type) #define VM_INT_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant) diff --git a/src/hotspot/cpu/ppc/vmStructs_ppc.hpp b/src/hotspot/cpu/ppc/vmStructs_ppc.hpp index efe7fb9ad7bb3..edb02ba827f23 100644 --- a/src/hotspot/cpu/ppc/vmStructs_ppc.hpp +++ b/src/hotspot/cpu/ppc/vmStructs_ppc.hpp @@ -30,9 +30,9 @@ // constants required by the Serviceability Agent. This file is // referenced by vmStructs.cpp. -#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field) +#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field) -#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type) +#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c2_toplevel_type) #define VM_INT_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant) diff --git a/src/hotspot/cpu/riscv/vmStructs_riscv.hpp b/src/hotspot/cpu/riscv/vmStructs_riscv.hpp index ba250f7726852..45499bbb360cd 100644 --- a/src/hotspot/cpu/riscv/vmStructs_riscv.hpp +++ b/src/hotspot/cpu/riscv/vmStructs_riscv.hpp @@ -30,10 +30,10 @@ // constants required by the Serviceability Agent. This file is // referenced by vmStructs.cpp. -#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field) \ +#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field) \ volatile_nonstatic_field(JavaFrameAnchor, _last_Java_fp, intptr_t*) -#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type) +#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c2_toplevel_type) #define VM_INT_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant) diff --git a/src/hotspot/cpu/s390/vmStructs_s390.hpp b/src/hotspot/cpu/s390/vmStructs_s390.hpp index 100fc97560ecf..a7d42cff8f1e0 100644 --- a/src/hotspot/cpu/s390/vmStructs_s390.hpp +++ b/src/hotspot/cpu/s390/vmStructs_s390.hpp @@ -30,9 +30,9 @@ // constants required by the Serviceability Agent. This file is // referenced by vmStructs.cpp. -#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field) +#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field) -#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type) +#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c2_toplevel_type) #define VM_INT_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant) diff --git a/src/hotspot/cpu/x86/vmStructs_x86.hpp b/src/hotspot/cpu/x86/vmStructs_x86.hpp index b8089a6413e46..9d083fd86aa59 100644 --- a/src/hotspot/cpu/x86/vmStructs_x86.hpp +++ b/src/hotspot/cpu/x86/vmStructs_x86.hpp @@ -29,13 +29,13 @@ // constants required by the Serviceability Agent. This file is // referenced by vmStructs.cpp. -#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field) \ +#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field) \ volatile_nonstatic_field(JavaFrameAnchor, _last_Java_fp, intptr_t*) \ static_field(VM_Version, _features, VM_Version::VM_Features) \ nonstatic_field(VM_Version::VM_Features, _features_bitmap[0], uint64_t) \ static_field(VM_Version::VM_Features, _features_bitmap_size, int) -#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type) \ +#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c2_toplevel_type) \ declare_toplevel_type(VM_Version::VM_Features) #define VM_INT_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant) \ diff --git a/src/hotspot/cpu/zero/vmStructs_zero.hpp b/src/hotspot/cpu/zero/vmStructs_zero.hpp index 9100c765e7ed2..46b79bf753ffb 100644 --- a/src/hotspot/cpu/zero/vmStructs_zero.hpp +++ b/src/hotspot/cpu/zero/vmStructs_zero.hpp @@ -30,9 +30,9 @@ // constants required by the Serviceability Agent. This file is // referenced by vmStructs.cpp. -#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field) +#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field) -#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type) +#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c2_toplevel_type) #define VM_INT_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant) diff --git a/src/hotspot/os/aix/vmStructs_aix.hpp b/src/hotspot/os/aix/vmStructs_aix.hpp index c79c9477fffe6..c5c488108a065 100644 --- a/src/hotspot/os/aix/vmStructs_aix.hpp +++ b/src/hotspot/os/aix/vmStructs_aix.hpp @@ -29,14 +29,14 @@ // constants required by the Serviceability Agent. This file is // referenced by vmStructs.cpp. -#define VM_STRUCTS_OS(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field) \ +#define VM_STRUCTS_OS(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field) \ \ /******************************/ \ /* Threads (NOTE: incomplete) */ \ /******************************/ \ nonstatic_field(OSThread, _thread_id, pthread_t) \ -#define VM_TYPES_OS(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type) \ +#define VM_TYPES_OS(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c2_toplevel_type) \ \ /**********************/ \ /* Posix Thread IDs */ \ diff --git a/src/hotspot/os/bsd/vmStructs_bsd.hpp b/src/hotspot/os/bsd/vmStructs_bsd.hpp index e07f1cd7dd0cf..722b7e69b3600 100644 --- a/src/hotspot/os/bsd/vmStructs_bsd.hpp +++ b/src/hotspot/os/bsd/vmStructs_bsd.hpp @@ -31,7 +31,7 @@ // constants required by the Serviceability Agent. This file is // referenced by vmStructs.cpp. -#define VM_STRUCTS_OS(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field) \ +#define VM_STRUCTS_OS(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field) \ \ /******************************/ \ /* Threads (NOTE: incomplete) */ \ @@ -39,7 +39,7 @@ nonstatic_field(OSThread, _thread_id, OSThread::thread_id_t) \ nonstatic_field(OSThread, _unique_thread_id, uint64_t) -#define VM_TYPES_OS(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type) \ +#define VM_TYPES_OS(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c2_toplevel_type) \ \ /**********************/ \ /* Thread IDs */ \ diff --git a/src/hotspot/os/linux/vmStructs_linux.hpp b/src/hotspot/os/linux/vmStructs_linux.hpp index 90bc6517a3f3c..96e01d9c387ff 100644 --- a/src/hotspot/os/linux/vmStructs_linux.hpp +++ b/src/hotspot/os/linux/vmStructs_linux.hpp @@ -31,7 +31,7 @@ // constants required by the Serviceability Agent. This file is // referenced by vmStructs.cpp. -#define VM_STRUCTS_OS(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field) \ +#define VM_STRUCTS_OS(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field) \ \ /******************************/ \ /* Threads (NOTE: incomplete) */ \ @@ -39,7 +39,7 @@ nonstatic_field(OSThread, _thread_id, pid_t) \ nonstatic_field(OSThread, _pthread_id, pthread_t) -#define VM_TYPES_OS(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type) \ +#define VM_TYPES_OS(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c2_toplevel_type) \ \ /**********************/ \ /* Posix Thread IDs */ \ diff --git a/src/hotspot/os/windows/vmStructs_windows.hpp b/src/hotspot/os/windows/vmStructs_windows.hpp index 7d457c82fe811..5d6635424cac9 100644 --- a/src/hotspot/os/windows/vmStructs_windows.hpp +++ b/src/hotspot/os/windows/vmStructs_windows.hpp @@ -29,7 +29,7 @@ // constants required by the Serviceability Agent. This file is // referenced by vmStructs.cpp. -#define VM_STRUCTS_OS(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field) \ +#define VM_STRUCTS_OS(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field) \ \ /******************************/ \ /* Threads (NOTE: incomplete) */ \ @@ -38,7 +38,7 @@ nonstatic_field(OSThread, _thread_id, OSThread::thread_id_t) \ unchecked_nonstatic_field(OSThread, _thread_handle, sizeof(HANDLE)) /* NOTE: no type */ -#define VM_TYPES_OS(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type) \ +#define VM_TYPES_OS(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c2_toplevel_type) \ \ declare_unsigned_integer_type(OSThread::thread_id_t) diff --git a/src/hotspot/share/ci/ciClassList.hpp b/src/hotspot/share/ci/ciClassList.hpp index 618a052765ee7..bce1e52e80b00 100644 --- a/src/hotspot/share/ci/ciClassList.hpp +++ b/src/hotspot/share/ci/ciClassList.hpp @@ -80,6 +80,7 @@ friend class ciObjectFactory; \ // Any more access must be given explicitly. #define CI_PACKAGE_ACCESS_TO \ friend class ciObjectFactory; \ +friend class VMStructs; \ friend class ciCallSite; \ friend class ciConstantPoolCache; \ friend class ciField; \ diff --git a/src/hotspot/share/jvmci/vmStructs_jvmci.cpp b/src/hotspot/share/jvmci/vmStructs_jvmci.cpp index 3ddf7de051019..b4b592b060c02 100644 --- a/src/hotspot/share/jvmci/vmStructs_jvmci.cpp +++ b/src/hotspot/share/jvmci/vmStructs_jvmci.cpp @@ -1016,7 +1016,7 @@ #ifdef AARCH64 -#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field) \ +#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field) \ static_field(VM_Version, _zva_length, int) \ static_field(StubRoutines::aarch64, _count_positives, address) \ static_field(StubRoutines::aarch64, _count_positives_long, address) \ @@ -1030,7 +1030,7 @@ #ifdef X86 -#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field) \ +#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field) \ volatile_nonstatic_field(JavaFrameAnchor, _last_Java_fp, intptr_t*) \ static_field(VM_Version, _features, VM_Version::VM_Features) \ \ @@ -1053,7 +1053,7 @@ * Dummy defines for architectures that don't use these. */ #ifndef VM_STRUCTS_CPU -#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field) +#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field) #endif #ifndef VM_INT_CONSTANTS_CPU @@ -1088,7 +1088,8 @@ VMStructEntry JVMCIVMStructs::localHotSpotVMStructs[] = { GENERATE_STATIC_VM_STRUCT_ENTRY, GENERATE_UNCHECKED_NONSTATIC_VM_STRUCT_ENTRY, GENERATE_NONSTATIC_VM_STRUCT_ENTRY, - GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY) + GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY, + GENERATE_C2_NONSTATIC_VM_STRUCT_ENTRY) #if INCLUDE_G1GC VM_STRUCTS_JVMCI_G1GC(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, @@ -1196,7 +1197,8 @@ void JVMCIVMStructs::init() { CHECK_STATIC_VM_STRUCT_ENTRY, CHECK_NO_OP, CHECK_VOLATILE_NONSTATIC_VM_STRUCT_ENTRY, - CHECK_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY) + CHECK_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY, + CHECK_C2_NONSTATIC_VM_STRUCT_ENTRY) #if INCLUDE_G1GC VM_STRUCTS_JVMCI_G1GC(CHECK_NONSTATIC_VM_STRUCT_ENTRY, diff --git a/src/hotspot/share/opto/compile.hpp b/src/hotspot/share/opto/compile.hpp index 2cada9c04c94d..6d347954002e6 100644 --- a/src/hotspot/share/opto/compile.hpp +++ b/src/hotspot/share/opto/compile.hpp @@ -221,6 +221,7 @@ class Options { // This class defines a top-level Compiler invocation. class Compile : public Phase { + friend class VMStructs; public: // Fixed alias indexes. (See also MergeMemNode.) diff --git a/src/hotspot/share/runtime/vmStructs.cpp b/src/hotspot/share/runtime/vmStructs.cpp index bc026887b84f2..64c9987821e5e 100644 --- a/src/hotspot/share/runtime/vmStructs.cpp +++ b/src/hotspot/share/runtime/vmStructs.cpp @@ -80,6 +80,7 @@ #include "oops/symbol.hpp" #include "oops/typeArrayKlass.hpp" #include "oops/typeArrayOop.hpp" +#include "opto/compile.hpp" #include "prims/jvmtiAgentThread.hpp" #include "runtime/arguments.hpp" #include "runtime/deoptimization.hpp" @@ -148,6 +149,7 @@ volatile_static_field, \ unchecked_nonstatic_field, \ volatile_nonstatic_field, \ + c2_nonstatic_field, \ nonproduct_nonstatic_field) \ \ /*************/ \ @@ -666,6 +668,14 @@ static_field(VMRegImpl, regName[0], const char*) \ static_field(VMRegImpl, stack0, VMReg) \ \ + /**************/ \ + /* CI */ \ + /************/ \ + \ + nonstatic_field(CompilerThread, _env, ciEnv*) \ + nonstatic_field(ciEnv, _task, CompileTask*) \ + c2_nonstatic_field(Compile, _method, ciMethod*) \ + \ /************/ \ /* Monitors */ \ /************/ \ @@ -833,7 +843,8 @@ declare_toplevel_type, \ declare_oop_type, \ declare_integer_type, \ - declare_unsigned_integer_type) \ + declare_unsigned_integer_type, \ + declare_c2_toplevel_type) \ \ /*************************************************************/ \ /* Java primitive types -- required by the SA implementation */ \ @@ -1148,6 +1159,16 @@ declare_toplevel_type(BasicLock) \ declare_toplevel_type(BasicObjectLock) \ \ + /*********************/ \ + /* CI */ \ + /*********************/ \ + \ + declare_c2_toplevel_type(Compile) \ + declare_toplevel_type(ciEnv) \ + declare_toplevel_type(ciBaseObject) \ + declare_type(ciMetadata, ciBaseObject) \ + declare_type(ciMethod, ciMetadata) \ + \ /********************/ \ /* -XX flags */ \ /********************/ \ @@ -1855,6 +1876,36 @@ # define ENSURE_NONPRODUCT_FIELD_TYPE_PRESENT(a, b, c) #endif /* PRODUCT */ +// Generate and check a nonstatic field in C2 builds +#ifdef COMPILER2 +# define GENERATE_C2_NONSTATIC_VM_STRUCT_ENTRY(a, b, c) GENERATE_NONSTATIC_VM_STRUCT_ENTRY(a, b, c) +# define CHECK_C2_NONSTATIC_VM_STRUCT_ENTRY(a, b, c) CHECK_NONSTATIC_VM_STRUCT_ENTRY(a, b, c) +# define ENSURE_C2_FIELD_TYPE_PRESENT(a, b, c) ENSURE_FIELD_TYPE_PRESENT(a, b, c) +#else +# define GENERATE_C2_NONSTATIC_VM_STRUCT_ENTRY(a, b, c) +# define CHECK_C2_NONSTATIC_VM_STRUCT_ENTRY(a, b, c) +# define ENSURE_C2_FIELD_TYPE_PRESENT(a, b, c) +#endif /* COMPILER2 */ + +// Generate but do not check a static field in C2 builds +#ifdef COMPILER2 +# define GENERATE_C2_UNCHECKED_STATIC_VM_STRUCT_ENTRY(a, b, c) GENERATE_UNCHECKED_STATIC_VM_STRUCT_ENTRY(a, b, c) +#else +# define GENERATE_C2_UNCHECKED_STATIC_VM_STRUCT_ENTRY(a, b, c) +#endif /* COMPILER2 */ + +//-------------------------------------------------------------------------------- +// VMTypeEntry build-specific macros +// + +#ifdef COMPILER2 +# define GENERATE_C2_TOPLEVEL_VM_TYPE_ENTRY(a) GENERATE_TOPLEVEL_VM_TYPE_ENTRY(a) +# define CHECK_C2_TOPLEVEL_VM_TYPE_ENTRY(a) +#else +# define GENERATE_C2_TOPLEVEL_VM_TYPE_ENTRY(a) +# define CHECK_C2_TOPLEVEL_VM_TYPE_ENTRY(a) +#endif /* COMPILER2 */ + // // Instantiation of VMStructEntries, VMTypeEntries and VMIntConstantEntries // @@ -1868,20 +1919,23 @@ VMStructEntry VMStructs::localHotSpotVMStructs[] = { GENERATE_VOLATILE_STATIC_VM_STRUCT_ENTRY, GENERATE_UNCHECKED_NONSTATIC_VM_STRUCT_ENTRY, GENERATE_NONSTATIC_VM_STRUCT_ENTRY, - GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY) + GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY, + GENERATE_C2_NONSTATIC_VM_STRUCT_ENTRY) VM_STRUCTS_OS(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, GENERATE_STATIC_VM_STRUCT_ENTRY, GENERATE_UNCHECKED_NONSTATIC_VM_STRUCT_ENTRY, GENERATE_NONSTATIC_VM_STRUCT_ENTRY, - GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY) + GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY, + GENERATE_C2_NONSTATIC_VM_STRUCT_ENTRY) VM_STRUCTS_CPU(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, GENERATE_STATIC_VM_STRUCT_ENTRY, GENERATE_UNCHECKED_NONSTATIC_VM_STRUCT_ENTRY, GENERATE_NONSTATIC_VM_STRUCT_ENTRY, - GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY) + GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY, + GENERATE_C2_NONSTATIC_VM_STRUCT_ENTRY) GENERATE_VM_STRUCT_LAST_ENTRY() }; @@ -1896,19 +1950,22 @@ VMTypeEntry VMStructs::localHotSpotVMTypes[] = { GENERATE_TOPLEVEL_VM_TYPE_ENTRY, GENERATE_OOP_VM_TYPE_ENTRY, GENERATE_INTEGER_VM_TYPE_ENTRY, - GENERATE_UNSIGNED_INTEGER_VM_TYPE_ENTRY) + GENERATE_UNSIGNED_INTEGER_VM_TYPE_ENTRY, + GENERATE_C2_TOPLEVEL_VM_TYPE_ENTRY) VM_TYPES_OS(GENERATE_VM_TYPE_ENTRY, GENERATE_TOPLEVEL_VM_TYPE_ENTRY, GENERATE_OOP_VM_TYPE_ENTRY, GENERATE_INTEGER_VM_TYPE_ENTRY, - GENERATE_UNSIGNED_INTEGER_VM_TYPE_ENTRY) + GENERATE_UNSIGNED_INTEGER_VM_TYPE_ENTRY, + GENERATE_C2_TOPLEVEL_VM_TYPE_ENTRY) VM_TYPES_CPU(GENERATE_VM_TYPE_ENTRY, GENERATE_TOPLEVEL_VM_TYPE_ENTRY, GENERATE_OOP_VM_TYPE_ENTRY, GENERATE_INTEGER_VM_TYPE_ENTRY, - GENERATE_UNSIGNED_INTEGER_VM_TYPE_ENTRY) + GENERATE_UNSIGNED_INTEGER_VM_TYPE_ENTRY, + GENERATE_C2_TOPLEVEL_VM_TYPE_ENTRY) GENERATE_VM_TYPE_LAST_ENTRY() }; @@ -2004,26 +2061,30 @@ void VMStructs::init() { CHECK_VOLATILE_STATIC_VM_STRUCT_ENTRY, CHECK_NO_OP, CHECK_VOLATILE_NONSTATIC_VM_STRUCT_ENTRY, - CHECK_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY) + CHECK_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY, + CHECK_C2_NONSTATIC_VM_STRUCT_ENTRY) VM_STRUCTS_CPU(CHECK_NONSTATIC_VM_STRUCT_ENTRY, CHECK_STATIC_VM_STRUCT_ENTRY, CHECK_NO_OP, CHECK_VOLATILE_NONSTATIC_VM_STRUCT_ENTRY, - CHECK_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY) + CHECK_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY, + CHECK_C2_NONSTATIC_VM_STRUCT_ENTRY) VM_TYPES(CHECK_VM_TYPE_ENTRY, CHECK_SINGLE_ARG_VM_TYPE_NO_OP, CHECK_SINGLE_ARG_VM_TYPE_NO_OP, CHECK_SINGLE_ARG_VM_TYPE_NO_OP, - CHECK_SINGLE_ARG_VM_TYPE_NO_OP) + CHECK_SINGLE_ARG_VM_TYPE_NO_OP, + CHECK_C2_TOPLEVEL_VM_TYPE_ENTRY) VM_TYPES_CPU(CHECK_VM_TYPE_ENTRY, CHECK_SINGLE_ARG_VM_TYPE_NO_OP, CHECK_SINGLE_ARG_VM_TYPE_NO_OP, CHECK_SINGLE_ARG_VM_TYPE_NO_OP, - CHECK_SINGLE_ARG_VM_TYPE_NO_OP) + CHECK_SINGLE_ARG_VM_TYPE_NO_OP, + CHECK_C2_TOPLEVEL_VM_TYPE_ENTRY) // // Split VM_STRUCTS() invocation into two parts to allow MS VC++ 6.0 @@ -2047,6 +2108,7 @@ void VMStructs::init() { CHECK_NO_OP, CHECK_NO_OP, CHECK_NO_OP, + CHECK_NO_OP, CHECK_NO_OP) VM_STRUCTS(CHECK_NO_OP, @@ -2054,13 +2116,15 @@ void VMStructs::init() { ENSURE_FIELD_TYPE_PRESENT, CHECK_NO_OP, ENSURE_FIELD_TYPE_PRESENT, - ENSURE_NONPRODUCT_FIELD_TYPE_PRESENT) + ENSURE_NONPRODUCT_FIELD_TYPE_PRESENT, + ENSURE_C2_FIELD_TYPE_PRESENT) VM_STRUCTS_CPU(ENSURE_FIELD_TYPE_PRESENT, ENSURE_FIELD_TYPE_PRESENT, CHECK_NO_OP, ENSURE_FIELD_TYPE_PRESENT, - ENSURE_NONPRODUCT_FIELD_TYPE_PRESENT) + ENSURE_NONPRODUCT_FIELD_TYPE_PRESENT, + ENSURE_C2_FIELD_TYPE_PRESENT) #endif // !_WINDOWS } From 5400dd013372ce289babb3dfad4f33b9cda09082 Mon Sep 17 00:00:00 2001 From: Francesco Andreuzzi Date: Tue, 16 Sep 2025 15:50:33 +0000 Subject: [PATCH 02/11] remove indent --- src/hotspot/cpu/arm/vmStructs_arm.hpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/hotspot/cpu/arm/vmStructs_arm.hpp b/src/hotspot/cpu/arm/vmStructs_arm.hpp index 9ad16c7128137..9331c3f70c599 100644 --- a/src/hotspot/cpu/arm/vmStructs_arm.hpp +++ b/src/hotspot/cpu/arm/vmStructs_arm.hpp @@ -30,13 +30,13 @@ // referenced by vmStructs.cpp. #define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field) \ - \ - /******************************/ \ - /* JavaCallWrapper */ \ - /******************************/ \ - /******************************/ \ - /* JavaFrameAnchor */ \ - /******************************/ \ + \ + /******************************/ \ + /* JavaCallWrapper */ \ + /******************************/ \ + /******************************/ \ + /* JavaFrameAnchor */ \ + /******************************/ \ volatile_nonstatic_field(JavaFrameAnchor, _last_Java_fp, intptr_t*) #define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c2_toplevel_type) From 5bc13c6ccf99c6e06d3a27b9a6cbb6f44001155e Mon Sep 17 00:00:00 2001 From: Francesco Andreuzzi Date: Tue, 16 Sep 2025 16:33:04 +0000 Subject: [PATCH 03/11] ops --- src/hotspot/share/runtime/vmStructs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hotspot/share/runtime/vmStructs.cpp b/src/hotspot/share/runtime/vmStructs.cpp index 64c9987821e5e..ad8abafba807c 100644 --- a/src/hotspot/share/runtime/vmStructs.cpp +++ b/src/hotspot/share/runtime/vmStructs.cpp @@ -80,7 +80,6 @@ #include "oops/symbol.hpp" #include "oops/typeArrayKlass.hpp" #include "oops/typeArrayOop.hpp" -#include "opto/compile.hpp" #include "prims/jvmtiAgentThread.hpp" #include "runtime/arguments.hpp" #include "runtime/deoptimization.hpp" @@ -106,6 +105,7 @@ #include "utilities/macros.hpp" #include "utilities/vmError.hpp" #ifdef COMPILER2 +#include "opto/compile.hpp" #include "opto/optoreg.hpp" #endif // COMPILER2 From 3a263b3843f605eac286ec1c8611479da87f6b93 Mon Sep 17 00:00:00 2001 From: Francesco Andreuzzi Date: Tue, 16 Sep 2025 21:57:35 +0000 Subject: [PATCH 04/11] nn --- src/hotspot/cpu/aarch64/vmStructs_aarch64.hpp | 2 +- src/hotspot/cpu/arm/vmStructs_arm.hpp | 2 +- src/hotspot/cpu/ppc/vmStructs_ppc.hpp | 2 +- src/hotspot/cpu/riscv/vmStructs_riscv.hpp | 2 +- src/hotspot/cpu/s390/vmStructs_s390.hpp | 2 +- src/hotspot/cpu/x86/vmStructs_x86.hpp | 2 +- src/hotspot/cpu/zero/vmStructs_zero.hpp | 2 +- src/hotspot/os/aix/vmStructs_aix.hpp | 2 +- src/hotspot/os/bsd/vmStructs_bsd.hpp | 2 +- src/hotspot/os/linux/vmStructs_linux.hpp | 2 +- src/hotspot/os/windows/vmStructs_windows.hpp | 2 +- src/hotspot/share/runtime/vmStructs.cpp | 29 ++++--------------- 12 files changed, 17 insertions(+), 34 deletions(-) diff --git a/src/hotspot/cpu/aarch64/vmStructs_aarch64.hpp b/src/hotspot/cpu/aarch64/vmStructs_aarch64.hpp index ba3d86b21bc3b..9bd9eab3b72e3 100644 --- a/src/hotspot/cpu/aarch64/vmStructs_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/vmStructs_aarch64.hpp @@ -35,7 +35,7 @@ static_field(VM_Version, _rop_protection, bool) \ static_field(VM_Version, _pac_mask, uintptr_t) -#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c2_toplevel_type) +#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type) #define VM_INT_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant) diff --git a/src/hotspot/cpu/arm/vmStructs_arm.hpp b/src/hotspot/cpu/arm/vmStructs_arm.hpp index 9331c3f70c599..71d5bee4a054f 100644 --- a/src/hotspot/cpu/arm/vmStructs_arm.hpp +++ b/src/hotspot/cpu/arm/vmStructs_arm.hpp @@ -39,7 +39,7 @@ /******************************/ \ volatile_nonstatic_field(JavaFrameAnchor, _last_Java_fp, intptr_t*) -#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c2_toplevel_type) +#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type) #define VM_INT_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant) diff --git a/src/hotspot/cpu/ppc/vmStructs_ppc.hpp b/src/hotspot/cpu/ppc/vmStructs_ppc.hpp index edb02ba827f23..d6e1335211291 100644 --- a/src/hotspot/cpu/ppc/vmStructs_ppc.hpp +++ b/src/hotspot/cpu/ppc/vmStructs_ppc.hpp @@ -32,7 +32,7 @@ #define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field) -#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c2_toplevel_type) +#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type) #define VM_INT_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant) diff --git a/src/hotspot/cpu/riscv/vmStructs_riscv.hpp b/src/hotspot/cpu/riscv/vmStructs_riscv.hpp index 45499bbb360cd..aa19442f5b9a0 100644 --- a/src/hotspot/cpu/riscv/vmStructs_riscv.hpp +++ b/src/hotspot/cpu/riscv/vmStructs_riscv.hpp @@ -33,7 +33,7 @@ #define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field) \ volatile_nonstatic_field(JavaFrameAnchor, _last_Java_fp, intptr_t*) -#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c2_toplevel_type) +#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type) #define VM_INT_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant) diff --git a/src/hotspot/cpu/s390/vmStructs_s390.hpp b/src/hotspot/cpu/s390/vmStructs_s390.hpp index a7d42cff8f1e0..210a005b0e842 100644 --- a/src/hotspot/cpu/s390/vmStructs_s390.hpp +++ b/src/hotspot/cpu/s390/vmStructs_s390.hpp @@ -32,7 +32,7 @@ #define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field) -#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c2_toplevel_type) +#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type) #define VM_INT_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant) diff --git a/src/hotspot/cpu/x86/vmStructs_x86.hpp b/src/hotspot/cpu/x86/vmStructs_x86.hpp index 9d083fd86aa59..dcb9c9a97845a 100644 --- a/src/hotspot/cpu/x86/vmStructs_x86.hpp +++ b/src/hotspot/cpu/x86/vmStructs_x86.hpp @@ -35,7 +35,7 @@ nonstatic_field(VM_Version::VM_Features, _features_bitmap[0], uint64_t) \ static_field(VM_Version::VM_Features, _features_bitmap_size, int) -#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c2_toplevel_type) \ +#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type) \ declare_toplevel_type(VM_Version::VM_Features) #define VM_INT_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant) \ diff --git a/src/hotspot/cpu/zero/vmStructs_zero.hpp b/src/hotspot/cpu/zero/vmStructs_zero.hpp index 46b79bf753ffb..223b3550f3ce5 100644 --- a/src/hotspot/cpu/zero/vmStructs_zero.hpp +++ b/src/hotspot/cpu/zero/vmStructs_zero.hpp @@ -32,7 +32,7 @@ #define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field) -#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c2_toplevel_type) +#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type) #define VM_INT_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant) diff --git a/src/hotspot/os/aix/vmStructs_aix.hpp b/src/hotspot/os/aix/vmStructs_aix.hpp index c5c488108a065..5b07b8df75bec 100644 --- a/src/hotspot/os/aix/vmStructs_aix.hpp +++ b/src/hotspot/os/aix/vmStructs_aix.hpp @@ -36,7 +36,7 @@ /******************************/ \ nonstatic_field(OSThread, _thread_id, pthread_t) \ -#define VM_TYPES_OS(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c2_toplevel_type) \ +#define VM_TYPES_OS(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type) \ \ /**********************/ \ /* Posix Thread IDs */ \ diff --git a/src/hotspot/os/bsd/vmStructs_bsd.hpp b/src/hotspot/os/bsd/vmStructs_bsd.hpp index 722b7e69b3600..1d40b8670a3aa 100644 --- a/src/hotspot/os/bsd/vmStructs_bsd.hpp +++ b/src/hotspot/os/bsd/vmStructs_bsd.hpp @@ -39,7 +39,7 @@ nonstatic_field(OSThread, _thread_id, OSThread::thread_id_t) \ nonstatic_field(OSThread, _unique_thread_id, uint64_t) -#define VM_TYPES_OS(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c2_toplevel_type) \ +#define VM_TYPES_OS(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type) \ \ /**********************/ \ /* Thread IDs */ \ diff --git a/src/hotspot/os/linux/vmStructs_linux.hpp b/src/hotspot/os/linux/vmStructs_linux.hpp index 96e01d9c387ff..5e3f3827f29c1 100644 --- a/src/hotspot/os/linux/vmStructs_linux.hpp +++ b/src/hotspot/os/linux/vmStructs_linux.hpp @@ -39,7 +39,7 @@ nonstatic_field(OSThread, _thread_id, pid_t) \ nonstatic_field(OSThread, _pthread_id, pthread_t) -#define VM_TYPES_OS(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c2_toplevel_type) \ +#define VM_TYPES_OS(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type) \ \ /**********************/ \ /* Posix Thread IDs */ \ diff --git a/src/hotspot/os/windows/vmStructs_windows.hpp b/src/hotspot/os/windows/vmStructs_windows.hpp index 5d6635424cac9..b4486935100b7 100644 --- a/src/hotspot/os/windows/vmStructs_windows.hpp +++ b/src/hotspot/os/windows/vmStructs_windows.hpp @@ -38,7 +38,7 @@ nonstatic_field(OSThread, _thread_id, OSThread::thread_id_t) \ unchecked_nonstatic_field(OSThread, _thread_handle, sizeof(HANDLE)) /* NOTE: no type */ -#define VM_TYPES_OS(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c2_toplevel_type) \ +#define VM_TYPES_OS(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type) \ \ declare_unsigned_integer_type(OSThread::thread_id_t) diff --git a/src/hotspot/share/runtime/vmStructs.cpp b/src/hotspot/share/runtime/vmStructs.cpp index ad8abafba807c..d519e19f176a6 100644 --- a/src/hotspot/share/runtime/vmStructs.cpp +++ b/src/hotspot/share/runtime/vmStructs.cpp @@ -105,7 +105,6 @@ #include "utilities/macros.hpp" #include "utilities/vmError.hpp" #ifdef COMPILER2 -#include "opto/compile.hpp" #include "opto/optoreg.hpp" #endif // COMPILER2 @@ -674,7 +673,6 @@ \ nonstatic_field(CompilerThread, _env, ciEnv*) \ nonstatic_field(ciEnv, _task, CompileTask*) \ - c2_nonstatic_field(Compile, _method, ciMethod*) \ \ /************/ \ /* Monitors */ \ @@ -843,8 +841,7 @@ declare_toplevel_type, \ declare_oop_type, \ declare_integer_type, \ - declare_unsigned_integer_type, \ - declare_c2_toplevel_type) \ + declare_unsigned_integer_type) \ \ /*************************************************************/ \ /* Java primitive types -- required by the SA implementation */ \ @@ -1163,7 +1160,6 @@ /* CI */ \ /*********************/ \ \ - declare_c2_toplevel_type(Compile) \ declare_toplevel_type(ciEnv) \ declare_toplevel_type(ciBaseObject) \ declare_type(ciMetadata, ciBaseObject) \ @@ -1898,14 +1894,6 @@ // VMTypeEntry build-specific macros // -#ifdef COMPILER2 -# define GENERATE_C2_TOPLEVEL_VM_TYPE_ENTRY(a) GENERATE_TOPLEVEL_VM_TYPE_ENTRY(a) -# define CHECK_C2_TOPLEVEL_VM_TYPE_ENTRY(a) -#else -# define GENERATE_C2_TOPLEVEL_VM_TYPE_ENTRY(a) -# define CHECK_C2_TOPLEVEL_VM_TYPE_ENTRY(a) -#endif /* COMPILER2 */ - // // Instantiation of VMStructEntries, VMTypeEntries and VMIntConstantEntries // @@ -1950,22 +1938,19 @@ VMTypeEntry VMStructs::localHotSpotVMTypes[] = { GENERATE_TOPLEVEL_VM_TYPE_ENTRY, GENERATE_OOP_VM_TYPE_ENTRY, GENERATE_INTEGER_VM_TYPE_ENTRY, - GENERATE_UNSIGNED_INTEGER_VM_TYPE_ENTRY, - GENERATE_C2_TOPLEVEL_VM_TYPE_ENTRY) + GENERATE_UNSIGNED_INTEGER_VM_TYPE_ENTRY) VM_TYPES_OS(GENERATE_VM_TYPE_ENTRY, GENERATE_TOPLEVEL_VM_TYPE_ENTRY, GENERATE_OOP_VM_TYPE_ENTRY, GENERATE_INTEGER_VM_TYPE_ENTRY, - GENERATE_UNSIGNED_INTEGER_VM_TYPE_ENTRY, - GENERATE_C2_TOPLEVEL_VM_TYPE_ENTRY) + GENERATE_UNSIGNED_INTEGER_VM_TYPE_ENTRY) VM_TYPES_CPU(GENERATE_VM_TYPE_ENTRY, GENERATE_TOPLEVEL_VM_TYPE_ENTRY, GENERATE_OOP_VM_TYPE_ENTRY, GENERATE_INTEGER_VM_TYPE_ENTRY, - GENERATE_UNSIGNED_INTEGER_VM_TYPE_ENTRY, - GENERATE_C2_TOPLEVEL_VM_TYPE_ENTRY) + GENERATE_UNSIGNED_INTEGER_VM_TYPE_ENTRY) GENERATE_VM_TYPE_LAST_ENTRY() }; @@ -2075,16 +2060,14 @@ void VMStructs::init() { CHECK_SINGLE_ARG_VM_TYPE_NO_OP, CHECK_SINGLE_ARG_VM_TYPE_NO_OP, CHECK_SINGLE_ARG_VM_TYPE_NO_OP, - CHECK_SINGLE_ARG_VM_TYPE_NO_OP, - CHECK_C2_TOPLEVEL_VM_TYPE_ENTRY) + CHECK_SINGLE_ARG_VM_TYPE_NO_OP) VM_TYPES_CPU(CHECK_VM_TYPE_ENTRY, CHECK_SINGLE_ARG_VM_TYPE_NO_OP, CHECK_SINGLE_ARG_VM_TYPE_NO_OP, CHECK_SINGLE_ARG_VM_TYPE_NO_OP, - CHECK_SINGLE_ARG_VM_TYPE_NO_OP, - CHECK_C2_TOPLEVEL_VM_TYPE_ENTRY) + CHECK_SINGLE_ARG_VM_TYPE_NO_OP) // // Split VM_STRUCTS() invocation into two parts to allow MS VC++ 6.0 From e15cbda1bbc57739e264b8b843571098fddc4dc0 Mon Sep 17 00:00:00 2001 From: Francesco Andreuzzi Date: Tue, 16 Sep 2025 22:01:34 +0000 Subject: [PATCH 05/11] nn --- src/hotspot/share/runtime/vmStructs.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/hotspot/share/runtime/vmStructs.cpp b/src/hotspot/share/runtime/vmStructs.cpp index d519e19f176a6..e4a9c2938ea5d 100644 --- a/src/hotspot/share/runtime/vmStructs.cpp +++ b/src/hotspot/share/runtime/vmStructs.cpp @@ -1161,9 +1161,6 @@ /*********************/ \ \ declare_toplevel_type(ciEnv) \ - declare_toplevel_type(ciBaseObject) \ - declare_type(ciMetadata, ciBaseObject) \ - declare_type(ciMethod, ciMetadata) \ \ /********************/ \ /* -XX flags */ \ From f9cb18baa49e2407050a86cb03546e4f1c331f3d Mon Sep 17 00:00:00 2001 From: Francesco Andreuzzi Date: Tue, 16 Sep 2025 22:11:49 +0000 Subject: [PATCH 06/11] cc --- src/hotspot/cpu/aarch64/vmStructs_aarch64.hpp | 2 +- src/hotspot/cpu/arm/vmStructs_arm.hpp | 2 +- src/hotspot/cpu/ppc/vmStructs_ppc.hpp | 2 +- src/hotspot/cpu/riscv/vmStructs_riscv.hpp | 2 +- src/hotspot/cpu/s390/vmStructs_s390.hpp | 2 +- src/hotspot/cpu/x86/vmStructs_x86.hpp | 2 +- src/hotspot/cpu/zero/vmStructs_zero.hpp | 2 +- src/hotspot/os/aix/vmStructs_aix.hpp | 2 +- src/hotspot/os/bsd/vmStructs_bsd.hpp | 2 +- src/hotspot/os/linux/vmStructs_linux.hpp | 2 +- src/hotspot/os/windows/vmStructs_windows.hpp | 2 +- src/hotspot/share/jvmci/vmStructs_jvmci.cpp | 12 ++++---- src/hotspot/share/opto/compile.hpp | 1 - src/hotspot/share/runtime/vmStructs.cpp | 28 ++----------------- 14 files changed, 19 insertions(+), 44 deletions(-) diff --git a/src/hotspot/cpu/aarch64/vmStructs_aarch64.hpp b/src/hotspot/cpu/aarch64/vmStructs_aarch64.hpp index 9bd9eab3b72e3..2ec901f6a2ed9 100644 --- a/src/hotspot/cpu/aarch64/vmStructs_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/vmStructs_aarch64.hpp @@ -30,7 +30,7 @@ // constants required by the Serviceability Agent. This file is // referenced by vmStructs.cpp. -#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field) \ +#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field) \ volatile_nonstatic_field(JavaFrameAnchor, _last_Java_fp, intptr_t*) \ static_field(VM_Version, _rop_protection, bool) \ static_field(VM_Version, _pac_mask, uintptr_t) diff --git a/src/hotspot/cpu/arm/vmStructs_arm.hpp b/src/hotspot/cpu/arm/vmStructs_arm.hpp index 71d5bee4a054f..453938a824e8b 100644 --- a/src/hotspot/cpu/arm/vmStructs_arm.hpp +++ b/src/hotspot/cpu/arm/vmStructs_arm.hpp @@ -29,7 +29,7 @@ // constants required by the Serviceability Agent. This file is // referenced by vmStructs.cpp. -#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field) \ +#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field) \ \ /******************************/ \ /* JavaCallWrapper */ \ diff --git a/src/hotspot/cpu/ppc/vmStructs_ppc.hpp b/src/hotspot/cpu/ppc/vmStructs_ppc.hpp index d6e1335211291..efe7fb9ad7bb3 100644 --- a/src/hotspot/cpu/ppc/vmStructs_ppc.hpp +++ b/src/hotspot/cpu/ppc/vmStructs_ppc.hpp @@ -30,7 +30,7 @@ // constants required by the Serviceability Agent. This file is // referenced by vmStructs.cpp. -#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field) +#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field) #define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type) diff --git a/src/hotspot/cpu/riscv/vmStructs_riscv.hpp b/src/hotspot/cpu/riscv/vmStructs_riscv.hpp index aa19442f5b9a0..ba250f7726852 100644 --- a/src/hotspot/cpu/riscv/vmStructs_riscv.hpp +++ b/src/hotspot/cpu/riscv/vmStructs_riscv.hpp @@ -30,7 +30,7 @@ // constants required by the Serviceability Agent. This file is // referenced by vmStructs.cpp. -#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field) \ +#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field) \ volatile_nonstatic_field(JavaFrameAnchor, _last_Java_fp, intptr_t*) #define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type) diff --git a/src/hotspot/cpu/s390/vmStructs_s390.hpp b/src/hotspot/cpu/s390/vmStructs_s390.hpp index 210a005b0e842..100fc97560ecf 100644 --- a/src/hotspot/cpu/s390/vmStructs_s390.hpp +++ b/src/hotspot/cpu/s390/vmStructs_s390.hpp @@ -30,7 +30,7 @@ // constants required by the Serviceability Agent. This file is // referenced by vmStructs.cpp. -#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field) +#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field) #define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type) diff --git a/src/hotspot/cpu/x86/vmStructs_x86.hpp b/src/hotspot/cpu/x86/vmStructs_x86.hpp index dcb9c9a97845a..b8089a6413e46 100644 --- a/src/hotspot/cpu/x86/vmStructs_x86.hpp +++ b/src/hotspot/cpu/x86/vmStructs_x86.hpp @@ -29,7 +29,7 @@ // constants required by the Serviceability Agent. This file is // referenced by vmStructs.cpp. -#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field) \ +#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field) \ volatile_nonstatic_field(JavaFrameAnchor, _last_Java_fp, intptr_t*) \ static_field(VM_Version, _features, VM_Version::VM_Features) \ nonstatic_field(VM_Version::VM_Features, _features_bitmap[0], uint64_t) \ diff --git a/src/hotspot/cpu/zero/vmStructs_zero.hpp b/src/hotspot/cpu/zero/vmStructs_zero.hpp index 223b3550f3ce5..9100c765e7ed2 100644 --- a/src/hotspot/cpu/zero/vmStructs_zero.hpp +++ b/src/hotspot/cpu/zero/vmStructs_zero.hpp @@ -30,7 +30,7 @@ // constants required by the Serviceability Agent. This file is // referenced by vmStructs.cpp. -#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field) +#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field) #define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type) diff --git a/src/hotspot/os/aix/vmStructs_aix.hpp b/src/hotspot/os/aix/vmStructs_aix.hpp index 5b07b8df75bec..c79c9477fffe6 100644 --- a/src/hotspot/os/aix/vmStructs_aix.hpp +++ b/src/hotspot/os/aix/vmStructs_aix.hpp @@ -29,7 +29,7 @@ // constants required by the Serviceability Agent. This file is // referenced by vmStructs.cpp. -#define VM_STRUCTS_OS(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field) \ +#define VM_STRUCTS_OS(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field) \ \ /******************************/ \ /* Threads (NOTE: incomplete) */ \ diff --git a/src/hotspot/os/bsd/vmStructs_bsd.hpp b/src/hotspot/os/bsd/vmStructs_bsd.hpp index 1d40b8670a3aa..e07f1cd7dd0cf 100644 --- a/src/hotspot/os/bsd/vmStructs_bsd.hpp +++ b/src/hotspot/os/bsd/vmStructs_bsd.hpp @@ -31,7 +31,7 @@ // constants required by the Serviceability Agent. This file is // referenced by vmStructs.cpp. -#define VM_STRUCTS_OS(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field) \ +#define VM_STRUCTS_OS(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field) \ \ /******************************/ \ /* Threads (NOTE: incomplete) */ \ diff --git a/src/hotspot/os/linux/vmStructs_linux.hpp b/src/hotspot/os/linux/vmStructs_linux.hpp index 5e3f3827f29c1..90bc6517a3f3c 100644 --- a/src/hotspot/os/linux/vmStructs_linux.hpp +++ b/src/hotspot/os/linux/vmStructs_linux.hpp @@ -31,7 +31,7 @@ // constants required by the Serviceability Agent. This file is // referenced by vmStructs.cpp. -#define VM_STRUCTS_OS(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field) \ +#define VM_STRUCTS_OS(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field) \ \ /******************************/ \ /* Threads (NOTE: incomplete) */ \ diff --git a/src/hotspot/os/windows/vmStructs_windows.hpp b/src/hotspot/os/windows/vmStructs_windows.hpp index b4486935100b7..7d457c82fe811 100644 --- a/src/hotspot/os/windows/vmStructs_windows.hpp +++ b/src/hotspot/os/windows/vmStructs_windows.hpp @@ -29,7 +29,7 @@ // constants required by the Serviceability Agent. This file is // referenced by vmStructs.cpp. -#define VM_STRUCTS_OS(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field) \ +#define VM_STRUCTS_OS(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field) \ \ /******************************/ \ /* Threads (NOTE: incomplete) */ \ diff --git a/src/hotspot/share/jvmci/vmStructs_jvmci.cpp b/src/hotspot/share/jvmci/vmStructs_jvmci.cpp index b4b592b060c02..3ddf7de051019 100644 --- a/src/hotspot/share/jvmci/vmStructs_jvmci.cpp +++ b/src/hotspot/share/jvmci/vmStructs_jvmci.cpp @@ -1016,7 +1016,7 @@ #ifdef AARCH64 -#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field) \ +#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field) \ static_field(VM_Version, _zva_length, int) \ static_field(StubRoutines::aarch64, _count_positives, address) \ static_field(StubRoutines::aarch64, _count_positives_long, address) \ @@ -1030,7 +1030,7 @@ #ifdef X86 -#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field) \ +#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field) \ volatile_nonstatic_field(JavaFrameAnchor, _last_Java_fp, intptr_t*) \ static_field(VM_Version, _features, VM_Version::VM_Features) \ \ @@ -1053,7 +1053,7 @@ * Dummy defines for architectures that don't use these. */ #ifndef VM_STRUCTS_CPU -#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field) +#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field) #endif #ifndef VM_INT_CONSTANTS_CPU @@ -1088,8 +1088,7 @@ VMStructEntry JVMCIVMStructs::localHotSpotVMStructs[] = { GENERATE_STATIC_VM_STRUCT_ENTRY, GENERATE_UNCHECKED_NONSTATIC_VM_STRUCT_ENTRY, GENERATE_NONSTATIC_VM_STRUCT_ENTRY, - GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY, - GENERATE_C2_NONSTATIC_VM_STRUCT_ENTRY) + GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY) #if INCLUDE_G1GC VM_STRUCTS_JVMCI_G1GC(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, @@ -1197,8 +1196,7 @@ void JVMCIVMStructs::init() { CHECK_STATIC_VM_STRUCT_ENTRY, CHECK_NO_OP, CHECK_VOLATILE_NONSTATIC_VM_STRUCT_ENTRY, - CHECK_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY, - CHECK_C2_NONSTATIC_VM_STRUCT_ENTRY) + CHECK_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY) #if INCLUDE_G1GC VM_STRUCTS_JVMCI_G1GC(CHECK_NONSTATIC_VM_STRUCT_ENTRY, diff --git a/src/hotspot/share/opto/compile.hpp b/src/hotspot/share/opto/compile.hpp index 6d347954002e6..2cada9c04c94d 100644 --- a/src/hotspot/share/opto/compile.hpp +++ b/src/hotspot/share/opto/compile.hpp @@ -221,7 +221,6 @@ class Options { // This class defines a top-level Compiler invocation. class Compile : public Phase { - friend class VMStructs; public: // Fixed alias indexes. (See also MergeMemNode.) diff --git a/src/hotspot/share/runtime/vmStructs.cpp b/src/hotspot/share/runtime/vmStructs.cpp index e4a9c2938ea5d..5183d71fc7c32 100644 --- a/src/hotspot/share/runtime/vmStructs.cpp +++ b/src/hotspot/share/runtime/vmStructs.cpp @@ -148,7 +148,6 @@ volatile_static_field, \ unchecked_nonstatic_field, \ volatile_nonstatic_field, \ - c2_nonstatic_field, \ nonproduct_nonstatic_field) \ \ /*************/ \ @@ -1869,24 +1868,6 @@ # define ENSURE_NONPRODUCT_FIELD_TYPE_PRESENT(a, b, c) #endif /* PRODUCT */ -// Generate and check a nonstatic field in C2 builds -#ifdef COMPILER2 -# define GENERATE_C2_NONSTATIC_VM_STRUCT_ENTRY(a, b, c) GENERATE_NONSTATIC_VM_STRUCT_ENTRY(a, b, c) -# define CHECK_C2_NONSTATIC_VM_STRUCT_ENTRY(a, b, c) CHECK_NONSTATIC_VM_STRUCT_ENTRY(a, b, c) -# define ENSURE_C2_FIELD_TYPE_PRESENT(a, b, c) ENSURE_FIELD_TYPE_PRESENT(a, b, c) -#else -# define GENERATE_C2_NONSTATIC_VM_STRUCT_ENTRY(a, b, c) -# define CHECK_C2_NONSTATIC_VM_STRUCT_ENTRY(a, b, c) -# define ENSURE_C2_FIELD_TYPE_PRESENT(a, b, c) -#endif /* COMPILER2 */ - -// Generate but do not check a static field in C2 builds -#ifdef COMPILER2 -# define GENERATE_C2_UNCHECKED_STATIC_VM_STRUCT_ENTRY(a, b, c) GENERATE_UNCHECKED_STATIC_VM_STRUCT_ENTRY(a, b, c) -#else -# define GENERATE_C2_UNCHECKED_STATIC_VM_STRUCT_ENTRY(a, b, c) -#endif /* COMPILER2 */ - //-------------------------------------------------------------------------------- // VMTypeEntry build-specific macros // @@ -1904,23 +1885,20 @@ VMStructEntry VMStructs::localHotSpotVMStructs[] = { GENERATE_VOLATILE_STATIC_VM_STRUCT_ENTRY, GENERATE_UNCHECKED_NONSTATIC_VM_STRUCT_ENTRY, GENERATE_NONSTATIC_VM_STRUCT_ENTRY, - GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY, - GENERATE_C2_NONSTATIC_VM_STRUCT_ENTRY) + GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY) VM_STRUCTS_OS(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, GENERATE_STATIC_VM_STRUCT_ENTRY, GENERATE_UNCHECKED_NONSTATIC_VM_STRUCT_ENTRY, GENERATE_NONSTATIC_VM_STRUCT_ENTRY, - GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY, - GENERATE_C2_NONSTATIC_VM_STRUCT_ENTRY) + GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY) VM_STRUCTS_CPU(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, GENERATE_STATIC_VM_STRUCT_ENTRY, GENERATE_UNCHECKED_NONSTATIC_VM_STRUCT_ENTRY, GENERATE_NONSTATIC_VM_STRUCT_ENTRY, - GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY, - GENERATE_C2_NONSTATIC_VM_STRUCT_ENTRY) + GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY) GENERATE_VM_STRUCT_LAST_ENTRY() }; From 8603bebd06aa6d62d68df5491d5c753a63e907bc Mon Sep 17 00:00:00 2001 From: Francesco Andreuzzi Date: Tue, 16 Sep 2025 22:12:49 +0000 Subject: [PATCH 07/11] nn --- src/hotspot/share/runtime/vmStructs.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/hotspot/share/runtime/vmStructs.cpp b/src/hotspot/share/runtime/vmStructs.cpp index 5183d71fc7c32..fc768a256604c 100644 --- a/src/hotspot/share/runtime/vmStructs.cpp +++ b/src/hotspot/share/runtime/vmStructs.cpp @@ -2021,15 +2021,13 @@ void VMStructs::init() { CHECK_VOLATILE_STATIC_VM_STRUCT_ENTRY, CHECK_NO_OP, CHECK_VOLATILE_NONSTATIC_VM_STRUCT_ENTRY, - CHECK_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY, - CHECK_C2_NONSTATIC_VM_STRUCT_ENTRY) + CHECK_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY) VM_STRUCTS_CPU(CHECK_NONSTATIC_VM_STRUCT_ENTRY, CHECK_STATIC_VM_STRUCT_ENTRY, CHECK_NO_OP, CHECK_VOLATILE_NONSTATIC_VM_STRUCT_ENTRY, - CHECK_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY, - CHECK_C2_NONSTATIC_VM_STRUCT_ENTRY) + CHECK_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY) VM_TYPES(CHECK_VM_TYPE_ENTRY, CHECK_SINGLE_ARG_VM_TYPE_NO_OP, @@ -2066,7 +2064,6 @@ void VMStructs::init() { CHECK_NO_OP, CHECK_NO_OP, CHECK_NO_OP, - CHECK_NO_OP, CHECK_NO_OP) VM_STRUCTS(CHECK_NO_OP, @@ -2074,15 +2071,13 @@ void VMStructs::init() { ENSURE_FIELD_TYPE_PRESENT, CHECK_NO_OP, ENSURE_FIELD_TYPE_PRESENT, - ENSURE_NONPRODUCT_FIELD_TYPE_PRESENT, - ENSURE_C2_FIELD_TYPE_PRESENT) + ENSURE_NONPRODUCT_FIELD_TYPE_PRESENT) VM_STRUCTS_CPU(ENSURE_FIELD_TYPE_PRESENT, ENSURE_FIELD_TYPE_PRESENT, CHECK_NO_OP, ENSURE_FIELD_TYPE_PRESENT, - ENSURE_NONPRODUCT_FIELD_TYPE_PRESENT, - ENSURE_C2_FIELD_TYPE_PRESENT) + ENSURE_NONPRODUCT_FIELD_TYPE_PRESENT) #endif // !_WINDOWS } From 316527768d43f547fdd8e84e96bee0031ac94dec Mon Sep 17 00:00:00 2001 From: Francesco Andreuzzi Date: Tue, 16 Sep 2025 22:13:07 +0000 Subject: [PATCH 08/11] nn --- src/hotspot/share/runtime/vmStructs.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/hotspot/share/runtime/vmStructs.cpp b/src/hotspot/share/runtime/vmStructs.cpp index fc768a256604c..aeca5af0d00dd 100644 --- a/src/hotspot/share/runtime/vmStructs.cpp +++ b/src/hotspot/share/runtime/vmStructs.cpp @@ -1868,10 +1868,6 @@ # define ENSURE_NONPRODUCT_FIELD_TYPE_PRESENT(a, b, c) #endif /* PRODUCT */ -//-------------------------------------------------------------------------------- -// VMTypeEntry build-specific macros -// - // // Instantiation of VMStructEntries, VMTypeEntries and VMIntConstantEntries // From e8b7849d126f63a554daec06f2b471dbe4c4a54e Mon Sep 17 00:00:00 2001 From: Francesco Andreuzzi Date: Tue, 16 Sep 2025 22:22:09 +0000 Subject: [PATCH 09/11] note --- src/hotspot/share/runtime/vmStructs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hotspot/share/runtime/vmStructs.cpp b/src/hotspot/share/runtime/vmStructs.cpp index aeca5af0d00dd..76e78f37cc583 100644 --- a/src/hotspot/share/runtime/vmStructs.cpp +++ b/src/hotspot/share/runtime/vmStructs.cpp @@ -667,7 +667,7 @@ static_field(VMRegImpl, stack0, VMReg) \ \ /**************/ \ - /* CI */ \ + /* CI (NOTE: these fields should not be removed, they can be used by external tools) */ \ /************/ \ \ nonstatic_field(CompilerThread, _env, ciEnv*) \ From 194a9d6fa6050b9bc31da865f7fa6c6261862a51 Mon Sep 17 00:00:00 2001 From: Francesco Andreuzzi Date: Wed, 17 Sep 2025 20:49:53 +0200 Subject: [PATCH 10/11] comment --- src/hotspot/share/runtime/vmStructs.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hotspot/share/runtime/vmStructs.cpp b/src/hotspot/share/runtime/vmStructs.cpp index 76e78f37cc583..399a7d8150569 100644 --- a/src/hotspot/share/runtime/vmStructs.cpp +++ b/src/hotspot/share/runtime/vmStructs.cpp @@ -666,9 +666,10 @@ static_field(VMRegImpl, regName[0], const char*) \ static_field(VMRegImpl, stack0, VMReg) \ \ - /**************/ \ - /* CI (NOTE: these fields should not be removed, they can be used by external tools) */ \ - /************/ \ + /******************************************************************************************/ \ + /* CI (NOTE: these CI fields are retained in VMStructs for the benefit of external tools, */ \ + /* to ease their migration to a future alternative. */ \ + /******************************************************************************************/ \ \ nonstatic_field(CompilerThread, _env, ciEnv*) \ nonstatic_field(ciEnv, _task, CompileTask*) \ From d7c4db008e15d00889ebacf9acc2d48689d2402e Mon Sep 17 00:00:00 2001 From: Francesco Andreuzzi Date: Thu, 18 Sep 2025 08:09:16 +0000 Subject: [PATCH 11/11] missing close --- src/hotspot/share/runtime/vmStructs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hotspot/share/runtime/vmStructs.cpp b/src/hotspot/share/runtime/vmStructs.cpp index 399a7d8150569..86874a967e342 100644 --- a/src/hotspot/share/runtime/vmStructs.cpp +++ b/src/hotspot/share/runtime/vmStructs.cpp @@ -668,7 +668,7 @@ \ /******************************************************************************************/ \ /* CI (NOTE: these CI fields are retained in VMStructs for the benefit of external tools, */ \ - /* to ease their migration to a future alternative. */ \ + /* to ease their migration to a future alternative.) */ \ /******************************************************************************************/ \ \ nonstatic_field(CompilerThread, _env, ciEnv*) \