hotspot/test/runtime/CompressedOops/UseCompressedOops.java
author ctornqvi
Wed, 17 Sep 2014 06:55:12 -0700
changeset 26813 fd74c05c4a7e
parent 26688 bb0cdd873e51
child 28372 ce0aad4b8c44
permissions -rw-r--r--
8058369: [TESTBUG] runtime/CompressedOops/UseCompressedOops.java Exception java.lang.RuntimeException: 'Zero based' missing from stdout/stderr Summary: Solaris and OSX places the heap in unpredictable places, some of the test must be excluded on these platforms Reviewed-by: hseigel, coleenp
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
26688
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
     1
/*
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
     2
 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
     4
 *
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
     7
 * published by the Free Software Foundation.
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
     8
 *
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    13
 * accompanied this code).
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    14
 *
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    18
 *
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    21
 * questions.
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    22
 */
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    23
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    24
/*
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    25
 * @test
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    26
 * @bug 8022865
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    27
 * @summary Tests for different combination of UseCompressedOops options
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    28
 * @library /testlibrary
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    29
 * @run main UseCompressedOops
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    30
 */
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    31
import java.util.ArrayList;
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    32
import java.util.Collections;
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    33
import com.oracle.java.testlibrary.*;
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    34
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    35
public class UseCompressedOops {
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    36
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    37
    public static void main(String[] args) throws Exception {
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    38
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    39
        if (Platform.is64bit()) {
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    40
            // Explicitly turn of compressed oops
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    41
            testCompressedOops("-XX:-UseCompressedOops", "-Xmx32m")
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    42
                .shouldNotContain("Compressed Oops")
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    43
                .shouldHaveExitValue(0);
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    44
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    45
            // Compressed oops should be on by default
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    46
            testCompressedOops("-Xmx32m")
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    47
                .shouldContain("Compressed Oops mode")
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    48
                .shouldHaveExitValue(0);
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    49
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    50
            // Explicly enabling compressed oops
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    51
            testCompressedOops("-XX:+UseCompressedOops", "-Xmx32m")
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    52
                .shouldContain("Compressed Oops mode")
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    53
                .shouldHaveExitValue(0);
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    54
26813
fd74c05c4a7e 8058369: [TESTBUG] runtime/CompressedOops/UseCompressedOops.java Exception java.lang.RuntimeException: 'Zero based' missing from stdout/stderr
ctornqvi
parents: 26688
diff changeset
    55
            // Skip the following three test cases if we're on OSX or Solaris.
fd74c05c4a7e 8058369: [TESTBUG] runtime/CompressedOops/UseCompressedOops.java Exception java.lang.RuntimeException: 'Zero based' missing from stdout/stderr
ctornqvi
parents: 26688
diff changeset
    56
            //
fd74c05c4a7e 8058369: [TESTBUG] runtime/CompressedOops/UseCompressedOops.java Exception java.lang.RuntimeException: 'Zero based' missing from stdout/stderr
ctornqvi
parents: 26688
diff changeset
    57
            // OSX doesn't seem to care about HeapBaseMinAddress and Solaris
fd74c05c4a7e 8058369: [TESTBUG] runtime/CompressedOops/UseCompressedOops.java Exception java.lang.RuntimeException: 'Zero based' missing from stdout/stderr
ctornqvi
parents: 26688
diff changeset
    58
            // puts the heap way up, forcing different behaviour.
fd74c05c4a7e 8058369: [TESTBUG] runtime/CompressedOops/UseCompressedOops.java Exception java.lang.RuntimeException: 'Zero based' missing from stdout/stderr
ctornqvi
parents: 26688
diff changeset
    59
            if (!Platform.isOSX() && !Platform.isSolaris()) {
fd74c05c4a7e 8058369: [TESTBUG] runtime/CompressedOops/UseCompressedOops.java Exception java.lang.RuntimeException: 'Zero based' missing from stdout/stderr
ctornqvi
parents: 26688
diff changeset
    60
                // Larger than 4gb heap should result in zero based with shift 3
fd74c05c4a7e 8058369: [TESTBUG] runtime/CompressedOops/UseCompressedOops.java Exception java.lang.RuntimeException: 'Zero based' missing from stdout/stderr
ctornqvi
parents: 26688
diff changeset
    61
                testCompressedOops("-XX:+UseCompressedOops", "-Xmx5g")
fd74c05c4a7e 8058369: [TESTBUG] runtime/CompressedOops/UseCompressedOops.java Exception java.lang.RuntimeException: 'Zero based' missing from stdout/stderr
ctornqvi
parents: 26688
diff changeset
    62
                    .shouldContain("Zero based")
fd74c05c4a7e 8058369: [TESTBUG] runtime/CompressedOops/UseCompressedOops.java Exception java.lang.RuntimeException: 'Zero based' missing from stdout/stderr
ctornqvi
parents: 26688
diff changeset
    63
                    .shouldContain("Oop shift amount: 3")
fd74c05c4a7e 8058369: [TESTBUG] runtime/CompressedOops/UseCompressedOops.java Exception java.lang.RuntimeException: 'Zero based' missing from stdout/stderr
ctornqvi
parents: 26688
diff changeset
    64
                    .shouldHaveExitValue(0);
26688
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    65
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    66
                // Small heap above 4gb should result in zero based with shift 3
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    67
                testCompressedOops("-XX:+UseCompressedOops", "-Xmx32m", "-XX:HeapBaseMinAddress=4g")
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    68
                    .shouldContain("Zero based")
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    69
                    .shouldContain("Oop shift amount: 3")
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    70
                    .shouldHaveExitValue(0);
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    71
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    72
                // Small heap above 32gb should result in non-zero based with shift 3
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    73
                testCompressedOops("-XX:+UseCompressedOops", "-Xmx32m", "-XX:HeapBaseMinAddress=32g")
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    74
                    .shouldContain("Non-zero based")
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    75
                    .shouldContain("Oop shift amount: 3")
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    76
                    .shouldHaveExitValue(0);
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    77
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    78
                // 32gb heap with heap base above 64gb and object alignment set to 16 bytes should result
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    79
                // in non-zero based with shift 4
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    80
                testCompressedOops("-XX:+UseCompressedOops", "-Xmx32g", "-XX:ObjectAlignmentInBytes=16",
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    81
                               "-XX:HeapBaseMinAddress=64g")
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    82
                    .shouldContain("Non-zero based")
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    83
                    .shouldContain("Oop shift amount: 4")
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    84
                    .shouldHaveExitValue(0);
26813
fd74c05c4a7e 8058369: [TESTBUG] runtime/CompressedOops/UseCompressedOops.java Exception java.lang.RuntimeException: 'Zero based' missing from stdout/stderr
ctornqvi
parents: 26688
diff changeset
    85
fd74c05c4a7e 8058369: [TESTBUG] runtime/CompressedOops/UseCompressedOops.java Exception java.lang.RuntimeException: 'Zero based' missing from stdout/stderr
ctornqvi
parents: 26688
diff changeset
    86
                // 32gb heap with object alignment set to 16 bytes should result in zero based with shift 4
fd74c05c4a7e 8058369: [TESTBUG] runtime/CompressedOops/UseCompressedOops.java Exception java.lang.RuntimeException: 'Zero based' missing from stdout/stderr
ctornqvi
parents: 26688
diff changeset
    87
                testCompressedOops("-XX:+UseCompressedOops", "-Xmx32g", "-XX:ObjectAlignmentInBytes=16")
fd74c05c4a7e 8058369: [TESTBUG] runtime/CompressedOops/UseCompressedOops.java Exception java.lang.RuntimeException: 'Zero based' missing from stdout/stderr
ctornqvi
parents: 26688
diff changeset
    88
                    .shouldContain("Zero based")
fd74c05c4a7e 8058369: [TESTBUG] runtime/CompressedOops/UseCompressedOops.java Exception java.lang.RuntimeException: 'Zero based' missing from stdout/stderr
ctornqvi
parents: 26688
diff changeset
    89
                    .shouldContain("Oop shift amount: 4")
fd74c05c4a7e 8058369: [TESTBUG] runtime/CompressedOops/UseCompressedOops.java Exception java.lang.RuntimeException: 'Zero based' missing from stdout/stderr
ctornqvi
parents: 26688
diff changeset
    90
                    .shouldHaveExitValue(0);
26688
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    91
            }
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    92
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    93
            // Explicitly enabling compressed oops with 32gb heap should result a warning
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    94
            testCompressedOops("-XX:+UseCompressedOops", "-Xmx32g")
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    95
                .shouldContain("Max heap size too large for Compressed Oops")
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    96
                .shouldHaveExitValue(0);
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    97
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    98
            // 32gb heap should not result a warning
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
    99
            testCompressedOops("-Xmx32g")
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
   100
                .shouldNotContain("Max heap size too large for Compressed Oops")
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
   101
                .shouldHaveExitValue(0);
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
   102
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
   103
            // Explicitly enabling compressed oops with 32gb heap and object
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
   104
            // alignment set to 8 byte should result a warning
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
   105
            testCompressedOops("-XX:+UseCompressedOops", "-Xmx32g", "-XX:ObjectAlignmentInBytes=8")
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
   106
                .shouldContain("Max heap size too large for Compressed Oops")
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
   107
                .shouldHaveExitValue(0);
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
   108
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
   109
            // 64gb heap and object alignment set to 16 bytes should result in a warning
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
   110
            testCompressedOops("-XX:+UseCompressedOops", "-Xmx64g", "-XX:ObjectAlignmentInBytes=16")
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
   111
                .shouldContain("Max heap size too large for Compressed Oops")
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
   112
                .shouldHaveExitValue(0);
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
   113
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
   114
        } else {
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
   115
            // Compressed oops should only apply to 64bit platforms
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
   116
            testCompressedOops("-XX:+UseCompressedOops", "-Xmx32m")
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
   117
                .shouldContain("Unrecognized VM option 'UseCompressedOops'")
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
   118
                .shouldHaveExitValue(1);
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
   119
        }
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
   120
    }
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
   121
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
   122
    private static OutputAnalyzer testCompressedOops(String... flags) throws Exception {
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
   123
        ArrayList<String> args = new ArrayList<>();
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
   124
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
   125
        // Always run with these three:
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
   126
        args.add("-XX:+UnlockDiagnosticVMOptions");
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
   127
        args.add("-XX:+PrintCompressedOopsMode");
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
   128
        args.add("-Xms32m");
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
   129
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
   130
        // Add the extra flags
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
   131
        Collections.addAll(args, flags);
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
   132
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
   133
        args.add("-version");
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
   134
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
   135
        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args.toArray(new String[0]));
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
   136
        return new OutputAnalyzer(pb.start());
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
   137
    }
bb0cdd873e51 8022865: [TESTBUG] Compressed Oops testing needs to be revised
ctornqvi
parents:
diff changeset
   138
}