changeset 57621:e92c90eaaaf4

8236902: Shenandoah: Missing string dedup roots in all root scanner Reviewed-by: rkennke
author zgu
date Fri, 10 Jan 2020 07:21:32 -0500
parents 3e80284479b0
children c9537fcd9b5c
files src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.hpp src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.inline.hpp src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.cpp test/hotspot/jtreg/gc/shenandoah/jvmti/TestHeapDump.java
diffstat 4 files changed, 17 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.hpp	Fri Jan 10 02:52:25 2020 +0000
+++ b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.hpp	Fri Jan 10 07:21:32 2020 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2019, Red Hat, Inc. All rights reserved.
+ * Copyright (c) 2015, 2020, Red Hat, Inc. All rights reserved.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
@@ -226,6 +226,7 @@
   ShenandoahThreadRoots                                     _thread_roots;
   ShenandoahCodeCacheRoots<ITR>                             _code_roots;
   ShenandoahVMRoots<false /*concurrent*/ >                  _vm_roots;
+  ShenandoahStringDedupRoots                                _dedup_roots;
   ShenandoahClassLoaderDataRoots<false /*concurrent*/, false /*single threaded*/>
                                                             _cld_roots;
 public:
--- a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.inline.hpp	Fri Jan 10 02:52:25 2020 +0000
+++ b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.inline.hpp	Fri Jan 10 07:21:32 2020 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019, Red Hat, Inc. All rights reserved.
+ * Copyright (c) 2019, 2020, Red Hat, Inc. All rights reserved.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
@@ -250,6 +250,9 @@
   if (code != NULL && !ShenandoahConcurrentScanCodeRoots) {
     _code_roots.code_blobs_do(code, worker_id);
   }
+
+  AlwaysTrueClosure always_true;
+  _dedup_roots.oops_do(&always_true, oops, worker_id);
 }
 
 template <typename ITR>
--- a/src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.cpp	Fri Jan 10 02:52:25 2020 +0000
+++ b/src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.cpp	Fri Jan 10 07:21:32 2020 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, 2019, Red Hat, Inc. All rights reserved.
+ * Copyright (c) 2018, 2020, Red Hat, Inc. All rights reserved.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
@@ -193,9 +193,6 @@
       } else {
         _rp->roots_do(worker_id, &roots_cl, &cld_cl, &code_cl);
       }
-
-      AlwaysTrueClosure is_alive;
-      _dedup_roots.oops_do(&is_alive, &roots_cl, worker_id);
     }
   }
 };
--- a/test/hotspot/jtreg/gc/shenandoah/jvmti/TestHeapDump.java	Fri Jan 10 02:52:25 2020 +0000
+++ b/test/hotspot/jtreg/gc/shenandoah/jvmti/TestHeapDump.java	Fri Jan 10 07:21:32 2020 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2019, Red Hat, Inc. All rights reserved.
+ * Copyright (c) 2017, 2020, Red Hat, Inc. All rights reserved.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
@@ -40,6 +40,15 @@
  * @run main/othervm/native/timeout=300 -agentlib:TestHeapDump -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx128m -XX:ShenandoahGCHeuristics=aggressive -XX:-UseCompressedOops TestHeapDump
  */
 
+/**
+ * @test TestHeapDump
+ * @summary Tests JVMTI heap dumps
+ * @key gc
+ * @requires vm.gc.Shenandoah & !vm.graal.enabled
+ * @compile TestHeapDump.java
+ * @run main/othervm/native/timeout=300 -agentlib:TestHeapDump -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx128m -XX:ShenandoahGCHeuristics=aggressive                         -XX:+UseStringDeduplication TestHeapDump
+ */
+
 import java.lang.ref.Reference;
 
 public class TestHeapDump {