From c4aba875708f1701e8f1b6fa9676f42e235ec461 Mon Sep 17 00:00:00 2001 From: Vladimir Kozlov Date: Tue, 21 Nov 2023 16:48:24 +0000 Subject: [PATCH] 8320272: Make method_entry_barrier address shared Reviewed-by: dlong --- src/hotspot/cpu/aarch64/c2_CodeStubs_aarch64.cpp | 2 +- .../aarch64/gc/shared/barrierSetAssembler_aarch64.cpp | 2 +- src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp | 2 +- src/hotspot/cpu/aarch64/stubRoutines_aarch64.cpp | 1 - src/hotspot/cpu/aarch64/stubRoutines_aarch64.hpp | 6 ------ .../cpu/arm/gc/shared/barrierSetAssembler_arm.cpp | 2 +- src/hotspot/cpu/arm/stubGenerator_arm.cpp | 2 +- src/hotspot/cpu/arm/stubRoutines_arm.cpp | 2 -- src/hotspot/cpu/arm/stubRoutines_arm.hpp | 2 -- .../cpu/ppc/gc/shared/barrierSetAssembler_ppc.cpp | 2 +- src/hotspot/cpu/ppc/stubGenerator_ppc.cpp | 4 ++-- src/hotspot/cpu/ppc/stubRoutines_ppc.hpp | 4 ---- src/hotspot/cpu/ppc/stubRoutines_ppc_64.cpp | 5 ----- src/hotspot/cpu/riscv/c2_CodeStubs_riscv.cpp | 9 ++++++--- .../cpu/riscv/gc/shared/barrierSetAssembler_riscv.cpp | 10 +++++++--- src/hotspot/cpu/riscv/stubGenerator_riscv.cpp | 2 +- src/hotspot/cpu/riscv/stubRoutines_riscv.cpp | 1 - src/hotspot/cpu/riscv/stubRoutines_riscv.hpp | 6 ------ .../cpu/s390/gc/shared/barrierSetAssembler_s390.cpp | 2 +- src/hotspot/cpu/s390/stubGenerator_s390.cpp | 4 ++-- src/hotspot/cpu/s390/stubRoutines_s390.cpp | 2 -- src/hotspot/cpu/s390/stubRoutines_s390.hpp | 4 ---- src/hotspot/cpu/x86/c2_CodeStubs_x86.cpp | 2 +- .../cpu/x86/gc/shared/barrierSetAssembler_x86.cpp | 4 ++-- src/hotspot/cpu/x86/stubGenerator_x86_32.cpp | 2 +- src/hotspot/cpu/x86/stubGenerator_x86_64.cpp | 2 +- src/hotspot/cpu/x86/stubRoutines_x86.hpp | 2 -- src/hotspot/cpu/x86/stubRoutines_x86_32.cpp | 1 - src/hotspot/cpu/x86/stubRoutines_x86_64.cpp | 1 - src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp | 3 +-- src/hotspot/share/runtime/stubRoutines.cpp | 1 + src/hotspot/share/runtime/stubRoutines.hpp | 4 ++++ 32 files changed, 36 insertions(+), 62 deletions(-) diff --git a/src/hotspot/cpu/aarch64/c2_CodeStubs_aarch64.cpp b/src/hotspot/cpu/aarch64/c2_CodeStubs_aarch64.cpp index 69ea37fa45b..dabafb9288b 100644 --- a/src/hotspot/cpu/aarch64/c2_CodeStubs_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/c2_CodeStubs_aarch64.cpp @@ -55,7 +55,7 @@ int C2EntryBarrierStub::max_size() const { void C2EntryBarrierStub::emit(C2_MacroAssembler& masm) { __ bind(entry()); - __ movptr(rscratch1, (uintptr_t) StubRoutines::aarch64::method_entry_barrier()); + __ lea(rscratch1, RuntimeAddress(StubRoutines::method_entry_barrier())); __ blr(rscratch1); __ b(continuation()); diff --git a/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.cpp index bfe29ddc8f7..070c685a07b 100644 --- a/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.cpp @@ -358,7 +358,7 @@ void BarrierSetAssembler::nmethod_entry_barrier(MacroAssembler* masm, Label* slo __ br(condition, barrier_target); if (slow_path == nullptr) { - __ movptr(rscratch1, (uintptr_t) StubRoutines::aarch64::method_entry_barrier()); + __ lea(rscratch1, RuntimeAddress(StubRoutines::method_entry_barrier())); __ blr(rscratch1); __ b(skip_barrier); diff --git a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp index adf180d219c..97ca90ac764 100644 --- a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp @@ -8393,7 +8393,7 @@ class StubGenerator: public StubCodeGenerator { BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod(); if (bs_nm != nullptr) { - StubRoutines::aarch64::_method_entry_barrier = generate_method_entry_barrier(); + StubRoutines::_method_entry_barrier = generate_method_entry_barrier(); } StubRoutines::aarch64::_spin_wait = generate_spin_wait(); diff --git a/src/hotspot/cpu/aarch64/stubRoutines_aarch64.cpp b/src/hotspot/cpu/aarch64/stubRoutines_aarch64.cpp index 3b6d3b5c40a..80875a3b3cd 100644 --- a/src/hotspot/cpu/aarch64/stubRoutines_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/stubRoutines_aarch64.cpp @@ -56,7 +56,6 @@ address StubRoutines::aarch64::_string_indexof_linear_ll = nullptr; address StubRoutines::aarch64::_string_indexof_linear_uu = nullptr; address StubRoutines::aarch64::_string_indexof_linear_ul = nullptr; address StubRoutines::aarch64::_large_byte_array_inflate = nullptr; -address StubRoutines::aarch64::_method_entry_barrier = nullptr; static void empty_spin_wait() { } address StubRoutines::aarch64::_spin_wait = CAST_FROM_FN_PTR(address, empty_spin_wait); diff --git a/src/hotspot/cpu/aarch64/stubRoutines_aarch64.hpp b/src/hotspot/cpu/aarch64/stubRoutines_aarch64.hpp index 2fcb35a1ae1..e6438908ce4 100644 --- a/src/hotspot/cpu/aarch64/stubRoutines_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/stubRoutines_aarch64.hpp @@ -71,8 +71,6 @@ class aarch64 { static address _string_indexof_linear_ul; static address _large_byte_array_inflate; - static address _method_entry_barrier; - static address _spin_wait; static bool _completed; @@ -179,10 +177,6 @@ class aarch64 { return _large_byte_array_inflate; } - static address method_entry_barrier() { - return _method_entry_barrier; - } - static address spin_wait() { return _spin_wait; } diff --git a/src/hotspot/cpu/arm/gc/shared/barrierSetAssembler_arm.cpp b/src/hotspot/cpu/arm/gc/shared/barrierSetAssembler_arm.cpp index d6570283e60..9329876b808 100644 --- a/src/hotspot/cpu/arm/gc/shared/barrierSetAssembler_arm.cpp +++ b/src/hotspot/cpu/arm/gc/shared/barrierSetAssembler_arm.cpp @@ -227,7 +227,7 @@ void BarrierSetAssembler::nmethod_entry_barrier(MacroAssembler* masm) { __ cmp(tmp0, tmp1); __ b(skip, eq); - __ mov_address(tmp0, StubRoutines::Arm::method_entry_barrier()); + __ mov_address(tmp0, StubRoutines::method_entry_barrier()); __ call(tmp0); __ b(skip); diff --git a/src/hotspot/cpu/arm/stubGenerator_arm.cpp b/src/hotspot/cpu/arm/stubGenerator_arm.cpp index 6e5484c98cb..7f9645f749a 100644 --- a/src/hotspot/cpu/arm/stubGenerator_arm.cpp +++ b/src/hotspot/cpu/arm/stubGenerator_arm.cpp @@ -3188,7 +3188,7 @@ class StubGenerator: public StubCodeGenerator { BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod(); if (bs_nm != nullptr) { - StubRoutines::Arm::_method_entry_barrier = generate_method_entry_barrier(); + StubRoutines::_method_entry_barrier = generate_method_entry_barrier(); } } diff --git a/src/hotspot/cpu/arm/stubRoutines_arm.cpp b/src/hotspot/cpu/arm/stubRoutines_arm.cpp index ab4df1cd337..0cd174d8da6 100644 --- a/src/hotspot/cpu/arm/stubRoutines_arm.cpp +++ b/src/hotspot/cpu/arm/stubRoutines_arm.cpp @@ -33,5 +33,3 @@ address StubRoutines::Arm::_partial_subtype_check = nullptr; address StubRoutines::_atomic_load_long_entry = nullptr; address StubRoutines::_atomic_store_long_entry = nullptr; - -address StubRoutines::Arm::_method_entry_barrier = nullptr; diff --git a/src/hotspot/cpu/arm/stubRoutines_arm.hpp b/src/hotspot/cpu/arm/stubRoutines_arm.hpp index 46e66d5dcfe..05c82881cd5 100644 --- a/src/hotspot/cpu/arm/stubRoutines_arm.hpp +++ b/src/hotspot/cpu/arm/stubRoutines_arm.hpp @@ -45,13 +45,11 @@ class Arm { static address _idiv_irem_entry; static address _partial_subtype_check; - static address _method_entry_barrier; public: static address idiv_irem_entry() { return _idiv_irem_entry; } static address partial_subtype_check() { return _partial_subtype_check; } - static address method_entry_barrier() { return _method_entry_barrier; } }; static bool returns_to_call_stub(address return_pc) { diff --git a/src/hotspot/cpu/ppc/gc/shared/barrierSetAssembler_ppc.cpp b/src/hotspot/cpu/ppc/gc/shared/barrierSetAssembler_ppc.cpp index fbe37a0a35c..f15e79534a2 100644 --- a/src/hotspot/cpu/ppc/gc/shared/barrierSetAssembler_ppc.cpp +++ b/src/hotspot/cpu/ppc/gc/shared/barrierSetAssembler_ppc.cpp @@ -188,7 +188,7 @@ void BarrierSetAssembler::nmethod_entry_barrier(MacroAssembler* masm, Register t __ block_comment("nmethod_entry_barrier (nmethod_entry_barrier) {"); // Load stub address using toc (fixed instruction size, unlike load_const_optimized) - __ calculate_address_from_global_toc(tmp, StubRoutines::ppc::nmethod_entry_barrier(), + __ calculate_address_from_global_toc(tmp, StubRoutines::method_entry_barrier(), true, true, false); // 2 instructions __ mtctr(tmp); diff --git a/src/hotspot/cpu/ppc/stubGenerator_ppc.cpp b/src/hotspot/cpu/ppc/stubGenerator_ppc.cpp index efcc8c89721..e26f03f52d8 100644 --- a/src/hotspot/cpu/ppc/stubGenerator_ppc.cpp +++ b/src/hotspot/cpu/ppc/stubGenerator_ppc.cpp @@ -3558,7 +3558,7 @@ class StubGenerator: public StubCodeGenerator { return start; } - address generate_nmethod_entry_barrier() { + address generate_method_entry_barrier() { __ align(CodeEntryAlignment); StubCodeMark mark(this, "StubRoutines", "nmethod_entry_barrier"); @@ -4806,7 +4806,7 @@ class StubGenerator: public StubCodeGenerator { // nmethod entry barriers for concurrent class unloading BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod(); if (bs_nm != nullptr) { - StubRoutines::ppc::_nmethod_entry_barrier = generate_nmethod_entry_barrier(); + StubRoutines::_method_entry_barrier = generate_method_entry_barrier(); } // arraycopy stubs used by compilers diff --git a/src/hotspot/cpu/ppc/stubRoutines_ppc.hpp b/src/hotspot/cpu/ppc/stubRoutines_ppc.hpp index 1e1172c9ada..4db0227e81b 100644 --- a/src/hotspot/cpu/ppc/stubRoutines_ppc.hpp +++ b/src/hotspot/cpu/ppc/stubRoutines_ppc.hpp @@ -53,11 +53,7 @@ class ppc { friend class StubGenerator; private: - static address _nmethod_entry_barrier; - public: - static address nmethod_entry_barrier(); - static address generate_crc_constants(juint reverse_poly); }; diff --git a/src/hotspot/cpu/ppc/stubRoutines_ppc_64.cpp b/src/hotspot/cpu/ppc/stubRoutines_ppc_64.cpp index f2dc2144567..7df905b9068 100644 --- a/src/hotspot/cpu/ppc/stubRoutines_ppc_64.cpp +++ b/src/hotspot/cpu/ppc/stubRoutines_ppc_64.cpp @@ -206,8 +206,3 @@ address StubRoutines::ppc::generate_crc_constants(juint reverse_poly) { return consts; } - -address StubRoutines::ppc::_nmethod_entry_barrier = nullptr; -address StubRoutines::ppc::nmethod_entry_barrier() { - return _nmethod_entry_barrier; -} diff --git a/src/hotspot/cpu/riscv/c2_CodeStubs_riscv.cpp b/src/hotspot/cpu/riscv/c2_CodeStubs_riscv.cpp index e9556fe4dcf..d1c66ce1da7 100644 --- a/src/hotspot/cpu/riscv/c2_CodeStubs_riscv.cpp +++ b/src/hotspot/cpu/riscv/c2_CodeStubs_riscv.cpp @@ -60,10 +60,13 @@ int C2EntryBarrierStub::max_size() const { void C2EntryBarrierStub::emit(C2_MacroAssembler& masm) { __ bind(entry()); + RuntimeAddress target(StubRoutines::method_entry_barrier()); + __ relocate(target.rspec(), [&] { + int32_t offset; + __ la_patchable(t0, target, offset); + __ jalr(ra, t0, offset); + }); - int32_t offset = 0; - __ movptr(t0, StubRoutines::riscv::method_entry_barrier(), offset); - __ jalr(ra, t0, offset); __ j(continuation()); // make guard value 4-byte aligned so that it can be accessed by atomic instructions on RISC-V diff --git a/src/hotspot/cpu/riscv/gc/shared/barrierSetAssembler_riscv.cpp b/src/hotspot/cpu/riscv/gc/shared/barrierSetAssembler_riscv.cpp index ed045c37a6f..a4440890b09 100644 --- a/src/hotspot/cpu/riscv/gc/shared/barrierSetAssembler_riscv.cpp +++ b/src/hotspot/cpu/riscv/gc/shared/barrierSetAssembler_riscv.cpp @@ -308,9 +308,13 @@ void BarrierSetAssembler::nmethod_entry_barrier(MacroAssembler* masm, Label* slo Label skip_barrier; __ beq(t0, t1, skip_barrier); - int32_t offset = 0; - __ movptr(t0, StubRoutines::riscv::method_entry_barrier(), offset); - __ jalr(ra, t0, offset); + RuntimeAddress target(StubRoutines::method_entry_barrier()); + __ relocate(target.rspec(), [&] { + int32_t offset; + __ la_patchable(t0, target, offset); + __ jalr(ra, t0, offset); + }); + __ j(skip_barrier); __ bind(local_guard); diff --git a/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp b/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp index 057c4783edf..e10357c4a5a 100644 --- a/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp +++ b/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp @@ -4813,7 +4813,7 @@ static const int64_t right_3_bits = right_n_bits(3); BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod(); if (bs_nm != nullptr) { - StubRoutines::riscv::_method_entry_barrier = generate_method_entry_barrier(); + StubRoutines::_method_entry_barrier = generate_method_entry_barrier(); } StubRoutines::_upcall_stub_exception_handler = generate_upcall_stub_exception_handler(); diff --git a/src/hotspot/cpu/riscv/stubRoutines_riscv.cpp b/src/hotspot/cpu/riscv/stubRoutines_riscv.cpp index dd72044b0ce..39068a9a026 100644 --- a/src/hotspot/cpu/riscv/stubRoutines_riscv.cpp +++ b/src/hotspot/cpu/riscv/stubRoutines_riscv.cpp @@ -53,6 +53,5 @@ address StubRoutines::riscv::_string_indexof_linear_ll = nullptr; address StubRoutines::riscv::_string_indexof_linear_uu = nullptr; address StubRoutines::riscv::_string_indexof_linear_ul = nullptr; address StubRoutines::riscv::_large_byte_array_inflate = nullptr; -address StubRoutines::riscv::_method_entry_barrier = nullptr; bool StubRoutines::riscv::_completed = false; diff --git a/src/hotspot/cpu/riscv/stubRoutines_riscv.hpp b/src/hotspot/cpu/riscv/stubRoutines_riscv.hpp index fde88f5e30b..7c604e8c11c 100644 --- a/src/hotspot/cpu/riscv/stubRoutines_riscv.hpp +++ b/src/hotspot/cpu/riscv/stubRoutines_riscv.hpp @@ -70,8 +70,6 @@ class riscv { static address _string_indexof_linear_ul; static address _large_byte_array_inflate; - static address _method_entry_barrier; - static bool _completed; public: @@ -148,10 +146,6 @@ class riscv { return _large_byte_array_inflate; } - static address method_entry_barrier() { - return _method_entry_barrier; - } - static bool complete() { return _completed; } diff --git a/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.cpp b/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.cpp index 9613de903d9..480af074a4c 100644 --- a/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.cpp +++ b/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.cpp @@ -132,7 +132,7 @@ void BarrierSetAssembler::nmethod_entry_barrier(MacroAssembler* masm) { __ block_comment("nmethod_entry_barrier (nmethod_entry_barrier) {"); // Load jump addr: - __ load_const(Z_R1_scratch, (uint64_t)StubRoutines::zarch::nmethod_entry_barrier()); // 2*6 bytes + __ load_const(Z_R1_scratch, (uint64_t)StubRoutines::method_entry_barrier()); // 2*6 bytes // Load value from current java object: __ z_lg(Z_R0_scratch, in_bytes(bs_nm->thread_disarmed_guard_value_offset()), Z_thread); // 6 bytes diff --git a/src/hotspot/cpu/s390/stubGenerator_s390.cpp b/src/hotspot/cpu/s390/stubGenerator_s390.cpp index 64d8d9fa978..db686158f21 100644 --- a/src/hotspot/cpu/s390/stubGenerator_s390.cpp +++ b/src/hotspot/cpu/s390/stubGenerator_s390.cpp @@ -3015,7 +3015,7 @@ class StubGenerator: public StubCodeGenerator { return start; } - address generate_nmethod_entry_barrier() { + address generate_method_entry_barrier() { __ align(CodeEntryAlignment); StubCodeMark mark(this, "StubRoutines", "nmethod_entry_barrier"); @@ -3187,7 +3187,7 @@ class StubGenerator: public StubCodeGenerator { // nmethod entry barriers for concurrent class unloading BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod(); if (bs_nm != nullptr) { - StubRoutines::zarch::_nmethod_entry_barrier = generate_nmethod_entry_barrier(); + StubRoutines::_method_entry_barrier = generate_method_entry_barrier(); } StubRoutines::_upcall_stub_exception_handler = generate_upcall_stub_exception_handler(); diff --git a/src/hotspot/cpu/s390/stubRoutines_s390.cpp b/src/hotspot/cpu/s390/stubRoutines_s390.cpp index 711de63fdea..2a60f71557c 100644 --- a/src/hotspot/cpu/s390/stubRoutines_s390.cpp +++ b/src/hotspot/cpu/s390/stubRoutines_s390.cpp @@ -38,8 +38,6 @@ address StubRoutines::zarch::_partial_subtype_check = nullptr; // Comapct string intrinsics: Translate table for string inflate intrinsic. Used by trot instruction. address StubRoutines::zarch::_trot_table_addr = nullptr; -address StubRoutines::zarch::_nmethod_entry_barrier = nullptr; - int StubRoutines::zarch::_atomic_memory_operation_lock = StubRoutines::zarch::unlocked; #define __ masm-> diff --git a/src/hotspot/cpu/s390/stubRoutines_s390.hpp b/src/hotspot/cpu/s390/stubRoutines_s390.hpp index 68e6b3f2b47..7116d441715 100644 --- a/src/hotspot/cpu/s390/stubRoutines_s390.hpp +++ b/src/hotspot/cpu/s390/stubRoutines_s390.hpp @@ -80,8 +80,6 @@ class zarch { static address _trot_table_addr; static jlong _trot_table[TROT_COLUMN_SIZE]; - static address _nmethod_entry_barrier; - public: // Global lock for everyone who needs to use atomic_compare_and_exchange // or atomic_increment -- should probably use more locks for more @@ -102,8 +100,6 @@ class zarch { // Comapct string intrinsics: Translate table for string inflate intrinsic. Used by trot instruction. static void generate_load_trot_table_addr(MacroAssembler* masm, Register table); - - static address nmethod_entry_barrier() { return _nmethod_entry_barrier; } }; #endif // CPU_S390_STUBROUTINES_S390_HPP diff --git a/src/hotspot/cpu/x86/c2_CodeStubs_x86.cpp b/src/hotspot/cpu/x86/c2_CodeStubs_x86.cpp index cd5e87b29ec..b9b4e8af02c 100644 --- a/src/hotspot/cpu/x86/c2_CodeStubs_x86.cpp +++ b/src/hotspot/cpu/x86/c2_CodeStubs_x86.cpp @@ -69,7 +69,7 @@ int C2EntryBarrierStub::max_size() const { void C2EntryBarrierStub::emit(C2_MacroAssembler& masm) { __ bind(entry()); - __ call(RuntimeAddress(StubRoutines::x86::method_entry_barrier())); + __ call(RuntimeAddress(StubRoutines::method_entry_barrier())); __ jmp(continuation(), false /* maybe_short */); } diff --git a/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.cpp b/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.cpp index 6a7ac54f473..f09e1c92162 100644 --- a/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.cpp @@ -402,7 +402,7 @@ void BarrierSetAssembler::nmethod_entry_barrier(MacroAssembler* masm, Label* slo } else { Label done; __ jccb(Assembler::equal, done); - __ call(RuntimeAddress(StubRoutines::x86::method_entry_barrier())); + __ call(RuntimeAddress(StubRoutines::method_entry_barrier())); __ bind(done); } } @@ -423,7 +423,7 @@ void BarrierSetAssembler::nmethod_entry_barrier(MacroAssembler* masm, Label*, La __ cmpl_imm32(disarmed_addr, 0); __ pop(tmp); __ jcc(Assembler::equal, continuation); - __ call(RuntimeAddress(StubRoutines::x86::method_entry_barrier())); + __ call(RuntimeAddress(StubRoutines::method_entry_barrier())); __ bind(continuation); } #endif diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_32.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_32.cpp index d21233b258f..e6305ded696 100644 --- a/src/hotspot/cpu/x86/stubGenerator_x86_32.cpp +++ b/src/hotspot/cpu/x86/stubGenerator_x86_32.cpp @@ -4218,7 +4218,7 @@ class StubGenerator: public StubCodeGenerator { BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod(); if (bs_nm != nullptr) { - StubRoutines::x86::_method_entry_barrier = generate_method_entry_barrier(); + StubRoutines::_method_entry_barrier = generate_method_entry_barrier(); } } diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp index 894f225d3bc..c73e0759b57 100644 --- a/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp +++ b/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp @@ -4052,7 +4052,7 @@ void StubGenerator::generate_final_stubs() { BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod(); if (bs_nm != nullptr) { - StubRoutines::x86::_method_entry_barrier = generate_method_entry_barrier(); + StubRoutines::_method_entry_barrier = generate_method_entry_barrier(); } if (UseVectorizedMismatchIntrinsic) { diff --git a/src/hotspot/cpu/x86/stubRoutines_x86.hpp b/src/hotspot/cpu/x86/stubRoutines_x86.hpp index 375cefd5e1d..6c602324f3e 100644 --- a/src/hotspot/cpu/x86/stubRoutines_x86.hpp +++ b/src/hotspot/cpu/x86/stubRoutines_x86.hpp @@ -132,8 +132,6 @@ class x86 { static address _verify_mxcsr_entry; - static address _method_entry_barrier; - // masks and table for CRC32 static const uint64_t _crc_by128_masks[]; static const juint _crc_table[]; diff --git a/src/hotspot/cpu/x86/stubRoutines_x86_32.cpp b/src/hotspot/cpu/x86/stubRoutines_x86_32.cpp index 0da5a3eca7d..7916a3b3630 100644 --- a/src/hotspot/cpu/x86/stubRoutines_x86_32.cpp +++ b/src/hotspot/cpu/x86/stubRoutines_x86_32.cpp @@ -32,7 +32,6 @@ // a description of how to extend it, see the stubRoutines.hpp file. address StubRoutines::x86::_verify_fpu_cntrl_wrd_entry = nullptr; -address StubRoutines::x86::_method_entry_barrier = nullptr; address StubRoutines::x86::_d2i_wrapper = nullptr; address StubRoutines::x86::_d2l_wrapper = nullptr; diff --git a/src/hotspot/cpu/x86/stubRoutines_x86_64.cpp b/src/hotspot/cpu/x86/stubRoutines_x86_64.cpp index 4287580e7f9..417b32eb4a6 100644 --- a/src/hotspot/cpu/x86/stubRoutines_x86_64.cpp +++ b/src/hotspot/cpu/x86/stubRoutines_x86_64.cpp @@ -44,5 +44,4 @@ address StubRoutines::x86::_float_sign_mask = nullptr; address StubRoutines::x86::_float_sign_flip = nullptr; address StubRoutines::x86::_double_sign_mask = nullptr; address StubRoutines::x86::_double_sign_flip = nullptr; -address StubRoutines::x86::_method_entry_barrier = nullptr; diff --git a/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp b/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp index e40e5ee856e..a3e2bd525ec 100644 --- a/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp +++ b/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp @@ -146,8 +146,7 @@ void CompilerToVM::Data::initialize(JVMCI_TRAPS) { BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod(); if (bs_nm != nullptr) { thread_disarmed_guard_value_offset = in_bytes(bs_nm->thread_disarmed_guard_value_offset()); - AMD64_ONLY(nmethod_entry_barrier = StubRoutines::x86::method_entry_barrier()); - AARCH64_ONLY(nmethod_entry_barrier = StubRoutines::aarch64::method_entry_barrier()); + nmethod_entry_barrier = StubRoutines::method_entry_barrier(); BarrierSetAssembler* bs_asm = BarrierSet::barrier_set()->barrier_set_assembler(); AARCH64_ONLY(BarrierSetAssembler_nmethod_patching_type = (int) bs_asm->nmethod_patching_type()); AARCH64_ONLY(BarrierSetAssembler_patching_epoch_addr = bs_asm->patching_epoch_addr()); diff --git a/src/hotspot/share/runtime/stubRoutines.cpp b/src/hotspot/share/runtime/stubRoutines.cpp index faeaedac55e..ff32240905d 100644 --- a/src/hotspot/share/runtime/stubRoutines.cpp +++ b/src/hotspot/share/runtime/stubRoutines.cpp @@ -176,6 +176,7 @@ address StubRoutines::_hf2f = nullptr; address StubRoutines::_vector_f_math[VectorSupport::NUM_VEC_SIZES][VectorSupport::NUM_SVML_OP] = {{nullptr}, {nullptr}}; address StubRoutines::_vector_d_math[VectorSupport::NUM_VEC_SIZES][VectorSupport::NUM_SVML_OP] = {{nullptr}, {nullptr}}; +address StubRoutines::_method_entry_barrier = nullptr; address StubRoutines::_array_sort = nullptr; address StubRoutines::_array_partition = nullptr; diff --git a/src/hotspot/share/runtime/stubRoutines.hpp b/src/hotspot/share/runtime/stubRoutines.hpp index 77d968263f7..3000ed454a1 100644 --- a/src/hotspot/share/runtime/stubRoutines.hpp +++ b/src/hotspot/share/runtime/stubRoutines.hpp @@ -256,6 +256,8 @@ class StubRoutines: AllStatic { static address _f2hf; static address _hf2f; + static address _method_entry_barrier; + static address _cont_thaw; static address _cont_returnBarrier; static address _cont_returnBarrierExc; @@ -460,6 +462,8 @@ class StubRoutines: AllStatic { return ((hf2f_stub_t)_hf2f)(x); } + static address method_entry_barrier() { return _method_entry_barrier; } + static address cont_thaw() { return _cont_thaw; } static address cont_returnBarrier() { return _cont_returnBarrier; } static address cont_returnBarrierExc(){return _cont_returnBarrierExc; }