Need sponsor to push attached 8185591 into http://hg.openjdk.java.net/jdk10/hs

Alexander Harlap alexander.harlap at oracle.com
Thu Nov 23 00:25:29 UTC 2017


I need a sponsor to push attached 8185591.open.patch - 
guarantee(_byte_map[_guard_index] == last_card) failed: card table guard 
has been modified.

Patch should go into jdk10/hs.

Reviewed by Thomas Schatzl  and Kim Barrett.

Thank you,

Alex

-------------- next part --------------
# HG changeset patch
# User aharlap
# Date 1511395081 18000
# Node ID e7c78fc0a6525dc5bcd15bd766ea5c4a240efcf5
# Parent  d85284ccd1bd865ebb1391d921be7a8ebfc5f2c9
8185591: guarantee(_byte_map[_guard_index] == last_card) failed: card table guard has been modified
Summary: handle zero count in gen_write_ref_array_post_barrier()
Reviewed-by: tschatzl, kbarrett

diff -r d85284ccd1bd -r e7c78fc0a652 src/hotspot/cpu/arm/stubGenerator_arm.cpp
--- a/src/hotspot/cpu/arm/stubGenerator_arm.cpp	Fri Nov 03 17:09:25 2017 -0700
+++ b/src/hotspot/cpu/arm/stubGenerator_arm.cpp	Wed Nov 22 18:58:01 2017 -0500
@@ -2968,7 +2968,9 @@
         CardTableModRefBS* ct = barrier_set_cast<CardTableModRefBS>(bs);
         assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code");
 
-        Label L_cardtable_loop;
+        Label L_cardtable_loop, L_done;
+
+        __ cbz_32(count, L_done); // zero count - nothing to do
 
         __ add_ptr_scaled_int32(count, addr, count, LogBytesPerHeapOop);
         __ sub(count, count, BytesPerHeapOop);                            // last addr
@@ -2987,6 +2989,7 @@
         __ strb(zero, Address(addr, 1, post_indexed));
         __ subs(count, count, 1);
         __ b(L_cardtable_loop, ge);
+        __ BIND(L_done);
       }
       break;
     case BarrierSet::ModRef:
diff -r d85284ccd1bd -r e7c78fc0a652 src/hotspot/cpu/sparc/stubGenerator_sparc.cpp
--- a/src/hotspot/cpu/sparc/stubGenerator_sparc.cpp	Fri Nov 03 17:09:25 2017 -0700
+++ b/src/hotspot/cpu/sparc/stubGenerator_sparc.cpp	Wed Nov 22 18:58:01 2017 -0500
@@ -898,7 +898,9 @@
           assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code");
           assert_different_registers(addr, count, tmp);
 
-          Label L_loop;
+          Label L_loop, L_done;
+
+          __ cmp_and_br_short(count, 0, Assembler::equal, Assembler::pt, L_done); // zero count - nothing to do
 
           __ sll_ptr(count, LogBytesPerHeapOop, count);
           __ sub(count, BytesPerHeapOop, count);
@@ -914,6 +916,7 @@
           __ subcc(count, 1, count);
           __ brx(Assembler::greaterEqual, false, Assembler::pt, L_loop);
           __ delayed()->add(addr, 1, addr);
+        __ BIND(L_done);
         }
         break;
       case BarrierSet::ModRef:
diff -r d85284ccd1bd -r e7c78fc0a652 src/hotspot/cpu/x86/stubGenerator_x86_64.cpp
--- a/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp	Fri Nov 03 17:09:25 2017 -0700
+++ b/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp	Wed Nov 22 18:58:01 2017 -0500
@@ -1264,9 +1264,12 @@
           CardTableModRefBS* ct = barrier_set_cast<CardTableModRefBS>(bs);
           assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code");
 
-          Label L_loop;
+          Label L_loop, L_done;
           const Register end = count;
 
+          __ testl(count, count);
+          __ jcc(Assembler::zero, L_done); // zero count - nothing to do
+
           __ leaq(end, Address(start, count, TIMES_OOP, 0));  // end == start+count*oop_size
           __ subptr(end, BytesPerHeapOop); // end - 1 to make inclusive
           __ shrptr(start, CardTableModRefBS::card_shift);
@@ -1280,6 +1283,7 @@
           __ movb(Address(start, count, Address::times_1), 0);
           __ decrement(count);
           __ jcc(Assembler::greaterEqual, L_loop);
+        __ BIND(L_done);
         }
         break;
       default:


More information about the hotspot-gc-dev mailing list