From f78f7805707f49033530acc66ba4c625847c2918 Mon Sep 17 00:00:00 2001 From: Tobias Hartmann Date: Thu, 10 Sep 2020 05:41:51 +0000 Subject: [PATCH] 8252889: Obsolete -XX:+InsertMemBarAfterArraycopy Reviewed-by: shade, adityam --- src/hotspot/share/opto/c2_globals.hpp | 3 --- src/hotspot/share/opto/macroArrayCopy.cpp | 14 +------------- src/hotspot/share/runtime/arguments.cpp | 1 + 3 files changed, 2 insertions(+), 16 deletions(-) diff --git a/src/hotspot/share/opto/c2_globals.hpp b/src/hotspot/share/opto/c2_globals.hpp index 4c7e50910e80c..18174aed8f7fc 100644 --- a/src/hotspot/share/opto/c2_globals.hpp +++ b/src/hotspot/share/opto/c2_globals.hpp @@ -384,9 +384,6 @@ product(bool, UseOnlyInlinedBimorphic, true, \ "Don't use BimorphicInlining if can't inline a second method") \ \ - product(bool, InsertMemBarAfterArraycopy, true, \ - "Insert memory barrier after arraycopy call") \ - \ develop(bool, SubsumeLoads, true, \ "Attempt to compile while subsuming loads into machine " \ "instructions.") \ diff --git a/src/hotspot/share/opto/macroArrayCopy.cpp b/src/hotspot/share/opto/macroArrayCopy.cpp index 8706563ff38b5..ad2de04092691 100644 --- a/src/hotspot/share/opto/macroArrayCopy.cpp +++ b/src/hotspot/share/opto/macroArrayCopy.cpp @@ -711,7 +711,7 @@ Node* PhaseMacroExpand::generate_arraycopy(ArrayCopyNode *ac, AllocateArrayNode* // a subsequent store that would make this object accessible by // other threads. insert_mem_bar(ctrl, &out_mem, Op_MemBarStoreStore); - } else if (InsertMemBarAfterArraycopy) { + } else { insert_mem_bar(ctrl, &out_mem, Op_MemBarCPUOrder); } @@ -1101,9 +1101,6 @@ void PhaseMacroExpand::expand_arraycopy_node(ArrayCopyNode *ac) { merge_mem = MergeMemNode::make(mem); transform_later(merge_mem); - RegionNode* slow_region = new RegionNode(1); - transform_later(slow_region); - AllocateArrayNode* alloc = NULL; if (ac->is_alloc_tightly_coupled()) { alloc = AllocateArrayNode::Ideal_array_allocation(dest, &_igvn); @@ -1176,15 +1173,6 @@ void PhaseMacroExpand::expand_arraycopy_node(ArrayCopyNode *ac) { // If a negative length guard was generated for the ArrayCopyNode, // the length of the array can never be negative. false, ac->has_negative_length_guard()); - - // Do not let reads from the destination float above the arraycopy. - // Since we cannot type the arrays, we don't know which slices - // might be affected. We could restrict this barrier only to those - // memory slices which pertain to array elements--but don't bother. - if (!InsertMemBarAfterArraycopy) { - // (If InsertMemBarAfterArraycopy, there is already one in place.) - insert_mem_bar(&ctrl, &mem, Op_MemBarCPUOrder); - } return; } diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp index 904976bb1f0d7..9b6a60db41cef 100644 --- a/src/hotspot/share/runtime/arguments.cpp +++ b/src/hotspot/share/runtime/arguments.cpp @@ -553,6 +553,7 @@ static SpecialFlag const special_jvm_flags[] = { { "UseNewFieldLayout", JDK_Version::jdk(15), JDK_Version::jdk(16), JDK_Version::jdk(17) }, { "UseSemaphoreGCThreadsSynchronization", JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) }, { "ForceNUMA", JDK_Version::jdk(15), JDK_Version::jdk(16), JDK_Version::jdk(17) }, + { "InsertMemBarAfterArraycopy", JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) }, #ifdef TEST_VERIFY_SPECIAL_JVM_FLAGS // These entries will generate build errors. Their purpose is to test the macros.