test/hotspot/jtreg/compiler/ciReplay/VMBase.java
author jiangli
Fri, 02 Nov 2018 19:30:31 -0400
changeset 52397 1322829d1501
parent 47216 71c04702a3d5
permissions -rw-r--r--
8209564: runtime/appcds/CDSandJFR.java timeout on tier6 on sparc Summary: Set timeout 500 in CDSandJFR.java Reviewed-by: dcubed
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
42029
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
     1
/*
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
     2
 * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
     4
 *
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
     7
 * published by the Free Software Foundation.
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
     8
 *
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    13
 * accompanied this code).
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    14
 *
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    18
 *
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    21
 * questions.
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    22
 */
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    23
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    24
package compiler.ciReplay;
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    25
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    26
import compiler.whitebox.CompilerWhiteBoxTest;
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    27
import jdk.test.lib.Asserts;
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    28
import sun.hotspot.WhiteBox;
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    29
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    30
public class VMBase extends CiReplayBase {
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    31
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    32
    public static void main(String args[]) {
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    33
        new VMBase(args).runTest(/* needCoreDump = */ false, args);
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    34
    }
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    35
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    36
    public VMBase(String[] args) {
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    37
        super(args);
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    38
    }
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    39
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    40
    @Override
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    41
    public void testAction() {
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    42
        commonTests();
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    43
        runVmTests();
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    44
        cleanup();
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    45
        if (runServer.orElseThrow(() -> new Error("runServer must be set"))
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    46
                && WhiteBox.getWhiteBox().getBooleanVMFlag("TieredCompilation")) {
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    47
            for (int stop = 1; stop < CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION; stop++) {
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    48
                String vmOpt = "-XX:TieredStopAtLevel=" + stop;
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    49
                generateReplay(/* need coredump = */ false, vmOpt);
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    50
                int replayCompLevel = getCompLevelFromReplay();
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    51
                Asserts.assertGTE(stop, replayCompLevel, "Unexpected compLevel in replay");
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    52
                positiveTest(vmOpt);
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    53
            }
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    54
        }
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    55
    }
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    56
}
73e8eed6e85d 8155219: [TESTBUG] Rewrite compiler/ciReplay/TestVM.sh in java
dpochepk
parents:
diff changeset
    57