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
27 * @requires vm.gc.Shenandoah
28 * @library /test/lib
29 * @build jdk.test.whitebox.WhiteBox
30 * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
31 * @run main/othervm
32 * -Xbootclasspath/a:.
33 * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
34 * -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCMode=satb
35 * gc.shenandoah.TestReferenceRefersToShenandoah
36 */
37
38 /* @test id=iu
39 * @requires vm.gc.Shenandoah
40 * @library /test/lib
41 * @build jdk.test.whitebox.WhiteBox
42 * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
43 * @run main/othervm
44 * -Xbootclasspath/a:.
45 * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
46 * -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu
47 * gc.shenandoah.TestReferenceRefersToShenandoah
48 */
49
50 /* @test id=satb-100
51 * @requires vm.gc.Shenandoah
52 * @library /test/lib
53 * @build jdk.test.whitebox.WhiteBox
54 * @modules java.base
55 * @run main jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
56 * @run main/othervm
57 * -Xbootclasspath/a:.
58 * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
59 * -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCMode=satb -XX:ShenandoahGarbageThreshold=100 -Xmx100m
60 * gc.shenandoah.TestReferenceRefersToShenandoah
61 */
62
63 /* @test id=iu-100
64 * @requires vm.gc.Shenandoah
65 * @library /test/lib
66 * @build jdk.test.whitebox.WhiteBox
67 * @modules java.base
68 * @run main jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
69 * @run main/othervm
70 * -Xbootclasspath/a:.
71 * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
72 * -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGarbageThreshold=100 -Xmx100m
73 * gc.shenandoah.TestReferenceRefersToShenandoah
74 */
75
76 import java.lang.ref.PhantomReference;
77 import java.lang.ref.Reference;
78 import java.lang.ref.ReferenceQueue;
79 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
27 * @requires vm.gc.Shenandoah
28 * @library /test/lib
29 * @build jdk.test.whitebox.WhiteBox
30 * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
31 * @run main/othervm
32 * -Xbootclasspath/a:.
33 * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
34 * -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCMode=satb
35 * gc.shenandoah.TestReferenceRefersToShenandoah
36 */
37
38 /* @test id=satb-100
39 * @requires vm.gc.Shenandoah
40 * @library /test/lib
41 * @build jdk.test.whitebox.WhiteBox
42 * @modules java.base
43 * @run main jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
44 * @run main/othervm
45 * -Xbootclasspath/a:.
46 * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
47 * -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCMode=satb -XX:ShenandoahGarbageThreshold=100 -Xmx100m
48 * gc.shenandoah.TestReferenceRefersToShenandoah
49 */
50
51 /* @test id=generational
52 * @requires vm.gc.Shenandoah
53 * @library /test/lib
54 * @build jdk.test.whitebox.WhiteBox
55 * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
56 * @run main/othervm
57 * -Xbootclasspath/a:.
58 * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
59 * -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCMode=generational
60 * gc.shenandoah.TestReferenceRefersToShenandoah
61 */
62
63 /* @test id=generational-100
64 * @requires vm.gc.Shenandoah
65 * @library /test/lib
66 * @build jdk.test.whitebox.WhiteBox
67 * @modules java.base
68 * @run main jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
69 * @run main/othervm
70 * -Xbootclasspath/a:.
71 * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
72 * -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCMode=generational -XX:ShenandoahGarbageThreshold=100 -Xmx100m
73 * gc.shenandoah.TestReferenceRefersToShenandoah
74 */
75
76 /* @test id=iu
77 * @requires vm.gc.Shenandoah
78 * @library /test/lib
79 * @build jdk.test.whitebox.WhiteBox
80 * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
81 * @run main/othervm
82 * -Xbootclasspath/a:.
83 * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
84 * -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu
85 * gc.shenandoah.TestReferenceRefersToShenandoah
86 */
87
88 /* @test id=iu-100
89 * @requires vm.gc.Shenandoah
90 * @library /test/lib
91 * @build jdk.test.whitebox.WhiteBox
92 * @modules java.base
93 * @run main jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
94 * @run main/othervm
95 * -Xbootclasspath/a:.
96 * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
97 * -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGarbageThreshold=100 -Xmx100m
98 * gc.shenandoah.TestReferenceRefersToShenandoah
99 */
100
101 import java.lang.ref.PhantomReference;
102 import java.lang.ref.Reference;
103 import java.lang.ref.ReferenceQueue;
104 import java.lang.ref.WeakReference;
|