RFR(M): 8210887: Tweak C2 gc api for arraycopy

Roland Westrelin rwestrel at redhat.com
Fri Sep 28 09:06:17 UTC 2018


> gc/epsilon/TestManyThreads.java test failed on SPARC
> I add information and replay file to bug report.

Thanks for the test result. The fix is:

diff --git a/src/hotspot/share/opto/arraycopynode.cpp b/src/hotspot/share/opto/arraycopynode.cpp
--- a/src/hotspot/share/opto/arraycopynode.cpp
+++ b/src/hotspot/share/opto/arraycopynode.cpp
@@ -422,7 +422,8 @@
     Node *start_mem_dest = mm->memory_at(alias_idx_dest);
     Node* mem = start_mem_dest;
 
-    assert(copy_type != T_OBJECT, "only tightly coupled allocations for object arrays");
+    BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
+    assert(copy_type != T_OBJECT || !bs->array_copy_requires_gc_barriers(false, T_OBJECT, false, BarrierSetC2::Optimization), "only tightly coupled allocations for object arrays");
     bool same_alias = (alias_idx_src == alias_idx_dest);
 
     if (count > 0) {


New webrev:

http://cr.openjdk.java.net/~roland/8210887/webrev.02/

Roland.


More information about the hotspot-compiler-dev mailing list