From 1aeaa8946a95b471543f0d753a3c93e2e4b4e8cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3n=20Seoane=20Ampudia?= Date: Fri, 21 Nov 2025 10:39:14 +0100 Subject: [PATCH 1/2] Remove dead code --- src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp | 7 ------- src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp | 1 - src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp | 4 ++-- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp index ceedb4f10632a..dad46de9c8c50 100644 --- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp @@ -515,13 +515,6 @@ int MacroAssembler::patch_narrow_klass(address insn_addr, narrowKlass n) { return 2 * NativeInstruction::instruction_size; } -address MacroAssembler::target_addr_for_insn_or_null(address insn_addr) { - if (NativeInstruction::is_ldrw_to_zr(insn_addr)) { - return nullptr; - } - return MacroAssembler::target_addr_for_insn(insn_addr); -} - void MacroAssembler::safepoint_poll(Label& slow_path, bool at_return, bool in_nmethod, Register tmp) { ldr(tmp, Address(rthread, JavaThread::polling_word_offset())); if (at_return) { diff --git a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp index 4baa07d7d4992..52ab6118d962d 100644 --- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp @@ -678,7 +678,6 @@ class MacroAssembler: public Assembler { static bool uses_implicit_null_check(void* address); static address target_addr_for_insn(address insn_addr); - static address target_addr_for_insn_or_null(address insn_addr); // Required platform-specific helpers for Label::patch_instructions. // They _shadow_ the declarations in AbstractAssembler, which are undefined. diff --git a/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp b/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp index 5a7fececafaaf..a7dd052884f5c 100644 --- a/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp @@ -204,7 +204,7 @@ void NativeMovRegMem::set_offset(int x) { void NativeMovRegMem::verify() { #ifdef ASSERT - address dest = MacroAssembler::target_addr_for_insn_or_null(instruction_address()); + address dest = MacroAssembler::target_addr_for_insn(instruction_address()); #endif } @@ -213,7 +213,7 @@ void NativeMovRegMem::verify() { void NativeJump::verify() { ; } address NativeJump::jump_destination() const { - address dest = MacroAssembler::target_addr_for_insn_or_null(instruction_address()); + address dest = MacroAssembler::target_addr_for_insn(instruction_address()); // We use jump to self as the unresolved address which the inline // cache code (and relocs) know about From 749eda7882d38d18733e5f72dd5bc431b850973f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3n=20Seoane=20Ampudia?= Date: Tue, 25 Nov 2025 09:24:32 +0100 Subject: [PATCH 2/2] Remove more dead code --- src/hotspot/cpu/aarch64/nativeInst_aarch64.hpp | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/hotspot/cpu/aarch64/nativeInst_aarch64.hpp b/src/hotspot/cpu/aarch64/nativeInst_aarch64.hpp index df5d97c23764f..c4aa954d10389 100644 --- a/src/hotspot/cpu/aarch64/nativeInst_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/nativeInst_aarch64.hpp @@ -75,10 +75,8 @@ class NativeInstruction { return (encoding() & 0xff000000) == 0x10000000; } - inline bool is_nop() const; bool is_jump(); bool is_general_jump(); - inline bool is_jump_or_nop(); inline bool is_cond_jump(); bool is_safepoint_poll(); bool is_movz(); @@ -395,11 +393,6 @@ class NativeIllegalInstruction: public NativeInstruction { static void insert(address code_pos); }; -inline bool NativeInstruction::is_nop() const{ - uint32_t insn = *(uint32_t*)addr_at(0); - return insn == 0xd503201f; -} - inline bool NativeInstruction::is_jump() { uint32_t insn = *(uint32_t*)addr_at(0); @@ -419,10 +412,6 @@ inline bool NativeInstruction::is_jump() { return false; } -inline bool NativeInstruction::is_jump_or_nop() { - return is_nop() || is_jump(); -} - // Call trampoline stubs. class NativeCallTrampolineStub : public NativeInstruction { public: