author | amlu |
Tue, 30 Jun 2015 10:00:46 +0200 | |
changeset 31427 | 42740247adcf |
parent 30604 | b8d532cb6420 |
child 36851 | 03e2f4d0a421 |
permissions | -rw-r--r-- |
23845
ebd1fafcc362
8038636: speculative traps break when classes are redefined
roland
parents:
diff
changeset
|
1 |
/* |
29678
dd2f3932c21e
8075586: Add @modules as needed to the open hotspot tests
ykantser
parents:
28736
diff
changeset
|
2 |
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. |
23845
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; |
30604
b8d532cb6420
8067013: Rename the com.oracle.java.testlibary package
ykantser
parents:
29678
diff
changeset
|
24 |
import jdk.test.lib.*; |
23845
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 |
29678
dd2f3932c21e
8075586: Add @modules as needed to the open hotspot tests
ykantser
parents:
28736
diff
changeset
|
30 |
* @modules java.base/sun.misc |
dd2f3932c21e
8075586: Add @modules as needed to the open hotspot tests
ykantser
parents:
28736
diff
changeset
|
31 |
* java.instrument |
dd2f3932c21e
8075586: Add @modules as needed to the open hotspot tests
ykantser
parents:
28736
diff
changeset
|
32 |
* java.management |
23845
ebd1fafcc362
8038636: speculative traps break when classes are redefined
roland
parents:
diff
changeset
|
33 |
* @build Agent |
ebd1fafcc362
8038636: speculative traps break when classes are redefined
roland
parents:
diff
changeset
|
34 |
* @run main ClassFileInstaller Agent |
ebd1fafcc362
8038636: speculative traps break when classes are redefined
roland
parents:
diff
changeset
|
35 |
* @run main Launcher |
24310
1cc31246af03
8039960: Unexpected exit from test compiler/profiling/spectrapredefineclass/Launcher.java
roland
parents:
23845
diff
changeset
|
36 |
* @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
|
37 |
*/ |
ebd1fafcc362
8038636: speculative traps break when classes are redefined
roland
parents:
diff
changeset
|
38 |
public class Launcher { |
ebd1fafcc362
8038636: speculative traps break when classes are redefined
roland
parents:
diff
changeset
|
39 |
public static void main(String[] args) throws Exception { |
ebd1fafcc362
8038636: speculative traps break when classes are redefined
roland
parents:
diff
changeset
|
40 |
|
ebd1fafcc362
8038636: speculative traps break when classes are redefined
roland
parents:
diff
changeset
|
41 |
PrintWriter pw = new PrintWriter("MANIFEST.MF"); |
ebd1fafcc362
8038636: speculative traps break when classes are redefined
roland
parents:
diff
changeset
|
42 |
pw.println("Agent-Class: Agent"); |
ebd1fafcc362
8038636: speculative traps break when classes are redefined
roland
parents:
diff
changeset
|
43 |
pw.println("Can-Retransform-Classes: true"); |
ebd1fafcc362
8038636: speculative traps break when classes are redefined
roland
parents:
diff
changeset
|
44 |
pw.close(); |
ebd1fafcc362
8038636: speculative traps break when classes are redefined
roland
parents:
diff
changeset
|
45 |
|
ebd1fafcc362
8038636: speculative traps break when classes are redefined
roland
parents:
diff
changeset
|
46 |
ProcessBuilder pb = new ProcessBuilder(); |
ebd1fafcc362
8038636: speculative traps break when classes are redefined
roland
parents:
diff
changeset
|
47 |
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
|
48 |
pb.start().waitFor(); |
ebd1fafcc362
8038636: speculative traps break when classes are redefined
roland
parents:
diff
changeset
|
49 |
} |
ebd1fafcc362
8038636: speculative traps break when classes are redefined
roland
parents:
diff
changeset
|
50 |
} |