hotspot/test/compiler/profiling/spectrapredefineclass/Launcher.java
author ykantser
Wed, 28 Jan 2015 09:27:49 +0100
changeset 28736 33ab13e70aa0
parent 28475 df94e3a24403
child 29678 dd2f3932c21e
permissions -rw-r--r--
8071545: Tests are still excluded while the appropriate bug has been fixed Reviewed-by: sspitsyn, sla
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
23845
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
     1
/*
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
     2
 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
     4
 *
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
     7
 * published by the Free Software Foundation.
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
     8
 *
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
    13
 * accompanied this code).
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
    14
 *
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
    18
 *
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
    21
 * questions.
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
    22
 */
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
    23
import java.io.PrintWriter;
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
    24
import com.oracle.java.testlibrary.*;
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
    25
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
    26
/*
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
    27
 * @test
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
    28
 * @bug 8038636
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
    29
 * @library /testlibrary
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
    30
 * @build Agent
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
    31
 * @run main ClassFileInstaller Agent
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
    32
 * @run main Launcher
24310
1cc31246af03 8039960: Unexpected exit from test compiler/profiling/spectrapredefineclass/Launcher.java
roland
parents: 23845
diff changeset
    33
 * @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:TypeProfileLevel=222 -XX:ReservedCodeCacheSize=3M Agent
23845
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
    34
 */
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
    35
public class Launcher {
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
    36
    public static void main(String[] args) throws Exception  {
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
    37
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
    38
      PrintWriter pw = new PrintWriter("MANIFEST.MF");
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
    39
      pw.println("Agent-Class: Agent");
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
    40
      pw.println("Can-Retransform-Classes: true");
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
    41
      pw.close();
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
    42
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
    43
      ProcessBuilder pb = new ProcessBuilder();
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
    44
      pb.command(new String[] { JDKToolFinder.getJDKTool("jar"), "cmf", "MANIFEST.MF", System.getProperty("test.classes",".") + "/agent.jar", "Agent.class"});
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
    45
      pb.start().waitFor();
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
    46
    }
ebd1fafcc362 8038636: speculative traps break when classes are redefined
roland
parents:
diff changeset
    47
}