diff --git a/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp b/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp index 33158d6b97a..56fd6dff0cc 100644 --- a/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp @@ -212,11 +212,6 @@ void NativeMovRegMem::verify() { void NativeJump::verify() { ; } - -void NativeJump::check_verified_entry_alignment(address entry, address verified_entry) { -} - - address NativeJump::jump_destination() const { address dest = MacroAssembler::target_addr_for_insn_or_null(instruction_address()); @@ -359,31 +354,6 @@ bool NativeInstruction::is_stop() { //------------------------------------------------------------------- -// MT-safe inserting of a jump over a jump or a nop (used by -// nmethod::make_not_entrant) - -void NativeJump::patch_verified_entry(address entry, address verified_entry, address dest) { - - assert(dest == SharedRuntime::get_handle_wrong_method_stub(), "expected fixed destination of patch"); - assert(nativeInstruction_at(verified_entry)->is_jump_or_nop() - || nativeInstruction_at(verified_entry)->is_sigill_not_entrant(), - "Aarch64 cannot replace non-jump with jump"); - - // Patch this nmethod atomically. - if (Assembler::reachable_from_branch_at(verified_entry, dest)) { - ptrdiff_t disp = dest - verified_entry; - guarantee(disp < 1 << 27 && disp > - (1 << 27), "branch overflow"); - - unsigned int insn = (0b000101 << 26) | ((disp >> 2) & 0x3ffffff); - *(unsigned int*)verified_entry = insn; - } else { - // We use an illegal instruction for marking a method as not_entrant. - NativeIllegalInstruction::insert(verified_entry); - } - - ICache::invalidate_range(verified_entry, instruction_size); -} - void NativeGeneralJump::verify() { } void NativeGeneralJump::insert_unconditional(address code_pos, address entry) { diff --git a/src/hotspot/cpu/aarch64/nativeInst_aarch64.hpp b/src/hotspot/cpu/aarch64/nativeInst_aarch64.hpp index 0eb5ff815be..e652d659256 100644 --- a/src/hotspot/cpu/aarch64/nativeInst_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/nativeInst_aarch64.hpp @@ -360,9 +360,6 @@ public: // Insertion of native jump instruction static void insert(address code_pos, address entry); - // MT-safe insertion of native jump at verified method entry - static void check_verified_entry_alignment(address entry, address verified_entry); - static void patch_verified_entry(address entry, address verified_entry, address dest); }; inline NativeJump* nativeJump_at(address address) { diff --git a/src/hotspot/cpu/arm/nativeInst_arm_32.cpp b/src/hotspot/cpu/arm/nativeInst_arm_32.cpp index 2caf2d7587e..232294b246a 100644 --- a/src/hotspot/cpu/arm/nativeInst_arm_32.cpp +++ b/src/hotspot/cpu/arm/nativeInst_arm_32.cpp @@ -282,16 +282,6 @@ void NativeMovConstReg::set_pc_relative_offset(address addr, address pc) { } } -void RawNativeJump::check_verified_entry_alignment(address entry, address verified_entry) { -} - -void RawNativeJump::patch_verified_entry(address entry, address verified_entry, address dest) { - assert(dest == SharedRuntime::get_handle_wrong_method_stub(), "should be"); - int *a = (int *)verified_entry; - a[0] = not_entrant_illegal_instruction; // always illegal - ICache::invalidate_range((address)&a[0], sizeof a[0]); -} - void NativeGeneralJump::insert_unconditional(address code_pos, address entry) { int offset = (int)(entry - code_pos - 8); assert(offset < 0x2000000 && offset > -0x2000000, "encoding constraint"); diff --git a/src/hotspot/cpu/arm/nativeInst_arm_32.hpp b/src/hotspot/cpu/arm/nativeInst_arm_32.hpp index e26c23cd983..ee856bcfe60 100644 --- a/src/hotspot/cpu/arm/nativeInst_arm_32.hpp +++ b/src/hotspot/cpu/arm/nativeInst_arm_32.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -61,10 +61,6 @@ class RawNativeInstruction { instr_fld_fst = 0xd0 }; - // illegal instruction used by NativeJump::patch_verified_entry - // permanently undefined (UDF): 0xe << 28 | 0b1111111 << 20 | 0b1111 << 4 - static const int not_entrant_illegal_instruction = 0xe7f000f0; - static int decode_rotated_imm12(int encoding) { int base = encoding & 0xff; int right_rotation = (encoding & 0xf00) >> 7; @@ -274,10 +270,6 @@ class RawNativeJump: public NativeInstruction { } } - static void check_verified_entry_alignment(address entry, address verified_entry); - - static void patch_verified_entry(address entry, address verified_entry, address dest); - }; inline RawNativeJump* rawNativeJump_at(address address) { diff --git a/src/hotspot/cpu/ppc/c1_MacroAssembler_ppc.cpp b/src/hotspot/cpu/ppc/c1_MacroAssembler_ppc.cpp index 77d3653aefd..02e069b6be1 100644 --- a/src/hotspot/cpu/ppc/c1_MacroAssembler_ppc.cpp +++ b/src/hotspot/cpu/ppc/c1_MacroAssembler_ppc.cpp @@ -46,7 +46,6 @@ void C1_MacroAssembler::explicit_null_check(Register base) { void C1_MacroAssembler::build_frame(int frame_size_in_bytes, int bang_size_in_bytes) { - // Avoid stack bang as first instruction. It may get overwritten by patch_verified_entry. const Register return_pc = R20; mflr(return_pc); diff --git a/src/hotspot/cpu/ppc/nativeInst_ppc.cpp b/src/hotspot/cpu/ppc/nativeInst_ppc.cpp index 1114da60d2b..ca492329729 100644 --- a/src/hotspot/cpu/ppc/nativeInst_ppc.cpp +++ b/src/hotspot/cpu/ppc/nativeInst_ppc.cpp @@ -39,18 +39,6 @@ #include "c1/c1_Runtime1.hpp" #endif -// We use an illtrap for marking a method as not_entrant -// Work around a C++ compiler bug which changes 'this' -bool NativeInstruction::is_sigill_not_entrant_at(address addr) { - if (!Assembler::is_illtrap(addr)) return false; - CodeBlob* cb = CodeCache::find_blob(addr); - if (cb == nullptr || !cb->is_nmethod()) return false; - nmethod *nm = (nmethod *)cb; - // This method is not_entrant iff the illtrap instruction is - // located at the verified entry point. - return nm->verified_entry_point() == addr; -} - #ifdef ASSERT void NativeInstruction::verify() { // Make sure code pattern is actually an instruction address. @@ -331,25 +319,6 @@ void NativeMovConstReg::verify() { } #endif // ASSERT -void NativeJump::patch_verified_entry(address entry, address verified_entry, address dest) { - ResourceMark rm; - int code_size = 1 * BytesPerInstWord; - CodeBuffer cb(verified_entry, code_size + 1); - MacroAssembler* a = new MacroAssembler(&cb); -#ifdef COMPILER2 - assert(dest == SharedRuntime::get_handle_wrong_method_stub(), "expected fixed destination of patch"); -#endif - // Patch this nmethod atomically. Always use illtrap/trap in debug build. - if (DEBUG_ONLY(false &&) a->is_within_range_of_b(dest, a->pc())) { - a->b(dest); - } else { - // The signal handler will continue at dest=OptoRuntime::handle_wrong_method_stub(). - // We use an illtrap for marking a method as not_entrant. - a->illtrap(); - } - ICache::ppc64_flush_icache_bytes(verified_entry, code_size); -} - #ifdef ASSERT void NativeJump::verify() { address addr = addr_at(0); @@ -462,9 +431,7 @@ bool NativeDeoptInstruction::is_deopt_at(address code_pos) { if (!Assembler::is_illtrap(code_pos)) return false; CodeBlob* cb = CodeCache::find_blob(code_pos); if (cb == nullptr || !cb->is_nmethod()) return false; - nmethod *nm = (nmethod *)cb; - // see NativeInstruction::is_sigill_not_entrant_at() - return nm->verified_entry_point() != code_pos; + return true; } // Inserts an instruction which is specified to cause a SIGILL at a given pc diff --git a/src/hotspot/cpu/ppc/nativeInst_ppc.hpp b/src/hotspot/cpu/ppc/nativeInst_ppc.hpp index f4d570116a8..d892f046b6c 100644 --- a/src/hotspot/cpu/ppc/nativeInst_ppc.hpp +++ b/src/hotspot/cpu/ppc/nativeInst_ppc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2024 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -328,15 +328,7 @@ class NativeJump: public NativeInstruction { } } - // MT-safe insertion of native jump at verified method entry - static void patch_verified_entry(address entry, address verified_entry, address dest); - void verify() NOT_DEBUG_RETURN; - - static void check_verified_entry_alignment(address entry, address verified_entry) { - // We just patch one instruction on ppc64, so the jump doesn't have to - // be aligned. Nothing to do here. - } }; // Instantiates a NativeJump object starting at the given instruction diff --git a/src/hotspot/cpu/riscv/nativeInst_riscv.cpp b/src/hotspot/cpu/riscv/nativeInst_riscv.cpp index 31947b520d0..81240558381 100644 --- a/src/hotspot/cpu/riscv/nativeInst_riscv.cpp +++ b/src/hotspot/cpu/riscv/nativeInst_riscv.cpp @@ -356,18 +356,6 @@ void NativeMovRegMem::verify() { void NativeJump::verify() { } - -void NativeJump::check_verified_entry_alignment(address entry, address verified_entry) { - // Patching to not_entrant can happen while activations of the method are - // in use. The patching in that instance must happen only when certain - // alignment restrictions are true. These guarantees check those - // conditions. - - // Must be 4 bytes aligned - MacroAssembler::assert_alignment(verified_entry); -} - - address NativeJump::jump_destination() const { address dest = MacroAssembler::target_addr_for_insn(instruction_address()); @@ -437,45 +425,6 @@ bool NativeInstruction::is_stop() { //------------------------------------------------------------------- -// MT-safe inserting of a jump over a jump or a nop (used by -// nmethod::make_not_entrant) - -void NativeJump::patch_verified_entry(address entry, address verified_entry, address dest) { - - assert(dest == SharedRuntime::get_handle_wrong_method_stub(), "expected fixed destination of patch"); - - assert(nativeInstruction_at(verified_entry)->is_jump_or_nop() || - nativeInstruction_at(verified_entry)->is_sigill_not_entrant(), - "riscv cannot replace non-jump with jump"); - - check_verified_entry_alignment(entry, verified_entry); - - // Patch this nmethod atomically. - if (Assembler::reachable_from_branch_at(verified_entry, dest)) { - ptrdiff_t offset = dest - verified_entry; - guarantee(Assembler::is_simm21(offset) && ((offset % 2) == 0), - "offset is too large to be patched in one jal instruction."); // 1M - - uint32_t insn = 0; - address pInsn = (address)&insn; - Assembler::patch(pInsn, 31, 31, (offset >> 20) & 0x1); - Assembler::patch(pInsn, 30, 21, (offset >> 1) & 0x3ff); - Assembler::patch(pInsn, 20, 20, (offset >> 11) & 0x1); - Assembler::patch(pInsn, 19, 12, (offset >> 12) & 0xff); - Assembler::patch(pInsn, 11, 7, 0); // zero, no link jump - Assembler::patch(pInsn, 6, 0, 0b1101111); // j, (jal x0 offset) - Assembler::sd_instr(verified_entry, insn); - } else { - // We use an illegal instruction for marking a method as - // not_entrant. - NativeIllegalInstruction::insert(verified_entry); - } - - ICache::invalidate_range(verified_entry, instruction_size); -} - -//------------------------------------------------------------------- - void NativeGeneralJump::insert_unconditional(address code_pos, address entry) { CodeBuffer cb(code_pos, instruction_size); MacroAssembler a(&cb); diff --git a/src/hotspot/cpu/riscv/nativeInst_riscv.hpp b/src/hotspot/cpu/riscv/nativeInst_riscv.hpp index d8f5fa57816..4e2e637ac14 100644 --- a/src/hotspot/cpu/riscv/nativeInst_riscv.hpp +++ b/src/hotspot/cpu/riscv/nativeInst_riscv.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, 2018, Red Hat Inc. All rights reserved. * Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -274,9 +274,6 @@ class NativeJump: public NativeInstruction { // Insertion of native jump instruction static void insert(address code_pos, address entry); - // MT-safe insertion of native jump at verified method entry - static void check_verified_entry_alignment(address entry, address verified_entry); - static void patch_verified_entry(address entry, address verified_entry, address dest); }; inline NativeJump* nativeJump_at(address addr) { diff --git a/src/hotspot/cpu/riscv/riscv.ad b/src/hotspot/cpu/riscv/riscv.ad index ac0b45b0d3f..f6c5b12885d 100644 --- a/src/hotspot/cpu/riscv/riscv.ad +++ b/src/hotspot/cpu/riscv/riscv.ad @@ -1796,7 +1796,6 @@ void MachUEPNode::emit(C2_MacroAssembler* masm, PhaseRegAlloc* ra_) const // This is the unverified entry point. __ ic_check(CodeEntryAlignment); - // Verified entry point must be properly 4 bytes aligned for patching by NativeJump::patch_verified_entry(). // ic_check() aligns to CodeEntryAlignment >= InteriorEntryAlignment(min 16) > NativeInstruction::instruction_size(4). assert(((__ offset()) % CodeEntryAlignment) == 0, "Misaligned verified entry point"); } diff --git a/src/hotspot/cpu/s390/nativeInst_s390.cpp b/src/hotspot/cpu/s390/nativeInst_s390.cpp index 9990c225a89..546f8b13397 100644 --- a/src/hotspot/cpu/s390/nativeInst_s390.cpp +++ b/src/hotspot/cpu/s390/nativeInst_s390.cpp @@ -167,27 +167,6 @@ bool NativeInstruction::is_illegal() { return halfword_at(-2) == illegal_instruction(); } -// We use an illtrap for marking a method as not_entrant. -bool NativeInstruction::is_sigill_not_entrant() { - if (!is_illegal()) return false; // Just a quick path. - - // One-sided error of is_illegal tolerable here - // (see implementation of is_illegal() for details). - - CodeBlob* cb = CodeCache::find_blob(addr_at(0)); - if (cb == nullptr || !cb->is_nmethod()) { - return false; - } - - nmethod *nm = (nmethod *)cb; - // This method is not_entrant if the illtrap instruction - // is located at the verified entry point. - // BE AWARE: the current pc (this) points to the instruction after the - // "illtrap" location. - address sig_addr = ((address) this) - 2; - return nm->verified_entry_point() == sig_addr; -} - bool NativeInstruction::is_jump() { unsigned long inst; Assembler::get_instruction((address)this, &inst); @@ -620,19 +599,6 @@ void NativeJump::verify() { fatal("this is not a `NativeJump' site"); } -// Patch atomically with an illtrap. -void NativeJump::patch_verified_entry(address entry, address verified_entry, address dest) { - ResourceMark rm; - int code_size = 2; - CodeBuffer cb(verified_entry, code_size + 1); - MacroAssembler* a = new MacroAssembler(&cb); -#ifdef COMPILER2 - assert(dest == SharedRuntime::get_handle_wrong_method_stub(), "expected fixed destination of patch"); -#endif - a->z_illtrap(); - ICache::invalidate_range(verified_entry, code_size); -} - #undef LUCY_DBG //------------------------------------- diff --git a/src/hotspot/cpu/s390/nativeInst_s390.hpp b/src/hotspot/cpu/s390/nativeInst_s390.hpp index fcae833769f..8678a981f05 100644 --- a/src/hotspot/cpu/s390/nativeInst_s390.hpp +++ b/src/hotspot/cpu/s390/nativeInst_s390.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2016, 2024 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -609,11 +609,6 @@ class NativeJump: public NativeInstruction { // Insertion of native jump instruction. static void insert(address code_pos, address entry); - - // MT-safe insertion of native jump at verified method entry. - static void check_verified_entry_alignment(address entry, address verified_entry) { } - - static void patch_verified_entry(address entry, address verified_entry, address dest); }; //------------------------------------- diff --git a/src/hotspot/cpu/zero/nativeInst_zero.cpp b/src/hotspot/cpu/zero/nativeInst_zero.cpp index 0d2747f7fa6..6b6e0eecad2 100644 --- a/src/hotspot/cpu/zero/nativeInst_zero.cpp +++ b/src/hotspot/cpu/zero/nativeInst_zero.cpp @@ -28,17 +28,3 @@ #include "interpreter/zero/zeroInterpreter.hpp" #include "nativeInst_zero.hpp" #include "runtime/sharedRuntime.hpp" - -// This method is called by nmethod::make_not_entrant to -// insert a jump to SharedRuntime::get_handle_wrong_method_stub() -// (dest) at the start of a compiled method (verified_entry) to avoid -// a race where a method is invoked while being made non-entrant. - -void NativeJump::patch_verified_entry(address entry, - address verified_entry, - address dest) { - assert(dest == SharedRuntime::get_handle_wrong_method_stub(), "should be"); - - ((ZeroEntry*) verified_entry)->set_entry_point( - (address) ZeroInterpreter::normal_entry); -} diff --git a/src/hotspot/cpu/zero/nativeInst_zero.hpp b/src/hotspot/cpu/zero/nativeInst_zero.hpp index fd8f03f1a59..399a8e96bc3 100644 --- a/src/hotspot/cpu/zero/nativeInst_zero.hpp +++ b/src/hotspot/cpu/zero/nativeInst_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved. * Copyright 2007 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -177,14 +177,6 @@ class NativeJump : public NativeInstruction { void set_jump_destination(address dest) { ShouldNotCallThis(); } - - static void check_verified_entry_alignment(address entry, - address verified_entry) { - } - - static void patch_verified_entry(address entry, - address verified_entry, - address dest); }; inline NativeJump* nativeJump_at(address address) { diff --git a/src/hotspot/os_cpu/aix_ppc/os_aix_ppc.cpp b/src/hotspot/os_cpu/aix_ppc/os_aix_ppc.cpp index 3dbb8adddd6..98b17aaacfc 100644 --- a/src/hotspot/os_cpu/aix_ppc/os_aix_ppc.cpp +++ b/src/hotspot/os_cpu/aix_ppc/os_aix_ppc.cpp @@ -229,16 +229,7 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info, CodeBlob *cb = nullptr; int stop_type = -1; - // Handle signal from NativeJump::patch_verified_entry(). - if (sig == SIGILL && nativeInstruction_at(pc)->is_sigill_not_entrant()) { - if (TraceTraps) { - tty->print_cr("trap: not_entrant"); - } - stub = SharedRuntime::get_handle_wrong_method_stub(); - goto run_stub; - } - - else if ((sig == (USE_POLL_BIT_ONLY ? SIGTRAP : SIGSEGV)) && + if ((sig == (USE_POLL_BIT_ONLY ? SIGTRAP : SIGSEGV)) && ((NativeInstruction*)pc)->is_safepoint_poll() && CodeCache::contains((void*) pc) && ((cb = CodeCache::find_blob(pc)) != nullptr) && diff --git a/src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp b/src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp index ad32ee150e8..b7556ca69da 100644 --- a/src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp +++ b/src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp @@ -271,14 +271,7 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info, // Java thread running in Java code => find exception handler if any // a fault inside compiled code, the interpreter, or a stub - // Handle signal from NativeJump::patch_verified_entry(). - if ((sig == SIGILL) - && nativeInstruction_at(pc)->is_sigill_not_entrant()) { - if (TraceTraps) { - tty->print_cr("trap: not_entrant"); - } - stub = SharedRuntime::get_handle_wrong_method_stub(); - } else if ((sig == SIGSEGV || sig == SIGBUS) && SafepointMechanism::is_poll_address((address)info->si_addr)) { + if ((sig == SIGSEGV || sig == SIGBUS) && SafepointMechanism::is_poll_address((address)info->si_addr)) { stub = SharedRuntime::get_poll_stub(pc); #if defined(__APPLE__) // 32-bit Darwin reports a SIGBUS for nearly all memory access exceptions. diff --git a/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp b/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp index 6900283418d..e565f353382 100644 --- a/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp +++ b/src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp @@ -232,14 +232,7 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info, // Java thread running in Java code => find exception handler if any // a fault inside compiled code, the interpreter, or a stub - // Handle signal from NativeJump::patch_verified_entry(). - if ((sig == SIGILL || sig == SIGTRAP) - && nativeInstruction_at(pc)->is_sigill_not_entrant()) { - if (TraceTraps) { - tty->print_cr("trap: not_entrant (%s)", (sig == SIGTRAP) ? "SIGTRAP" : "SIGILL"); - } - stub = SharedRuntime::get_handle_wrong_method_stub(); - } else if (sig == SIGSEGV && SafepointMechanism::is_poll_address((address)info->si_addr)) { + if (sig == SIGSEGV && SafepointMechanism::is_poll_address((address)info->si_addr)) { stub = SharedRuntime::get_poll_stub(pc); } else if (sig == SIGBUS /* && info->si_code == BUS_OBJERR */) { // BugId 4454115: A read from a MappedByteBuffer can fault diff --git a/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp b/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp index 5fe37be0d20..55618947143 100644 --- a/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp +++ b/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp @@ -258,15 +258,7 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info, CodeBlob *cb = nullptr; int stop_type = -1; - // Handle signal from NativeJump::patch_verified_entry(). - if (sig == SIGILL && nativeInstruction_at(pc)->is_sigill_not_entrant()) { - if (TraceTraps) { - tty->print_cr("trap: not_entrant"); - } - stub = SharedRuntime::get_handle_wrong_method_stub(); - } - - else if ((sig == (USE_POLL_BIT_ONLY ? SIGTRAP : SIGSEGV)) && + if ((sig == (USE_POLL_BIT_ONLY ? SIGTRAP : SIGSEGV)) && // A linux-ppc64 kernel before 2.6.6 doesn't set si_addr on some segfaults // in 64bit mode (cf. http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.6), // especially when we try to read from the safepoint polling page. So the check diff --git a/src/hotspot/os_cpu/linux_riscv/os_linux_riscv.cpp b/src/hotspot/os_cpu/linux_riscv/os_linux_riscv.cpp index 8366a7249fa..7a5929b0f41 100644 --- a/src/hotspot/os_cpu/linux_riscv/os_linux_riscv.cpp +++ b/src/hotspot/os_cpu/linux_riscv/os_linux_riscv.cpp @@ -223,14 +223,7 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info, // Java thread running in Java code => find exception handler if any // a fault inside compiled code, the interpreter, or a stub - // Handle signal from NativeJump::patch_verified_entry(). - if ((sig == SIGILL || sig == SIGTRAP) - && nativeInstruction_at(pc)->is_sigill_not_entrant()) { - if (TraceTraps) { - tty->print_cr("trap: not_entrant (%s)", (sig == SIGTRAP) ? "SIGTRAP" : "SIGILL"); - } - stub = SharedRuntime::get_handle_wrong_method_stub(); - } else if (sig == SIGSEGV && SafepointMechanism::is_poll_address((address)info->si_addr)) { + if (sig == SIGSEGV && SafepointMechanism::is_poll_address((address)info->si_addr)) { stub = SharedRuntime::get_poll_stub(pc); } else if (sig == SIGBUS /* && info->si_code == BUS_OBJERR */) { // BugId 4454115: A read from a MappedByteBuffer can fault diff --git a/src/hotspot/os_cpu/linux_s390/os_linux_s390.cpp b/src/hotspot/os_cpu/linux_s390/os_linux_s390.cpp index 7e4d72fc066..4e074512e34 100644 --- a/src/hotspot/os_cpu/linux_s390/os_linux_s390.cpp +++ b/src/hotspot/os_cpu/linux_s390/os_linux_s390.cpp @@ -257,15 +257,7 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info, // Java thread running in Java code => find exception handler if any // a fault inside compiled code, the interpreter, or a stub - // Handle signal from NativeJump::patch_verified_entry(). - if (sig == SIGILL && nativeInstruction_at(pc)->is_sigill_not_entrant()) { - if (TraceTraps) { - tty->print_cr("trap: not_entrant (SIGILL)"); - } - stub = SharedRuntime::get_handle_wrong_method_stub(); - } - - else if (sig == SIGSEGV && + if (sig == SIGSEGV && SafepointMechanism::is_poll_address((address)info->si_addr)) { if (TraceTraps) { tty->print_cr("trap: safepoint_poll at " INTPTR_FORMAT " (SIGSEGV)", p2i(pc));