RFR: 8377798: Hotspot build on macOS aarch64 with unused-functions warning reports some unused functions

Matthias Baesken mbaesken at openjdk.org
Thu Feb 12 16:08:20 UTC 2026


We currently set a warning for unused functions for gcc and clang, but later disable it for clang in the libjvm build.
I checked why it might be disabled for clang and there are a few functions/methods reported as unused, probably we can remove some or all of those ?

macOS aarch64 product build shows:


/myjdk/jdk/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.cpp:179:20: warning: unused function 'is_thread_local' [-Wunused-function]
static inline bool is_thread_local(ConstBufferPtr buffer) {
                   ^
/myjdk/jdk/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.cpp:184:20: warning: unused function 'is_virtual_thread_local' [-Wunused-function]
static inline bool is_virtual_thread_local(ConstBufferPtr buffer) {
                   ^
2 warnings generated.
/myjdk/jdk/src/hotspot/share/jfr/support/jfrDeprecationManager.cpp:197:20: warning: unused function 'jfr_is_started_on_command_line' [-Wunused-function]
static inline bool jfr_is_started_on_command_line() {
                   ^
1 warning generated.
/myjdk/jdk/src/hotspot/share/jfr/periodic/sampling/jfrSampleRequest.cpp:61:20: warning: unused function 'sp_in_stack' [-Wunused-function]
static inline bool sp_in_stack(const JfrSampleRequest& request, JavaThread* jt) {
                   ^
/myjdk/jdk/src/hotspot/share/jfr/periodic/sampling/jfrSampleRequest.cpp:69:20: warning: unused function 'update_interpreter_frame_sender_pc' [-Wunused-function]
static inline void update_interpreter_frame_sender_pc(JfrSampleRequest& request, intptr_t* fp) {
                   ^
/myjdk/jdk/src/hotspot/share/jfr/periodic/sampling/jfrSampleRequest.cpp:79:23: warning: unused function 'interpreter_frame_return_address' [-Wunused-function]
static inline address interpreter_frame_return_address(const JfrSampleRequest& request) {
                      ^
/myjdk/jdk/src/hotspot/share/jfr/periodic/sampling/jfrSampleRequest.cpp:93:20: warning: unused function 'update_frame_sender_sp' [-Wunused-function]
static inline void update_frame_sender_sp(JfrSampleRequest& request, intptr_t* fp) {
                   ^
/myjdk/jdk/src/hotspot/share/jfr/periodic/sampling/jfrSampleRequest.cpp:101:20: warning: unused function 'update_sp' [-Wunused-function]
static inline void update_sp(JfrSampleRequest& request, int frame_size) {
                   ^
/myjdk/jdk/src/hotspot/share/jfr/periodic/sampling/jfrSampleRequest.cpp:106:20: warning: unused function 'update_pc' [-Wunused-function]
static inline void update_pc(JfrSampleRequest& request) {
                   ^
/myjdk/jdk/src/hotspot/share/jfr/periodic/sampling/jfrSampleRequest.cpp:111:20: warning: unused function 'update_fp' [-Wunused-function]
static inline void update_fp(JfrSampleRequest& request) {
                   ^
7 warnings generated.
/myjdk/jdk/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampling.cpp:69:20: warning: unused function 'is_interpreter' [-Wunused-function]
static inline bool is_interpreter(address pc) {
                   ^
1 warning generated.
/myjdk/jdk/src/hotspot/os/posix/perfMemory_posix.cpp:646:14: warning: unused function 'get_user_name' [-Wunused-function]
static char* get_user_name(int vmid, int *nspid, TRAPS) {
             ^
1 warning generated.
/myjdk/jdk/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp:99:23: warning: unused function 'at_rsp' [-Wunused-function]
static inline Address at_rsp() {

-------------

Commit messages:
 - JDK-8377798

Changes: https://git.openjdk.org/jdk/pull/29695/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=29695&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8377798
  Stats: 44 lines in 6 files changed: 8 ins; 36 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/29695.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/29695/head:pull/29695

PR: https://git.openjdk.org/jdk/pull/29695


More information about the hotspot-dev mailing list