RFR: Quick-fix C1 assert with cherry-picked "8213199: GC abstraction for Assembler::needs_explicit_null_check()"

Roman Kennke rkennke at redhat.com
Tue Nov 13 12:22:26 UTC 2018


Yesterday I cherry-picked "8213199: GC abstraction for
Assembler::needs_explicit_null_check()". However, there is a problem
with this patch: for code that needs patching, it uses offset=-1 and it
is expected to return true for needs_explict_null_check(). However,
since we're checking the *range* [-8..page_size) in Shenandoah, this
would result in needs_explicit_null_check=false and later on fail in
funny ways like the assert that we have seen in specjvm.

A quick-fix is:
diff --git a/src/hotspot/share/asm/assembler.cpp
b/src/hotspot/share/asm/assembler.cpp
--- a/src/hotspot/share/asm/assembler.cpp
+++ b/src/hotspot/share/asm/assembler.cpp
@@ -334,6 +334,7 @@

 bool MacroAssembler::needs_explicit_null_check(intptr_t offset) {
   // Check if offset is outside of [-cell_header_size, os::vm_page_size)
+  if (offset == -1) return true;
   return offset < -Universe::heap()->cell_header_size() ||
          offset >= os::vm_page_size();
 }


I am also discussing it upstream and come up with a proper fix, until
then we should push this. OK?

Testing: tier3_gc_shenandoah plus spot-testing the specjvm test that
failed before

Roman



More information about the shenandoah-dev mailing list