diff --git a/src/hotspot/cpu/aarch64/nativeInst_aarch64.hpp b/src/hotspot/cpu/aarch64/nativeInst_aarch64.hpp index c0be84d3f5ce6..cf85d2d62174d 100644 --- a/src/hotspot/cpu/aarch64/nativeInst_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/nativeInst_aarch64.hpp @@ -207,6 +207,7 @@ class NativeCall: public NativeInstruction { return_address_offset = 4 }; + static int byte_size() { return instruction_size; } address instruction_address() const { return addr_at(instruction_offset); } address next_instruction_address() const { return addr_at(return_address_offset); } int displacement() const { return (int_at(displacement_offset) << 6) >> 4; } diff --git a/src/hotspot/cpu/arm/nativeInst_arm_32.hpp b/src/hotspot/cpu/arm/nativeInst_arm_32.hpp index 15b57188730df..e26c23cd9836c 100644 --- a/src/hotspot/cpu/arm/nativeInst_arm_32.hpp +++ b/src/hotspot/cpu/arm/nativeInst_arm_32.hpp @@ -415,6 +415,7 @@ inline NativeJump* nativeJump_at(address address) { class NativeCall: public RawNativeCall { public: + static int byte_size() { return instruction_size; } // NativeCall::next_instruction_address() is used only to define the // range where to look for the relocation information. We need not // walk over composed instructions (as long as the relocation information diff --git a/src/hotspot/cpu/ppc/nativeInst_ppc.hpp b/src/hotspot/cpu/ppc/nativeInst_ppc.hpp index 113cedfee7cab..f21d76f8a675e 100644 --- a/src/hotspot/cpu/ppc/nativeInst_ppc.hpp +++ b/src/hotspot/cpu/ppc/nativeInst_ppc.hpp @@ -137,6 +137,8 @@ class NativeCall: public NativeInstruction { instruction_size = 16 // Used in shared code for calls with reloc_info. }; + static int byte_size() { return instruction_size; } + static bool is_call_at(address a) { return Assembler::is_bl(*(int*)(a)); } diff --git a/src/hotspot/cpu/riscv/nativeInst_riscv.hpp b/src/hotspot/cpu/riscv/nativeInst_riscv.hpp index e9b3624d9d29d..f925f8950aa23 100644 --- a/src/hotspot/cpu/riscv/nativeInst_riscv.hpp +++ b/src/hotspot/cpu/riscv/nativeInst_riscv.hpp @@ -126,6 +126,7 @@ class NativeCall: public NativeInstruction { return_address_offset = 4 }; + static int byte_size() { return instruction_size; } address instruction_address() const { return addr_at(instruction_offset); } address next_instruction_address() const { return addr_at(return_address_offset); } address return_address() const { return addr_at(return_address_offset); } diff --git a/src/hotspot/cpu/s390/nativeInst_s390.hpp b/src/hotspot/cpu/s390/nativeInst_s390.hpp index 13f15224f8bf5..8003e1d42f267 100644 --- a/src/hotspot/cpu/s390/nativeInst_s390.hpp +++ b/src/hotspot/cpu/s390/nativeInst_s390.hpp @@ -212,6 +212,7 @@ class NativeCall: public NativeInstruction { call_far_pcrelative_displacement_alignment = 4 }; + static int byte_size() { return instruction_size; } // Maximum size (in bytes) of a call to an absolute address. // Used when emitting call to deopt handler blob, which is a diff --git a/src/hotspot/cpu/x86/nativeInst_x86.hpp b/src/hotspot/cpu/x86/nativeInst_x86.hpp index f8cbf70f18961..70cb61793661e 100644 --- a/src/hotspot/cpu/x86/nativeInst_x86.hpp +++ b/src/hotspot/cpu/x86/nativeInst_x86.hpp @@ -160,6 +160,7 @@ class NativeCall: public NativeInstruction { return_address_offset = 5 }; + static int byte_size() { return instruction_size; } address instruction_address() const { return addr_at(instruction_offset); } address next_instruction_address() const { return addr_at(return_address_offset); } int displacement() const { return (jint) int_at(displacement_offset); } diff --git a/src/hotspot/cpu/zero/nativeInst_zero.hpp b/src/hotspot/cpu/zero/nativeInst_zero.hpp index 77a7d511ac5e8..2f3d9b80617ce 100644 --- a/src/hotspot/cpu/zero/nativeInst_zero.hpp +++ b/src/hotspot/cpu/zero/nativeInst_zero.hpp @@ -70,6 +70,8 @@ class NativeCall : public NativeInstruction { instruction_size = 0 // not used within the interpreter }; + static int byte_size() { return instruction_size; } + address instruction_address() const { ShouldNotCallThis(); return nullptr; diff --git a/src/hotspot/share/code/nmethod.inline.hpp b/src/hotspot/share/code/nmethod.inline.hpp index 4af4d3ffaedd9..49af1e0b95f2f 100644 --- a/src/hotspot/share/code/nmethod.inline.hpp +++ b/src/hotspot/share/code/nmethod.inline.hpp @@ -37,7 +37,7 @@ inline bool nmethod::is_deopt_pc(address pc) { return is_deopt_entry(pc) || is_d inline bool nmethod::is_deopt_entry(address pc) { return pc == deopt_handler_begin() #if INCLUDE_JVMCI - || (is_compiled_by_jvmci() && pc == (deopt_handler_begin() + NativeCall::instruction_size)) + || (is_compiled_by_jvmci() && pc == (deopt_handler_begin() + NativeCall::byte_size())) #endif ; } @@ -45,7 +45,7 @@ inline bool nmethod::is_deopt_entry(address pc) { inline bool nmethod::is_deopt_mh_entry(address pc) { return pc == deopt_mh_handler_begin() #if INCLUDE_JVMCI - || (is_compiled_by_jvmci() && pc == (deopt_mh_handler_begin() + NativeCall::instruction_size)) + || (is_compiled_by_jvmci() && pc == (deopt_mh_handler_begin() + NativeCall::byte_size())) #endif ; } diff --git a/src/hotspot/share/opto/output.cpp b/src/hotspot/share/opto/output.cpp index 0ad56184d4d12..748461d15e4c3 100644 --- a/src/hotspot/share/opto/output.cpp +++ b/src/hotspot/share/opto/output.cpp @@ -1321,7 +1321,7 @@ CodeBuffer* PhaseOutput::init_buffer() { int code_req = _buf_sizes._code; int const_req = _buf_sizes._const; - int pad_req = NativeCall::instruction_size; + int pad_req = NativeCall::byte_size(); BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2(); stub_req += bs->estimate_stub_size();