test/hotspot/jtreg/gc/concurrent_phase_control/TestConcurrentPhaseControlG1Basics.java
author tschatzl
Mon, 14 May 2018 11:47:03 +0200
changeset 50097 ed8a43d83fcc
parent 49632 64f9ebc85e67
child 53523 4c5184c56dc2
permissions -rw-r--r--
8201491: G1 support for java.lang.ref.Reference precleaning Summary: Implement single-threaded concurrent reference precleaning for G1. Reviewed-by: sangheki, kbarrett
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
46384
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
     1
/*
49607
acffe6ff3ae7 8180415: Rebuild remembered sets during the concurrent cycle
tschatzl
parents: 48791
diff changeset
     2
 * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
46384
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
     4
 *
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
     7
 * published by the Free Software Foundation.
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
     8
 *
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    13
 * accompanied this code).
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    14
 *
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    18
 *
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    21
 * questions.
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    22
 */
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    23
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    24
/*
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    25
 * @test TestConcurrentPhaseControlG1Basics
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    26
 * @bug 8169517
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    27
 * @requires vm.gc.G1
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    28
 * @summary Verify G1 supports concurrent phase control and has the
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    29
 * expected set of phases.
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    30
 * @key gc
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    31
 * @modules java.base
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    32
 * @library /test/lib /
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    33
 * @build sun.hotspot.WhiteBox
48791
6e079ff6c83c 8186635: ClassFileInstaller should be run as a driver
iignatyev
parents: 47216
diff changeset
    34
 * @run driver ClassFileInstaller sun.hotspot.WhiteBox
46384
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    35
 *    sun.hotspot.WhiteBox$WhiteBoxPermission
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    36
 * @run main/othervm -XX:+UseG1GC
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    37
 *   -Xbootclasspath/a:.
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    38
 *   -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    39
 *   TestConcurrentPhaseControlG1Basics
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    40
 */
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    41
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    42
import gc.concurrent_phase_control.CheckSupported;
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    43
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    44
public class TestConcurrentPhaseControlG1Basics {
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    45
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    46
    private static final String[] phases = {
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    47
        "ANY",
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    48
        "IDLE",
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    49
        "CONCURRENT_CYCLE",
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    50
        "CLEAR_CLAIMED_MARKS",
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    51
        "SCAN_ROOT_REGIONS",
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    52
        "CONCURRENT_MARK",
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    53
        "MARK_FROM_ROOTS",
50097
ed8a43d83fcc 8201491: G1 support for java.lang.ref.Reference precleaning
tschatzl
parents: 49632
diff changeset
    54
        "PRECLEAN",
46384
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    55
        "BEFORE_REMARK",
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    56
        "REMARK",
49607
acffe6ff3ae7 8180415: Rebuild remembered sets during the concurrent cycle
tschatzl
parents: 48791
diff changeset
    57
        "REBUILD_REMEMBERED_SETS",
46384
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    58
        "CLEANUP_FOR_NEXT_MARK",
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    59
    };
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    60
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    61
    public static void main(String[] args) throws Exception {
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    62
        CheckSupported.check("G1", phases);
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    63
    }
dacebddcdea0 8169517: WhiteBox should provide concurrent GC phase control
kbarrett
parents:
diff changeset
    64
}