[11] RFR: Clean up Shenandoah GC epilogue

Aleksey Shipilev shade at redhat.com
Mon Aug 12 19:19:47 UTC 2019


Recent sh/jdk11 backports added JvmtiExport::gc_epilogue to ShenandoahMarkCompact twice. Funnily,
there is no such call in other Shenandoah code, and that is not catastrophic, because that call is
not even needed starting the very early JDK 8 (see JDK-8225437). So, I would like to remove it. It
is already gone in jdk/jdk, so this is 11-shenandoah fix.

While we are at it, move CodeCache::gc_epilogue into the same epilogue block. That call is also gone
in jdk/jdk, so this is again 11-shenandoah fix.

We would do the same for sh/jdk8, after LRB/nofwdptr gets there.

Fix:

diff -r 784ce5186930 src/hotspot/share/gc/shenandoah/shenandoahMarkCompact.cpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahMarkCompact.cpp Mon Aug 12 12:07:29 2019 +0200
+++ b/src/hotspot/share/gc/shenandoah/shenandoahMarkCompact.cpp Mon Aug 12 21:14:06 2019 +0200
@@ -174,11 +174,11 @@
     SharedRestorePreservedMarksTaskExecutor exec(heap->workers());
     _preserved_marks->restore(&exec);
     BiasedLocking::restore_marks();
     _preserved_marks->reclaim();

-    JvmtiExport::gc_epilogue();
+    CodeCache::gc_epilogue();
   }

   // Resize metaspace
   MetaspaceGC::compute_new_size();

@@ -186,13 +186,10 @@
   for (uint i = 0; i < heap->max_workers(); i++) {
     delete worker_slices[i];
   }
   FREE_C_HEAP_ARRAY(ShenandoahHeapRegionSet*, worker_slices);

-  CodeCache::gc_epilogue();
-  JvmtiExport::gc_epilogue();
-
   heap->set_full_gc_move_in_progress(false);
   heap->set_full_gc_in_progress(false);

   if (ShenandoahVerify) {
     heap->verifier()->verify_after_fullgc();

Testing: hotspot_gc_shenandoah

-- 
Thanks,
-Aleksey


More information about the shenandoah-dev mailing list