RFR [10]: Fix ciInstanceKlass::ensure_metadata_alive for Shenandoah

Aleksey Shipilev shade at redhat.com
Mon Apr 9 16:16:40 UTC 2018


On 04/09/2018 06:09 PM, Aleksey Shipilev wrote:
> Fix is trivial:
> 
> diff -r 177d2c56166c src/hotspot/share/ci/ciInstanceKlass.cpp
> --- a/src/hotspot/share/ci/ciInstanceKlass.cpp	Fri Apr 06 17:32:05 2018 +0200
> +++ b/src/hotspot/share/ci/ciInstanceKlass.cpp	Mon Apr 09 17:59:06 2018 +0200
> @@ -55,7 +55,7 @@
>  //
>  static void ensure_metadata_alive(oop metadata_holder) {
>  #if INCLUDE_ALL_GCS
> -  if (!UseG1GC) {
> +  if (!(UseG1GC || UseShenandoahGC)) {
>      return;
>    }
>    if (metadata_holder != NULL) {

Actually, we should use KALB instead, because it is a bit different for partial GC, and is
consistent with our other changes:

diff -r 177d2c56166c src/hotspot/share/ci/ciInstanceKlass.cpp
--- a/src/hotspot/share/ci/ciInstanceKlass.cpp	Fri Apr 06 17:32:05 2018 +0200
+++ b/src/hotspot/share/ci/ciInstanceKlass.cpp	Mon Apr 09 18:14:14 2018 +0200
@@ -55,11 +55,8 @@
 //
 static void ensure_metadata_alive(oop metadata_holder) {
 #if INCLUDE_ALL_GCS
-  if (!UseG1GC) {
-    return;
-  }
   if (metadata_holder != NULL) {
-    G1SATBCardTableModRefBS::enqueue(metadata_holder);
+    BarrierSet::barrier_set()->keep_alive_barrier(metadata_holder);
   }
 #endif
 }

-Aleksey


More information about the shenandoah-dev mailing list