1 /*
2 * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 package gc.shenandoah;
25
26 /* @test id=satb-100
27 * @requires vm.gc.Shenandoah
28 * @library /test/lib
29 * @build jdk.test.whitebox.WhiteBox
30 * @modules java.base
31 * @run main jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
32 * @run main/othervm
33 * -Xbootclasspath/a:.
34 * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
35 * -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCMode=satb -XX:ShenandoahGarbageThreshold=100 -Xmx100m
36 * gc.shenandoah.TestReferenceShortcutCycle
37 */
38
39 /* @test id=iu-100
40 * @requires vm.gc.Shenandoah
41 * @library /test/lib
42 * @build jdk.test.whitebox.WhiteBox
43 * @modules java.base
44 * @run main jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
45 * @run main/othervm
46 * -Xbootclasspath/a:.
47 * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
48 * -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGarbageThreshold=100 -Xmx100m
49 * gc.shenandoah.TestReferenceShortcutCycle
50 */
51
52 import java.lang.ref.PhantomReference;
53 import java.lang.ref.Reference;
54 import java.lang.ref.ReferenceQueue;
55 import java.lang.ref.WeakReference;
|
1 /*
2 * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 package gc.shenandoah;
25
26 /* @test id=satb-100
27 * @requires vm.gc.Shenandoah
28 * @library /test/lib
29 * @build jdk.test.whitebox.WhiteBox
30 * @modules java.base
31 * @run main jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
32 * @run main/othervm
33 * -Xbootclasspath/a:.
34 * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
35 * -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCMode=satb -XX:ShenandoahGarbageThreshold=100 -Xmx100m
36 * gc.shenandoah.TestReferenceShortcutCycle
37 */
38
39 /* @test id=generational-100
40 * @requires vm.gc.Shenandoah
41 * @library /test/lib
42 * @build jdk.test.whitebox.WhiteBox
43 * @modules java.base
44 * @run main jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
45 * @run main/othervm
46 * -Xbootclasspath/a:.
47 * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
48 * -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCMode=generational -XX:ShenandoahGarbageThreshold=100 -Xmx100m
49 * gc.shenandoah.TestReferenceShortcutCycle
50 */
51
52 /* @test id=iu-100
53 * @requires vm.gc.Shenandoah
54 * @library /test/lib
55 * @build jdk.test.whitebox.WhiteBox
56 * @modules java.base
57 * @run main jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
58 * @run main/othervm
59 * -Xbootclasspath/a:.
60 * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
61 * -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGarbageThreshold=100 -Xmx100m
62 * gc.shenandoah.TestReferenceShortcutCycle
63 */
64
65 import java.lang.ref.PhantomReference;
66 import java.lang.ref.Reference;
67 import java.lang.ref.ReferenceQueue;
68 import java.lang.ref.WeakReference;
|