Request for review JDK-8185591 guarantee(_byte_map[_guard_index] == last_card) failed: card table guard has been modified

Alexander Harlap alexander.harlap at oracle.com
Tue Nov 21 22:18:43 UTC 2017


Please review change for JDK-8185591 
<https://bugs.openjdk.java.net/browse/JDK-8185591> - 
guarantee(_byte_map[_guard_index] == last_card) failed: card table guard 
has been modified

Change is located at http://cr.openjdk.java.net/~aharlap/8185591/webrev.01/

Problem was in mishandling zero count in code generated by 
gen_write_ref_array_post_barrier().

Code is machine specific. Suggested fix for arm, sparc and x86_64.

No changes are  required for x86_32 - case zero count already is handled 
properly ( same as for s390 and ppc).

Aarch64 code have same problem as arm, sparc and x86_64, but I did not 
include this platform in suggested changeset.

I attached possiible change for aarch64 stubGenerator_aarch64.cpp.diff

Testing was done with JPRT.

Thank you,

Alex

-------------- next part --------------
diff -r b512c5781ca1 src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp
--- a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp	Tue Oct 10 16:29:04 2017 +0200
+++ b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp	Tue Nov 21 13:19:17 2017 -0500
@@ -701,13 +701,17 @@
           CardTableModRefBS* ct = (CardTableModRefBS*)bs;
           assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code");
 
-          Label L_loop;
+          Label L_loop, L_done;
 
            __ lsr(start, start, CardTableModRefBS::card_shift);
            __ lsr(end, end, CardTableModRefBS::card_shift);
            __ sub(end, end, start); // number of bytes to copy
 
           const Register count = end; // 'end' register contains bytes count now
+
+           __ cmp(count, 0);
+           __ br(Assembler::LT, L_done) // count < 0 - nothing to do
+
           __ load_byte_map_base(scratch);
           __ add(start, start, scratch);
           if (UseConcMarkSweepGC) {
@@ -717,6 +721,7 @@
           __ strb(zr, Address(start, count));
           __ subs(count, count, 1);
           __ br(Assembler::GE, L_loop);
+          __ BIND(L_done);
         }
         break;
       default:


More information about the hotspot-dev mailing list