# HG changeset patch # User jiefu # Date 1573821566 -28800 # Node ID 8c4c358272a9e4771f546d383bb7de09bb44da07 # Parent 52752425712c89c98e18f06db38715da726c0fef 8234232: [TESTBUG] gc/shenandoah/jvmti/TestHeapDump.java fails with -Xcomp Reviewed-by: zgu diff -r 52752425712c -r 8c4c358272a9 test/hotspot/jtreg/gc/shenandoah/jvmti/TestHeapDump.java --- 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