From 605f8dda3473241dbe8902ed512d2c5e5774b4d1 Mon Sep 17 00:00:00 2001 From: Gui Cao Date: Mon, 14 Oct 2024 14:15:20 +0000 Subject: [PATCH] 8341146: RISC-V: Unnecessary fences used for load-acquire in template interpreter Backport-of: a4ca6267e17815153f8fa119db19b97b1da2bd84 --- src/hotspot/cpu/riscv/templateTable_riscv.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/hotspot/cpu/riscv/templateTable_riscv.cpp b/src/hotspot/cpu/riscv/templateTable_riscv.cpp index 8c1eb12f9a6..69960e20ee7 100644 --- a/src/hotspot/cpu/riscv/templateTable_riscv.cpp +++ b/src/hotspot/cpu/riscv/templateTable_riscv.cpp @@ -179,7 +179,6 @@ void TemplateTable::patch_bytecode(Bytecodes::Code bc, Register bc_reg, __ la(temp_reg, Address(temp_reg, in_bytes(ResolvedFieldEntry::put_code_offset()))); } // Load-acquire the bytecode to match store-release in ResolvedFieldEntry::fill_in() - __ membar(MacroAssembler::AnyAny); __ lbu(temp_reg, Address(temp_reg, 0)); __ membar(MacroAssembler::LoadLoad | MacroAssembler::LoadStore); __ mv(bc_reg, bc); @@ -321,7 +320,6 @@ void TemplateTable::ldc(LdcType type) { // get type __ addi(x13, x11, tags_offset); __ add(x13, x10, x13); - __ membar(MacroAssembler::AnyAny); __ lbu(x13, Address(x13, 0)); __ membar(MacroAssembler::LoadLoad | MacroAssembler::LoadStore); @@ -2190,7 +2188,6 @@ void TemplateTable::resolve_cache_and_index_for_method(int byte_no, break; } // Load-acquire the bytecode to match store-release in InterpreterRuntime - __ membar(MacroAssembler::AnyAny); __ lbu(temp, Address(temp, 0)); __ membar(MacroAssembler::LoadLoad | MacroAssembler::LoadStore); @@ -2242,7 +2239,6 @@ void TemplateTable::resolve_cache_and_index_for_field(int byte_no, __ la(temp, Address(Rcache, in_bytes(ResolvedFieldEntry::put_code_offset()))); } // Load-acquire the bytecode to match store-release in ResolvedFieldEntry::fill_in() - __ membar(MacroAssembler::AnyAny); __ lbu(temp, Address(temp, 0)); __ membar(MacroAssembler::LoadLoad | MacroAssembler::LoadStore); __ mv(t0, (int) code); // have we resolved this bytecode? @@ -2404,7 +2400,6 @@ void TemplateTable::load_invokedynamic_entry(Register method) { Label resolved; __ load_resolved_indy_entry(cache, index); - __ membar(MacroAssembler::AnyAny); __ ld(method, Address(cache, in_bytes(ResolvedIndyEntry::method_offset()))); __ membar(MacroAssembler::LoadLoad | MacroAssembler::LoadStore); @@ -2419,7 +2414,6 @@ void TemplateTable::load_invokedynamic_entry(Register method) { __ call_VM(noreg, entry, method); // Update registers with resolved info __ load_resolved_indy_entry(cache, index); - __ membar(MacroAssembler::AnyAny); __ ld(method, Address(cache, in_bytes(ResolvedIndyEntry::method_offset()))); __ membar(MacroAssembler::LoadLoad | MacroAssembler::LoadStore); @@ -3534,7 +3528,6 @@ void TemplateTable::_new() { const int tags_offset = Array::base_offset_in_bytes(); __ add(t0, x10, x13); __ la(t0, Address(t0, tags_offset)); - __ membar(MacroAssembler::AnyAny); __ lbu(t0, t0); __ membar(MacroAssembler::LoadLoad | MacroAssembler::LoadStore); __ sub(t1, t0, (u1)JVM_CONSTANT_Class); @@ -3653,7 +3646,6 @@ void TemplateTable::checkcast() { // See if bytecode has already been quicked __ add(t0, x13, Array::base_offset_in_bytes()); __ add(x11, t0, x9); - __ membar(MacroAssembler::AnyAny); __ lbu(x11, x11); __ membar(MacroAssembler::LoadLoad | MacroAssembler::LoadStore); __ sub(t0, x11, (u1)JVM_CONSTANT_Class); @@ -3709,7 +3701,6 @@ void TemplateTable::instanceof() { // See if bytecode has already been quicked __ add(t0, x13, Array::base_offset_in_bytes()); __ add(x11, t0, x9); - __ membar(MacroAssembler::AnyAny); __ lbu(x11, x11); __ membar(MacroAssembler::LoadLoad | MacroAssembler::LoadStore); __ sub(t0, x11, (u1)JVM_CONSTANT_Class);