test/jtreg-ext/requires/VMProps.java
author kvn
Thu, 07 Jun 2018 17:38:34 -0700
changeset 50455 2b73cce96dce
parent 50339 ede65c4fb6da
child 50590 5fa19bad622d
permissions -rw-r--r--
8202611: [GRAAL] Exclude CMS GC testing from runs with Graal Reviewed-by: iignatyev, kbarrett
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
37400
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
     1
/*
49008
d777541fceba 8191375: Add high-level jtreg VMProps to filter out CDS tests
iklam
parents: 48957
diff changeset
     2
 * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
37400
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
     4
 *
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
     7
 * published by the Free Software Foundation.
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
     8
 *
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    13
 * accompanied this code).
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    14
 *
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    18
 *
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    21
 * questions.
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    22
 */
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    23
package requires;
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    24
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    25
import java.io.IOException;
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    26
import java.nio.file.Files;
46238
661b22bb24d2 8185536: @key aot should be replaced w/ @requires vm.aot
iignatyev
parents: 46225
diff changeset
    27
import java.nio.file.Path;
37400
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    28
import java.nio.file.Paths;
42511
8009d4cba2ea 8170228: register closed @requires property setter
iignatyev
parents: 42006
diff changeset
    29
import java.nio.file.StandardOpenOption;
37400
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    30
import java.util.ArrayList;
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    31
import java.util.HashMap;
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    32
import java.util.List;
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    33
import java.util.Map;
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    34
import java.util.concurrent.Callable;
47615
6210a27c3704 8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents: 47576
diff changeset
    35
import java.util.concurrent.TimeUnit;
37400
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    36
import java.util.regex.Matcher;
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    37
import java.util.regex.Pattern;
43389
53ff01a9206a 8170918: Remove shell script from test/compiler/c2/cr7200264/TestIntVect.java
bmoloden
parents: 42512
diff changeset
    38
50455
2b73cce96dce 8202611: [GRAAL] Exclude CMS GC testing from runs with Graal
kvn
parents: 50339
diff changeset
    39
import sun.hotspot.code.Compiler;
43389
53ff01a9206a 8170918: Remove shell script from test/compiler/c2/cr7200264/TestIntVect.java
bmoloden
parents: 42512
diff changeset
    40
import sun.hotspot.cpuinfo.CPUInfo;
39377
07739ee0b28a 8151283: Implement setting jtreg @requires property vm.isG1Supported.
dfazunen
parents: 39199
diff changeset
    41
import sun.hotspot.gc.GC;
39941
fdbe314f004f 8161208: Unable to run jtreg tests with MinimalVM
mchernov
parents: 39377
diff changeset
    42
import sun.hotspot.WhiteBox;
46225
f99654379e9c 8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents: 43394
diff changeset
    43
import jdk.test.lib.Platform;
37400
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    44
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    45
/**
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    46
 * The Class to be invoked by jtreg prior Test Suite execution to
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    47
 * collect information about VM.
39941
fdbe314f004f 8161208: Unable to run jtreg tests with MinimalVM
mchernov
parents: 39377
diff changeset
    48
 * Do not use any API's that may not be available in all target VMs.
37400
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    49
 * Properties set by this Class will be available in the @requires expressions.
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    50
 */
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    51
public class VMProps implements Callable<Map<String, String>> {
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    52
39941
fdbe314f004f 8161208: Unable to run jtreg tests with MinimalVM
mchernov
parents: 39377
diff changeset
    53
    private static final WhiteBox WB = WhiteBox.getWhiteBox();
fdbe314f004f 8161208: Unable to run jtreg tests with MinimalVM
mchernov
parents: 39377
diff changeset
    54
37400
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    55
    /**
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    56
     * Collects information about VM properties.
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    57
     * This method will be invoked by jtreg.
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    58
     *
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    59
     * @return Map of property-value pairs.
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    60
     */
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    61
    @Override
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    62
    public Map<String, String> call() {
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    63
        Map<String, String> map = new HashMap<>();
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    64
        map.put("vm.flavor", vmFlavor());
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    65
        map.put("vm.compMode", vmCompMode());
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    66
        map.put("vm.bits", vmBits());
39199
ec6fd961811c 8158412: [TESTBUG] TestIHOPErgo and TestStressG1Humongous should not be executed when JFR is enabled
mchernov
parents: 39198
diff changeset
    67
        map.put("vm.flightRecorder", vmFlightRecorder());
39198
050eff9d3bcf 8157831: JVMCI tests should not be executed on linux-arm32
lmesnik
parents: 37400
diff changeset
    68
        map.put("vm.simpleArch", vmArch());
42006
98146f279bba 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents: 39941
diff changeset
    69
        map.put("vm.debug", vmDebug());
42512
9e1dfd06e954 8170226: Implement setting jtreg @requires property vm.jvmci
iignatyev
parents: 42511
diff changeset
    70
        map.put("vm.jvmci", vmJvmci());
43394
68ed4de0f9c8 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 43389
diff changeset
    71
        map.put("vm.emulatedClient", vmEmulatedClient());
43389
53ff01a9206a 8170918: Remove shell script from test/compiler/c2/cr7200264/TestIntVect.java
bmoloden
parents: 42512
diff changeset
    72
        map.put("vm.cpu.features", cpuFeatures());
46225
f99654379e9c 8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents: 43394
diff changeset
    73
        map.put("vm.rtm.cpu", vmRTMCPU());
f99654379e9c 8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents: 43394
diff changeset
    74
        map.put("vm.rtm.os", vmRTMOS());
46238
661b22bb24d2 8185536: @key aot should be replaced w/ @requires vm.aot
iignatyev
parents: 46225
diff changeset
    75
        map.put("vm.aot", vmAOT());
46242
9465c23e4e0d 8185436: jtreg: introduce @requires property to disable cds tests
goetz
parents: 46239
diff changeset
    76
        // vm.cds is true if the VM is compiled with cds support.
9465c23e4e0d 8185436: jtreg: introduce @requires property to disable cds tests
goetz
parents: 46239
diff changeset
    77
        map.put("vm.cds", vmCDS());
48155
551de50b4ff7 8191927: Enable AppCDS for custom loaders on all 64-bit Linux and AIX
iklam
parents: 47814
diff changeset
    78
        map.put("vm.cds.custom.loaders", vmCDSForCustomLoaders());
49008
d777541fceba 8191375: Add high-level jtreg VMProps to filter out CDS tests
iklam
parents: 48957
diff changeset
    79
        map.put("vm.cds.archived.java.heap", vmCDSForArchivedJavaHeap());
47576
7645833d326f 8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents: 46242
diff changeset
    80
        // vm.graal.enabled is true if Graal is used as JIT
7645833d326f 8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents: 46242
diff changeset
    81
        map.put("vm.graal.enabled", isGraalEnabled());
47615
6210a27c3704 8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents: 47576
diff changeset
    82
        map.put("docker.support", dockerSupport());
39377
07739ee0b28a 8151283: Implement setting jtreg @requires property vm.isG1Supported.
dfazunen
parents: 39199
diff changeset
    83
        vmGC(map); // vm.gc.X = true/false
50320
df02866807b6 8203923: Add @requires feature to check flag values for the running JVM
stefank
parents: 49630
diff changeset
    84
        vmOptFinalFlags(map);
39377
07739ee0b28a 8151283: Implement setting jtreg @requires property vm.isG1Supported.
dfazunen
parents: 39199
diff changeset
    85
42511
8009d4cba2ea 8170228: register closed @requires property setter
iignatyev
parents: 42006
diff changeset
    86
        VMProps.dump(map);
37400
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    87
        return map;
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    88
    }
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
    89
39198
050eff9d3bcf 8157831: JVMCI tests should not be executed on linux-arm32
lmesnik
parents: 37400
diff changeset
    90
    /**
45823
f3cf2ee05985 8183534: [TEST] Make detection of compilation mode more robust
simonis
parents: 43394
diff changeset
    91
     * Prints a stack trace before returning null.
f3cf2ee05985 8183534: [TEST] Make detection of compilation mode more robust
simonis
parents: 43394
diff changeset
    92
     * Used by the various helper functions which parse information from
f3cf2ee05985 8183534: [TEST] Make detection of compilation mode more robust
simonis
parents: 43394
diff changeset
    93
     * VM properties in the case where they don't find an expected property
f3cf2ee05985 8183534: [TEST] Make detection of compilation mode more robust
simonis
parents: 43394
diff changeset
    94
     * or a propoerty doesn't conform to an expected format.
f3cf2ee05985 8183534: [TEST] Make detection of compilation mode more robust
simonis
parents: 43394
diff changeset
    95
     *
f3cf2ee05985 8183534: [TEST] Make detection of compilation mode more robust
simonis
parents: 43394
diff changeset
    96
     * @return null
f3cf2ee05985 8183534: [TEST] Make detection of compilation mode more robust
simonis
parents: 43394
diff changeset
    97
     */
f3cf2ee05985 8183534: [TEST] Make detection of compilation mode more robust
simonis
parents: 43394
diff changeset
    98
    private String nullWithException(String message) {
f3cf2ee05985 8183534: [TEST] Make detection of compilation mode more robust
simonis
parents: 43394
diff changeset
    99
        new Exception(message).printStackTrace();
f3cf2ee05985 8183534: [TEST] Make detection of compilation mode more robust
simonis
parents: 43394
diff changeset
   100
        return null;
f3cf2ee05985 8183534: [TEST] Make detection of compilation mode more robust
simonis
parents: 43394
diff changeset
   101
    }
f3cf2ee05985 8183534: [TEST] Make detection of compilation mode more robust
simonis
parents: 43394
diff changeset
   102
f3cf2ee05985 8183534: [TEST] Make detection of compilation mode more robust
simonis
parents: 43394
diff changeset
   103
    /**
39198
050eff9d3bcf 8157831: JVMCI tests should not be executed on linux-arm32
lmesnik
parents: 37400
diff changeset
   104
     * @return vm.simpleArch value of "os.simpleArch" property of tested JDK.
050eff9d3bcf 8157831: JVMCI tests should not be executed on linux-arm32
lmesnik
parents: 37400
diff changeset
   105
     */
050eff9d3bcf 8157831: JVMCI tests should not be executed on linux-arm32
lmesnik
parents: 37400
diff changeset
   106
    protected String vmArch() {
050eff9d3bcf 8157831: JVMCI tests should not be executed on linux-arm32
lmesnik
parents: 37400
diff changeset
   107
        String arch = System.getProperty("os.arch");
050eff9d3bcf 8157831: JVMCI tests should not be executed on linux-arm32
lmesnik
parents: 37400
diff changeset
   108
        if (arch.equals("x86_64") || arch.equals("amd64")) {
050eff9d3bcf 8157831: JVMCI tests should not be executed on linux-arm32
lmesnik
parents: 37400
diff changeset
   109
            return "x64";
050eff9d3bcf 8157831: JVMCI tests should not be executed on linux-arm32
lmesnik
parents: 37400
diff changeset
   110
        }
050eff9d3bcf 8157831: JVMCI tests should not be executed on linux-arm32
lmesnik
parents: 37400
diff changeset
   111
        else if (arch.contains("86")) {
050eff9d3bcf 8157831: JVMCI tests should not be executed on linux-arm32
lmesnik
parents: 37400
diff changeset
   112
            return "x86";
050eff9d3bcf 8157831: JVMCI tests should not be executed on linux-arm32
lmesnik
parents: 37400
diff changeset
   113
        } else {
050eff9d3bcf 8157831: JVMCI tests should not be executed on linux-arm32
lmesnik
parents: 37400
diff changeset
   114
            return arch;
050eff9d3bcf 8157831: JVMCI tests should not be executed on linux-arm32
lmesnik
parents: 37400
diff changeset
   115
        }
050eff9d3bcf 8157831: JVMCI tests should not be executed on linux-arm32
lmesnik
parents: 37400
diff changeset
   116
    }
050eff9d3bcf 8157831: JVMCI tests should not be executed on linux-arm32
lmesnik
parents: 37400
diff changeset
   117
050eff9d3bcf 8157831: JVMCI tests should not be executed on linux-arm32
lmesnik
parents: 37400
diff changeset
   118
050eff9d3bcf 8157831: JVMCI tests should not be executed on linux-arm32
lmesnik
parents: 37400
diff changeset
   119
37400
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   120
    /**
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   121
     * @return VM type value extracted from the "java.vm.name" property.
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   122
     */
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   123
    protected String vmFlavor() {
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   124
        // E.g. "Java HotSpot(TM) 64-Bit Server VM"
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   125
        String vmName = System.getProperty("java.vm.name");
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   126
        if (vmName == null) {
45823
f3cf2ee05985 8183534: [TEST] Make detection of compilation mode more robust
simonis
parents: 43394
diff changeset
   127
            return nullWithException("Can't get 'java.vm.name' property");
37400
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   128
        }
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   129
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   130
        Pattern startP = Pattern.compile(".* (\\S+) VM");
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   131
        Matcher m = startP.matcher(vmName);
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   132
        if (m.matches()) {
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   133
            return m.group(1).toLowerCase();
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   134
        }
45823
f3cf2ee05985 8183534: [TEST] Make detection of compilation mode more robust
simonis
parents: 43394
diff changeset
   135
        return nullWithException("Can't get VM flavor from 'java.vm.name'");
37400
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   136
    }
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   137
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   138
    /**
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   139
     * @return VM compilation mode extracted from the "java.vm.info" property.
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   140
     */
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   141
    protected String vmCompMode() {
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   142
        // E.g. "mixed mode"
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   143
        String vmInfo = System.getProperty("java.vm.info");
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   144
        if (vmInfo == null) {
45823
f3cf2ee05985 8183534: [TEST] Make detection of compilation mode more robust
simonis
parents: 43394
diff changeset
   145
            return nullWithException("Can't get 'java.vm.info' property");
37400
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   146
        }
45823
f3cf2ee05985 8183534: [TEST] Make detection of compilation mode more robust
simonis
parents: 43394
diff changeset
   147
        if (vmInfo.toLowerCase().indexOf("mixed mode") != -1) {
f3cf2ee05985 8183534: [TEST] Make detection of compilation mode more robust
simonis
parents: 43394
diff changeset
   148
            return "Xmixed";
f3cf2ee05985 8183534: [TEST] Make detection of compilation mode more robust
simonis
parents: 43394
diff changeset
   149
        } else if (vmInfo.toLowerCase().indexOf("compiled mode") != -1) {
f3cf2ee05985 8183534: [TEST] Make detection of compilation mode more robust
simonis
parents: 43394
diff changeset
   150
            return "Xcomp";
f3cf2ee05985 8183534: [TEST] Make detection of compilation mode more robust
simonis
parents: 43394
diff changeset
   151
        } else if (vmInfo.toLowerCase().indexOf("interpreted mode") != -1) {
f3cf2ee05985 8183534: [TEST] Make detection of compilation mode more robust
simonis
parents: 43394
diff changeset
   152
            return "Xint";
f3cf2ee05985 8183534: [TEST] Make detection of compilation mode more robust
simonis
parents: 43394
diff changeset
   153
        } else {
f3cf2ee05985 8183534: [TEST] Make detection of compilation mode more robust
simonis
parents: 43394
diff changeset
   154
            return nullWithException("Can't get compilation mode from 'java.vm.info'");
37400
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   155
        }
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   156
    }
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   157
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   158
    /**
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   159
     * @return VM bitness, the value of the "sun.arch.data.model" property.
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   160
     */
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   161
    protected String vmBits() {
45823
f3cf2ee05985 8183534: [TEST] Make detection of compilation mode more robust
simonis
parents: 43394
diff changeset
   162
        String dataModel = System.getProperty("sun.arch.data.model");
f3cf2ee05985 8183534: [TEST] Make detection of compilation mode more robust
simonis
parents: 43394
diff changeset
   163
        if (dataModel != null) {
f3cf2ee05985 8183534: [TEST] Make detection of compilation mode more robust
simonis
parents: 43394
diff changeset
   164
            return dataModel;
f3cf2ee05985 8183534: [TEST] Make detection of compilation mode more robust
simonis
parents: 43394
diff changeset
   165
        } else {
f3cf2ee05985 8183534: [TEST] Make detection of compilation mode more robust
simonis
parents: 43394
diff changeset
   166
            return nullWithException("Can't get 'sun.arch.data.model' property");
f3cf2ee05985 8183534: [TEST] Make detection of compilation mode more robust
simonis
parents: 43394
diff changeset
   167
        }
37400
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   168
    }
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   169
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   170
    /**
39199
ec6fd961811c 8158412: [TESTBUG] TestIHOPErgo and TestStressG1Humongous should not be executed when JFR is enabled
mchernov
parents: 39198
diff changeset
   171
     * @return "true" if Flight Recorder is enabled, "false" if is disabled.
ec6fd961811c 8158412: [TESTBUG] TestIHOPErgo and TestStressG1Humongous should not be executed when JFR is enabled
mchernov
parents: 39198
diff changeset
   172
     */
ec6fd961811c 8158412: [TESTBUG] TestIHOPErgo and TestStressG1Humongous should not be executed when JFR is enabled
mchernov
parents: 39198
diff changeset
   173
    protected String vmFlightRecorder() {
39941
fdbe314f004f 8161208: Unable to run jtreg tests with MinimalVM
mchernov
parents: 39377
diff changeset
   174
        Boolean isUnlockedCommercialFatures = WB.getBooleanVMFlag("UnlockCommercialFeatures");
fdbe314f004f 8161208: Unable to run jtreg tests with MinimalVM
mchernov
parents: 39377
diff changeset
   175
        Boolean isFlightRecorder = WB.getBooleanVMFlag("FlightRecorder");
fdbe314f004f 8161208: Unable to run jtreg tests with MinimalVM
mchernov
parents: 39377
diff changeset
   176
        String startFROptions = WB.getStringVMFlag("StartFlightRecording");
fdbe314f004f 8161208: Unable to run jtreg tests with MinimalVM
mchernov
parents: 39377
diff changeset
   177
        if (isUnlockedCommercialFatures != null && isUnlockedCommercialFatures) {
fdbe314f004f 8161208: Unable to run jtreg tests with MinimalVM
mchernov
parents: 39377
diff changeset
   178
            if (isFlightRecorder != null && isFlightRecorder) {
39199
ec6fd961811c 8158412: [TESTBUG] TestIHOPErgo and TestStressG1Humongous should not be executed when JFR is enabled
mchernov
parents: 39198
diff changeset
   179
                return "true";
ec6fd961811c 8158412: [TESTBUG] TestIHOPErgo and TestStressG1Humongous should not be executed when JFR is enabled
mchernov
parents: 39198
diff changeset
   180
            }
39941
fdbe314f004f 8161208: Unable to run jtreg tests with MinimalVM
mchernov
parents: 39377
diff changeset
   181
            if (startFROptions != null && !startFROptions.isEmpty()) {
39199
ec6fd961811c 8158412: [TESTBUG] TestIHOPErgo and TestStressG1Humongous should not be executed when JFR is enabled
mchernov
parents: 39198
diff changeset
   182
                return "true";
ec6fd961811c 8158412: [TESTBUG] TestIHOPErgo and TestStressG1Humongous should not be executed when JFR is enabled
mchernov
parents: 39198
diff changeset
   183
            }
ec6fd961811c 8158412: [TESTBUG] TestIHOPErgo and TestStressG1Humongous should not be executed when JFR is enabled
mchernov
parents: 39198
diff changeset
   184
        }
ec6fd961811c 8158412: [TESTBUG] TestIHOPErgo and TestStressG1Humongous should not be executed when JFR is enabled
mchernov
parents: 39198
diff changeset
   185
        return "false";
ec6fd961811c 8158412: [TESTBUG] TestIHOPErgo and TestStressG1Humongous should not be executed when JFR is enabled
mchernov
parents: 39198
diff changeset
   186
    }
ec6fd961811c 8158412: [TESTBUG] TestIHOPErgo and TestStressG1Humongous should not be executed when JFR is enabled
mchernov
parents: 39198
diff changeset
   187
ec6fd961811c 8158412: [TESTBUG] TestIHOPErgo and TestStressG1Humongous should not be executed when JFR is enabled
mchernov
parents: 39198
diff changeset
   188
    /**
42006
98146f279bba 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents: 39941
diff changeset
   189
     * @return debug level value extracted from the "jdk.debug" property.
98146f279bba 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents: 39941
diff changeset
   190
     */
98146f279bba 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents: 39941
diff changeset
   191
    protected String vmDebug() {
45823
f3cf2ee05985 8183534: [TEST] Make detection of compilation mode more robust
simonis
parents: 43394
diff changeset
   192
        String debug = System.getProperty("jdk.debug");
f3cf2ee05985 8183534: [TEST] Make detection of compilation mode more robust
simonis
parents: 43394
diff changeset
   193
        if (debug != null) {
f3cf2ee05985 8183534: [TEST] Make detection of compilation mode more robust
simonis
parents: 43394
diff changeset
   194
            return "" + debug.contains("debug");
f3cf2ee05985 8183534: [TEST] Make detection of compilation mode more robust
simonis
parents: 43394
diff changeset
   195
        } else {
f3cf2ee05985 8183534: [TEST] Make detection of compilation mode more robust
simonis
parents: 43394
diff changeset
   196
            return nullWithException("Can't get 'jdk.debug' property");
f3cf2ee05985 8183534: [TEST] Make detection of compilation mode more robust
simonis
parents: 43394
diff changeset
   197
        }
42006
98146f279bba 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents: 39941
diff changeset
   198
    }
98146f279bba 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents: 39941
diff changeset
   199
98146f279bba 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents: 39941
diff changeset
   200
    /**
42512
9e1dfd06e954 8170226: Implement setting jtreg @requires property vm.jvmci
iignatyev
parents: 42511
diff changeset
   201
     * @return true if VM supports JVMCI and false otherwise
9e1dfd06e954 8170226: Implement setting jtreg @requires property vm.jvmci
iignatyev
parents: 42511
diff changeset
   202
     */
9e1dfd06e954 8170226: Implement setting jtreg @requires property vm.jvmci
iignatyev
parents: 42511
diff changeset
   203
    protected String vmJvmci() {
9e1dfd06e954 8170226: Implement setting jtreg @requires property vm.jvmci
iignatyev
parents: 42511
diff changeset
   204
        // builds with jvmci have this flag
9e1dfd06e954 8170226: Implement setting jtreg @requires property vm.jvmci
iignatyev
parents: 42511
diff changeset
   205
        return "" + (WB.getBooleanVMFlag("EnableJVMCI") != null);
9e1dfd06e954 8170226: Implement setting jtreg @requires property vm.jvmci
iignatyev
parents: 42511
diff changeset
   206
    }
9e1dfd06e954 8170226: Implement setting jtreg @requires property vm.jvmci
iignatyev
parents: 42511
diff changeset
   207
9e1dfd06e954 8170226: Implement setting jtreg @requires property vm.jvmci
iignatyev
parents: 42511
diff changeset
   208
    /**
43394
68ed4de0f9c8 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 43389
diff changeset
   209
     * @return true if VM runs in emulated-client mode and false otherwise.
68ed4de0f9c8 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 43389
diff changeset
   210
     */
68ed4de0f9c8 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 43389
diff changeset
   211
    protected String vmEmulatedClient() {
68ed4de0f9c8 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 43389
diff changeset
   212
        String vmInfo = System.getProperty("java.vm.info");
68ed4de0f9c8 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 43389
diff changeset
   213
        if (vmInfo == null) {
68ed4de0f9c8 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 43389
diff changeset
   214
            return "false";
68ed4de0f9c8 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 43389
diff changeset
   215
        }
68ed4de0f9c8 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 43389
diff changeset
   216
        return "" + vmInfo.contains(" emulated-client");
68ed4de0f9c8 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 43389
diff changeset
   217
    }
68ed4de0f9c8 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 43389
diff changeset
   218
68ed4de0f9c8 8166002: Emulate client build on platforms with reduced virtual address space
jcm
parents: 43389
diff changeset
   219
    /**
43389
53ff01a9206a 8170918: Remove shell script from test/compiler/c2/cr7200264/TestIntVect.java
bmoloden
parents: 42512
diff changeset
   220
     * @return supported CPU features
53ff01a9206a 8170918: Remove shell script from test/compiler/c2/cr7200264/TestIntVect.java
bmoloden
parents: 42512
diff changeset
   221
     */
53ff01a9206a 8170918: Remove shell script from test/compiler/c2/cr7200264/TestIntVect.java
bmoloden
parents: 42512
diff changeset
   222
    protected String cpuFeatures() {
53ff01a9206a 8170918: Remove shell script from test/compiler/c2/cr7200264/TestIntVect.java
bmoloden
parents: 42512
diff changeset
   223
        return CPUInfo.getFeatures().toString();
53ff01a9206a 8170918: Remove shell script from test/compiler/c2/cr7200264/TestIntVect.java
bmoloden
parents: 42512
diff changeset
   224
    }
53ff01a9206a 8170918: Remove shell script from test/compiler/c2/cr7200264/TestIntVect.java
bmoloden
parents: 42512
diff changeset
   225
53ff01a9206a 8170918: Remove shell script from test/compiler/c2/cr7200264/TestIntVect.java
bmoloden
parents: 42512
diff changeset
   226
    /**
39377
07739ee0b28a 8151283: Implement setting jtreg @requires property vm.isG1Supported.
dfazunen
parents: 39199
diff changeset
   227
     * For all existing GC sets vm.gc.X property.
07739ee0b28a 8151283: Implement setting jtreg @requires property vm.isG1Supported.
dfazunen
parents: 39199
diff changeset
   228
     * Example vm.gc.G1=true means:
07739ee0b28a 8151283: Implement setting jtreg @requires property vm.isG1Supported.
dfazunen
parents: 39199
diff changeset
   229
     *    VM supports G1
07739ee0b28a 8151283: Implement setting jtreg @requires property vm.isG1Supported.
dfazunen
parents: 39199
diff changeset
   230
     *    User either set G1 explicitely (-XX:+UseG1GC) or did not set any GC
07739ee0b28a 8151283: Implement setting jtreg @requires property vm.isG1Supported.
dfazunen
parents: 39199
diff changeset
   231
     * @param map - property-value pairs
07739ee0b28a 8151283: Implement setting jtreg @requires property vm.isG1Supported.
dfazunen
parents: 39199
diff changeset
   232
     */
49630
2f1b308b4469 8199927: Make WhiteBox more GC agnostic
pliden
parents: 49344
diff changeset
   233
    protected void vmGC(Map<String, String> map) {
39377
07739ee0b28a 8151283: Implement setting jtreg @requires property vm.isG1Supported.
dfazunen
parents: 39199
diff changeset
   234
        for (GC gc: GC.values()) {
49630
2f1b308b4469 8199927: Make WhiteBox more GC agnostic
pliden
parents: 49344
diff changeset
   235
            boolean isAcceptable = gc.isSupported() && (gc.isSelected() || GC.isSelectedErgonomically());
39377
07739ee0b28a 8151283: Implement setting jtreg @requires property vm.isG1Supported.
dfazunen
parents: 39199
diff changeset
   236
            map.put("vm.gc." + gc.name(), "" + isAcceptable);
07739ee0b28a 8151283: Implement setting jtreg @requires property vm.isG1Supported.
dfazunen
parents: 39199
diff changeset
   237
        }
07739ee0b28a 8151283: Implement setting jtreg @requires property vm.isG1Supported.
dfazunen
parents: 39199
diff changeset
   238
    }
07739ee0b28a 8151283: Implement setting jtreg @requires property vm.isG1Supported.
dfazunen
parents: 39199
diff changeset
   239
07739ee0b28a 8151283: Implement setting jtreg @requires property vm.isG1Supported.
dfazunen
parents: 39199
diff changeset
   240
    /**
50320
df02866807b6 8203923: Add @requires feature to check flag values for the running JVM
stefank
parents: 49630
diff changeset
   241
     * Selected final flag.
df02866807b6 8203923: Add @requires feature to check flag values for the running JVM
stefank
parents: 49630
diff changeset
   242
     * @param map - property-value pairs
df02866807b6 8203923: Add @requires feature to check flag values for the running JVM
stefank
parents: 49630
diff changeset
   243
     * @param flagName - flag name
df02866807b6 8203923: Add @requires feature to check flag values for the running JVM
stefank
parents: 49630
diff changeset
   244
     */
df02866807b6 8203923: Add @requires feature to check flag values for the running JVM
stefank
parents: 49630
diff changeset
   245
    private void vmOptFinalFlag(Map<String, String> map, String flagName) {
df02866807b6 8203923: Add @requires feature to check flag values for the running JVM
stefank
parents: 49630
diff changeset
   246
        String value = WB.getBooleanVMFlag(flagName) ? "true" : "false";
df02866807b6 8203923: Add @requires feature to check flag values for the running JVM
stefank
parents: 49630
diff changeset
   247
        map.put("vm.opt.final." + flagName, value);
df02866807b6 8203923: Add @requires feature to check flag values for the running JVM
stefank
parents: 49630
diff changeset
   248
    }
df02866807b6 8203923: Add @requires feature to check flag values for the running JVM
stefank
parents: 49630
diff changeset
   249
df02866807b6 8203923: Add @requires feature to check flag values for the running JVM
stefank
parents: 49630
diff changeset
   250
    /**
df02866807b6 8203923: Add @requires feature to check flag values for the running JVM
stefank
parents: 49630
diff changeset
   251
     * Selected sets of final flags.
df02866807b6 8203923: Add @requires feature to check flag values for the running JVM
stefank
parents: 49630
diff changeset
   252
     * @param map -property-value pairs
df02866807b6 8203923: Add @requires feature to check flag values for the running JVM
stefank
parents: 49630
diff changeset
   253
     */
df02866807b6 8203923: Add @requires feature to check flag values for the running JVM
stefank
parents: 49630
diff changeset
   254
    protected void vmOptFinalFlags(Map<String, String> map) {
df02866807b6 8203923: Add @requires feature to check flag values for the running JVM
stefank
parents: 49630
diff changeset
   255
        vmOptFinalFlag(map, "ClassUnloading");
df02866807b6 8203923: Add @requires feature to check flag values for the running JVM
stefank
parents: 49630
diff changeset
   256
        vmOptFinalFlag(map, "UseCompressedOops");
df02866807b6 8203923: Add @requires feature to check flag values for the running JVM
stefank
parents: 49630
diff changeset
   257
    }
df02866807b6 8203923: Add @requires feature to check flag values for the running JVM
stefank
parents: 49630
diff changeset
   258
df02866807b6 8203923: Add @requires feature to check flag values for the running JVM
stefank
parents: 49630
diff changeset
   259
    /**
46225
f99654379e9c 8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents: 43394
diff changeset
   260
     * @return true if VM runs RTM supported OS and false otherwise.
f99654379e9c 8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents: 43394
diff changeset
   261
     */
f99654379e9c 8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents: 43394
diff changeset
   262
    protected String vmRTMOS() {
f99654379e9c 8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents: 43394
diff changeset
   263
        boolean isRTMOS = true;
f99654379e9c 8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents: 43394
diff changeset
   264
f99654379e9c 8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents: 43394
diff changeset
   265
        if (Platform.isAix()) {
f99654379e9c 8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents: 43394
diff changeset
   266
            // Actually, this works since AIX 7.1.3.30, but os.version property
f99654379e9c 8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents: 43394
diff changeset
   267
            // is set to 7.1.
f99654379e9c 8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents: 43394
diff changeset
   268
            isRTMOS = (Platform.getOsVersionMajor()  > 7) ||
f99654379e9c 8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents: 43394
diff changeset
   269
                      (Platform.getOsVersionMajor() == 7 && Platform.getOsVersionMinor() > 1);
f99654379e9c 8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents: 43394
diff changeset
   270
f99654379e9c 8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents: 43394
diff changeset
   271
        } else if (Platform.isLinux()) {
f99654379e9c 8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents: 43394
diff changeset
   272
            if (Platform.isPPC()) {
f99654379e9c 8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents: 43394
diff changeset
   273
                isRTMOS = (Platform.getOsVersionMajor()  > 4) ||
f99654379e9c 8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents: 43394
diff changeset
   274
                          (Platform.getOsVersionMajor() == 4 && Platform.getOsVersionMinor() > 1);
f99654379e9c 8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents: 43394
diff changeset
   275
            }
f99654379e9c 8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents: 43394
diff changeset
   276
        }
f99654379e9c 8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents: 43394
diff changeset
   277
        return "" + isRTMOS;
f99654379e9c 8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents: 43394
diff changeset
   278
    }
f99654379e9c 8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents: 43394
diff changeset
   279
f99654379e9c 8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents: 43394
diff changeset
   280
    /**
f99654379e9c 8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents: 43394
diff changeset
   281
     * @return true if VM runs RTM supported CPU and false otherwise.
f99654379e9c 8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents: 43394
diff changeset
   282
     */
f99654379e9c 8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents: 43394
diff changeset
   283
    protected String vmRTMCPU() {
50339
ede65c4fb6da 8203669: PPC64: Fix jtreg RTM tests after "8203305: Improve TM detection for enabling RTM on Linux / POWER9"
gromero
parents: 50320
diff changeset
   284
        return "" + CPUInfo.hasFeature("rtm");
46225
f99654379e9c 8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents: 43394
diff changeset
   285
    }
f99654379e9c 8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents: 43394
diff changeset
   286
f99654379e9c 8181124: Get rid of compiler.testlibrary.rtm.predicate
epavlova
parents: 43394
diff changeset
   287
    /**
46238
661b22bb24d2 8185536: @key aot should be replaced w/ @requires vm.aot
iignatyev
parents: 46225
diff changeset
   288
     * @return true if VM supports AOT and false otherwise
661b22bb24d2 8185536: @key aot should be replaced w/ @requires vm.aot
iignatyev
parents: 46225
diff changeset
   289
     */
661b22bb24d2 8185536: @key aot should be replaced w/ @requires vm.aot
iignatyev
parents: 46225
diff changeset
   290
    protected String vmAOT() {
661b22bb24d2 8185536: @key aot should be replaced w/ @requires vm.aot
iignatyev
parents: 46225
diff changeset
   291
        // builds with aot have jaotc in <JDK>/bin
661b22bb24d2 8185536: @key aot should be replaced w/ @requires vm.aot
iignatyev
parents: 46225
diff changeset
   292
        Path bin = Paths.get(System.getProperty("java.home"))
661b22bb24d2 8185536: @key aot should be replaced w/ @requires vm.aot
iignatyev
parents: 46225
diff changeset
   293
                        .resolve("bin");
661b22bb24d2 8185536: @key aot should be replaced w/ @requires vm.aot
iignatyev
parents: 46225
diff changeset
   294
        Path jaotc;
661b22bb24d2 8185536: @key aot should be replaced w/ @requires vm.aot
iignatyev
parents: 46225
diff changeset
   295
        if (Platform.isWindows()) {
661b22bb24d2 8185536: @key aot should be replaced w/ @requires vm.aot
iignatyev
parents: 46225
diff changeset
   296
            jaotc = bin.resolve("jaotc.exe");
661b22bb24d2 8185536: @key aot should be replaced w/ @requires vm.aot
iignatyev
parents: 46225
diff changeset
   297
        } else {
661b22bb24d2 8185536: @key aot should be replaced w/ @requires vm.aot
iignatyev
parents: 46225
diff changeset
   298
            jaotc = bin.resolve("jaotc");
661b22bb24d2 8185536: @key aot should be replaced w/ @requires vm.aot
iignatyev
parents: 46225
diff changeset
   299
        }
661b22bb24d2 8185536: @key aot should be replaced w/ @requires vm.aot
iignatyev
parents: 46225
diff changeset
   300
        return "" + Files.exists(jaotc);
661b22bb24d2 8185536: @key aot should be replaced w/ @requires vm.aot
iignatyev
parents: 46225
diff changeset
   301
    }
661b22bb24d2 8185536: @key aot should be replaced w/ @requires vm.aot
iignatyev
parents: 46225
diff changeset
   302
661b22bb24d2 8185536: @key aot should be replaced w/ @requires vm.aot
iignatyev
parents: 46225
diff changeset
   303
    /**
46242
9465c23e4e0d 8185436: jtreg: introduce @requires property to disable cds tests
goetz
parents: 46239
diff changeset
   304
     * Check for CDS support.
9465c23e4e0d 8185436: jtreg: introduce @requires property to disable cds tests
goetz
parents: 46239
diff changeset
   305
     *
9465c23e4e0d 8185436: jtreg: introduce @requires property to disable cds tests
goetz
parents: 46239
diff changeset
   306
     * @return true if CDS is supported by the VM to be tested.
9465c23e4e0d 8185436: jtreg: introduce @requires property to disable cds tests
goetz
parents: 46239
diff changeset
   307
     */
9465c23e4e0d 8185436: jtreg: introduce @requires property to disable cds tests
goetz
parents: 46239
diff changeset
   308
    protected String vmCDS() {
9465c23e4e0d 8185436: jtreg: introduce @requires property to disable cds tests
goetz
parents: 46239
diff changeset
   309
        if (WB.isCDSIncludedInVmBuild()) {
9465c23e4e0d 8185436: jtreg: introduce @requires property to disable cds tests
goetz
parents: 46239
diff changeset
   310
            return "true";
9465c23e4e0d 8185436: jtreg: introduce @requires property to disable cds tests
goetz
parents: 46239
diff changeset
   311
        } else {
9465c23e4e0d 8185436: jtreg: introduce @requires property to disable cds tests
goetz
parents: 46239
diff changeset
   312
            return "false";
9465c23e4e0d 8185436: jtreg: introduce @requires property to disable cds tests
goetz
parents: 46239
diff changeset
   313
        }
9465c23e4e0d 8185436: jtreg: introduce @requires property to disable cds tests
goetz
parents: 46239
diff changeset
   314
    }
9465c23e4e0d 8185436: jtreg: introduce @requires property to disable cds tests
goetz
parents: 46239
diff changeset
   315
9465c23e4e0d 8185436: jtreg: introduce @requires property to disable cds tests
goetz
parents: 46239
diff changeset
   316
    /**
48155
551de50b4ff7 8191927: Enable AppCDS for custom loaders on all 64-bit Linux and AIX
iklam
parents: 47814
diff changeset
   317
     * Check for CDS support for custom loaders.
551de50b4ff7 8191927: Enable AppCDS for custom loaders on all 64-bit Linux and AIX
iklam
parents: 47814
diff changeset
   318
     *
49008
d777541fceba 8191375: Add high-level jtreg VMProps to filter out CDS tests
iklam
parents: 48957
diff changeset
   319
     * @return true if CDS provides support for customer loader in the VM to be tested.
48155
551de50b4ff7 8191927: Enable AppCDS for custom loaders on all 64-bit Linux and AIX
iklam
parents: 47814
diff changeset
   320
     */
551de50b4ff7 8191927: Enable AppCDS for custom loaders on all 64-bit Linux and AIX
iklam
parents: 47814
diff changeset
   321
    protected String vmCDSForCustomLoaders() {
551de50b4ff7 8191927: Enable AppCDS for custom loaders on all 64-bit Linux and AIX
iklam
parents: 47814
diff changeset
   322
        if (vmCDS().equals("true") && Platform.areCustomLoadersSupportedForCDS()) {
551de50b4ff7 8191927: Enable AppCDS for custom loaders on all 64-bit Linux and AIX
iklam
parents: 47814
diff changeset
   323
            return "true";
551de50b4ff7 8191927: Enable AppCDS for custom loaders on all 64-bit Linux and AIX
iklam
parents: 47814
diff changeset
   324
        } else {
551de50b4ff7 8191927: Enable AppCDS for custom loaders on all 64-bit Linux and AIX
iklam
parents: 47814
diff changeset
   325
            return "false";
551de50b4ff7 8191927: Enable AppCDS for custom loaders on all 64-bit Linux and AIX
iklam
parents: 47814
diff changeset
   326
        }
551de50b4ff7 8191927: Enable AppCDS for custom loaders on all 64-bit Linux and AIX
iklam
parents: 47814
diff changeset
   327
    }
551de50b4ff7 8191927: Enable AppCDS for custom loaders on all 64-bit Linux and AIX
iklam
parents: 47814
diff changeset
   328
551de50b4ff7 8191927: Enable AppCDS for custom loaders on all 64-bit Linux and AIX
iklam
parents: 47814
diff changeset
   329
    /**
49008
d777541fceba 8191375: Add high-level jtreg VMProps to filter out CDS tests
iklam
parents: 48957
diff changeset
   330
     * Check for CDS support for archived Java heap regions.
d777541fceba 8191375: Add high-level jtreg VMProps to filter out CDS tests
iklam
parents: 48957
diff changeset
   331
     *
d777541fceba 8191375: Add high-level jtreg VMProps to filter out CDS tests
iklam
parents: 48957
diff changeset
   332
     * @return true if CDS provides support for archive Java heap regions in the VM to be tested.
d777541fceba 8191375: Add high-level jtreg VMProps to filter out CDS tests
iklam
parents: 48957
diff changeset
   333
     */
d777541fceba 8191375: Add high-level jtreg VMProps to filter out CDS tests
iklam
parents: 48957
diff changeset
   334
    protected String vmCDSForArchivedJavaHeap() {
d777541fceba 8191375: Add high-level jtreg VMProps to filter out CDS tests
iklam
parents: 48957
diff changeset
   335
      if (vmCDS().equals("true") && WB.isJavaHeapArchiveSupported()) {
d777541fceba 8191375: Add high-level jtreg VMProps to filter out CDS tests
iklam
parents: 48957
diff changeset
   336
            return "true";
d777541fceba 8191375: Add high-level jtreg VMProps to filter out CDS tests
iklam
parents: 48957
diff changeset
   337
        } else {
d777541fceba 8191375: Add high-level jtreg VMProps to filter out CDS tests
iklam
parents: 48957
diff changeset
   338
            return "false";
d777541fceba 8191375: Add high-level jtreg VMProps to filter out CDS tests
iklam
parents: 48957
diff changeset
   339
        }
d777541fceba 8191375: Add high-level jtreg VMProps to filter out CDS tests
iklam
parents: 48957
diff changeset
   340
    }
d777541fceba 8191375: Add high-level jtreg VMProps to filter out CDS tests
iklam
parents: 48957
diff changeset
   341
d777541fceba 8191375: Add high-level jtreg VMProps to filter out CDS tests
iklam
parents: 48957
diff changeset
   342
    /**
47576
7645833d326f 8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents: 46242
diff changeset
   343
     * Check if Graal is used as JIT compiler.
7645833d326f 8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents: 46242
diff changeset
   344
     *
7645833d326f 8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents: 46242
diff changeset
   345
     * @return true if Graal is used as JIT compiler.
7645833d326f 8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents: 46242
diff changeset
   346
     */
7645833d326f 8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents: 46242
diff changeset
   347
    protected String isGraalEnabled() {
50455
2b73cce96dce 8202611: [GRAAL] Exclude CMS GC testing from runs with Graal
kvn
parents: 50339
diff changeset
   348
        return Compiler.isGraalEnabled() ? "true" : "false";
47576
7645833d326f 8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents: 46242
diff changeset
   349
    }
7645833d326f 8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents: 46242
diff changeset
   350
47615
6210a27c3704 8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents: 47576
diff changeset
   351
6210a27c3704 8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents: 47576
diff changeset
   352
   /**
6210a27c3704 8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents: 47576
diff changeset
   353
     * A simple check for docker support
6210a27c3704 8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents: 47576
diff changeset
   354
     *
6210a27c3704 8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents: 47576
diff changeset
   355
     * @return true if docker is supported in a given environment
6210a27c3704 8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents: 47576
diff changeset
   356
     */
6210a27c3704 8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents: 47576
diff changeset
   357
    protected String dockerSupport() {
49344
e55d7a31cfa7 8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents: 49008
diff changeset
   358
        boolean isSupported = false;
e55d7a31cfa7 8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents: 49008
diff changeset
   359
        if (Platform.isLinux()) {
e55d7a31cfa7 8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents: 49008
diff changeset
   360
           // currently docker testing is only supported for Linux,
e55d7a31cfa7 8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents: 49008
diff changeset
   361
           // on certain platforms
e55d7a31cfa7 8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents: 49008
diff changeset
   362
e55d7a31cfa7 8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents: 49008
diff changeset
   363
           String arch = System.getProperty("os.arch");
e55d7a31cfa7 8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents: 49008
diff changeset
   364
e55d7a31cfa7 8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents: 49008
diff changeset
   365
           if (Platform.isX64()) {
e55d7a31cfa7 8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents: 49008
diff changeset
   366
              isSupported = true;
e55d7a31cfa7 8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents: 49008
diff changeset
   367
           }
e55d7a31cfa7 8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents: 49008
diff changeset
   368
           else if (Platform.isAArch64()) {
e55d7a31cfa7 8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents: 49008
diff changeset
   369
              isSupported = true;
e55d7a31cfa7 8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents: 49008
diff changeset
   370
           }
e55d7a31cfa7 8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents: 49008
diff changeset
   371
           else if (Platform.isS390x()) {
e55d7a31cfa7 8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents: 49008
diff changeset
   372
              isSupported = true;
e55d7a31cfa7 8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents: 49008
diff changeset
   373
           }
e55d7a31cfa7 8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents: 49008
diff changeset
   374
           else if (arch.equals("ppc64le")) {
e55d7a31cfa7 8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents: 49008
diff changeset
   375
              isSupported = true;
e55d7a31cfa7 8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents: 49008
diff changeset
   376
           }
48880
ee49ac008730 8196062: Enable docker container related tests for linux ppc64le
mbaesken
parents: 48155
diff changeset
   377
        }
47615
6210a27c3704 8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents: 47576
diff changeset
   378
49344
e55d7a31cfa7 8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents: 49008
diff changeset
   379
        if (isSupported) {
e55d7a31cfa7 8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents: 49008
diff changeset
   380
           try {
e55d7a31cfa7 8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents: 49008
diff changeset
   381
              isSupported = checkDockerSupport();
e55d7a31cfa7 8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents: 49008
diff changeset
   382
           } catch (Exception e) {
e55d7a31cfa7 8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents: 49008
diff changeset
   383
              isSupported = false;
e55d7a31cfa7 8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents: 49008
diff changeset
   384
           }
e55d7a31cfa7 8196590: Enable docker container related tests for linux AARCH64
dsamersoff
parents: 49008
diff changeset
   385
         }
47615
6210a27c3704 8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents: 47576
diff changeset
   386
6210a27c3704 8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents: 47576
diff changeset
   387
        return (isSupported) ? "true" : "false";
6210a27c3704 8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents: 47576
diff changeset
   388
    }
6210a27c3704 8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents: 47576
diff changeset
   389
6210a27c3704 8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents: 47576
diff changeset
   390
    private boolean checkDockerSupport() throws IOException, InterruptedException {
6210a27c3704 8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents: 47576
diff changeset
   391
        ProcessBuilder pb = new ProcessBuilder("docker", "ps");
6210a27c3704 8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents: 47576
diff changeset
   392
        Process p = pb.start();
6210a27c3704 8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents: 47576
diff changeset
   393
        p.waitFor(10, TimeUnit.SECONDS);
6210a27c3704 8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents: 47576
diff changeset
   394
6210a27c3704 8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents: 47576
diff changeset
   395
        return (p.exitValue() == 0);
6210a27c3704 8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents: 47576
diff changeset
   396
    }
6210a27c3704 8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents: 47576
diff changeset
   397
6210a27c3704 8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents: 47576
diff changeset
   398
6210a27c3704 8181592: [TESTBUG] Docker test utils and docker jdk basic test
mseledtsov
parents: 47576
diff changeset
   399
47576
7645833d326f 8185134: [Graal] Introduce vm.graal predicate and tag tests which are not applicable for Graal
epavlova
parents: 46242
diff changeset
   400
    /**
37400
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   401
     * Dumps the map to the file if the file name is given as the property.
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   402
     * This functionality could be helpful to know context in the real
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   403
     * execution.
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   404
     *
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   405
     * @param map
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   406
     */
42511
8009d4cba2ea 8170228: register closed @requires property setter
iignatyev
parents: 42006
diff changeset
   407
    protected static void dump(Map<String, String> map) {
37400
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   408
        String dumpFileName = System.getProperty("vmprops.dump");
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   409
        if (dumpFileName == null) {
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   410
            return;
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   411
        }
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   412
        List<String> lines = new ArrayList<>();
39199
ec6fd961811c 8158412: [TESTBUG] TestIHOPErgo and TestStressG1Humongous should not be executed when JFR is enabled
mchernov
parents: 39198
diff changeset
   413
        map.forEach((k, v) -> lines.add(k + ":" + v));
37400
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   414
        try {
42511
8009d4cba2ea 8170228: register closed @requires property setter
iignatyev
parents: 42006
diff changeset
   415
            Files.write(Paths.get(dumpFileName), lines, StandardOpenOption.APPEND);
37400
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   416
        } catch (IOException e) {
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   417
            throw new RuntimeException("Failed to dump properties into '"
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   418
                    + dumpFileName + "'", e);
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   419
        }
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   420
    }
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   421
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   422
    /**
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   423
     * This method is for the testing purpose only.
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   424
     * @param args
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   425
     */
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   426
    public static void main(String args[]) {
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   427
        Map<String, String> map = new VMProps().call();
39199
ec6fd961811c 8158412: [TESTBUG] TestIHOPErgo and TestStressG1Humongous should not be executed when JFR is enabled
mchernov
parents: 39198
diff changeset
   428
        map.forEach((k, v) -> System.out.println(k + ": '" + v + "'"));
37400
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   429
    }
7a596e23c0da 8152432: Implement setting jtreg @requires properties vm.flavor, vm.bits, vm.compMode
dfazunen
parents:
diff changeset
   430
}