changeset 56958:8c4c358272a9

8234232: [TESTBUG] gc/shenandoah/jvmti/TestHeapDump.java fails with -Xcomp Reviewed-by: zgu
author jiefu
date Fri, 15 Nov 2019 20:39:26 +0800
parents 52752425712c
children fe87a92570db
files test/hotspot/jtreg/gc/shenandoah/jvmti/TestHeapDump.java
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/test/hotspot/jtreg/gc/shenandoah/jvmti/TestHeapDump.java	Fri Nov 15 19:38:31 2019 +0800
+++ b/test/hotspot/jtreg/gc/shenandoah/jvmti/TestHeapDump.java	Fri Nov 15 20:39:26 2019 +0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Red Hat, Inc. All rights reserved.
+ * Copyright (c) 2017, 2019, 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,8 @@
  * @run main/othervm/native/timeout=300 -agentlib:TestHeapDump -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx128m -XX:ShenandoahGCHeuristics=aggressive -XX:-UseCompressedOops TestHeapDump
  */
 
+import java.lang.ref.Reference;
+
 public class TestHeapDump {
 
     private static final int NUM_ITER = 10000;
@@ -86,6 +88,8 @@
                 throw new RuntimeException("Expected " + EXPECTED_OBJECTS + " objects, but got " + numObjs);
             }
         }
+        Reference.reachabilityFence(array);
+        Reference.reachabilityFence(localRoot);
     }
 
     // We look for the instances of this class during the heap scan