author | tpivovarova |
Tue, 12 Jul 2016 18:24:48 +0300 | |
changeset 40059 | c2304140ed64 |
parent 36851 | 03e2f4d0a421 |
child 40651 | 998e35976abf |
child 40631 | ed82623d7831 |
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 |
|
ebd1fafcc362
8038636: speculative traps break when classes are redefined
roland
parents:
diff
changeset
|
24 |
/* |
ebd1fafcc362
8038636: speculative traps break when classes are redefined
roland
parents:
diff
changeset
|
25 |
* @test |
ebd1fafcc362
8038636: speculative traps break when classes are redefined
roland
parents:
diff
changeset
|
26 |
* @bug 8038636 |
ebd1fafcc362
8038636: speculative traps break when classes are redefined
roland
parents:
diff
changeset
|
27 |
* @library /testlibrary |
36851 | 28 |
* @modules java.base/jdk.internal.misc |
29678
dd2f3932c21e
8075586: Add @modules as needed to the open hotspot tests
ykantser
parents:
28736
diff
changeset
|
29 |
* java.instrument |
dd2f3932c21e
8075586: Add @modules as needed to the open hotspot tests
ykantser
parents:
28736
diff
changeset
|
30 |
* java.management |
40059 | 31 |
* @build compiler.profiling.spectrapredefineclass_classloaders.Agent |
32 |
* @run driver ClassFileInstaller compiler.profiling.spectrapredefineclass.Agent |
|
33 |
* @run driver compiler.profiling.spectrapredefineclass.Launcher |
|
34 |
* @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation |
|
35 |
* -XX:-UseOnStackReplacement -XX:TypeProfileLevel=222 |
|
36 |
* -XX:ReservedCodeCacheSize=3M |
|
37 |
* compiler.profiling.spectrapredefineclass.Agent |
|
23845
ebd1fafcc362
8038636: speculative traps break when classes are redefined
roland
parents:
diff
changeset
|
38 |
*/ |
40059 | 39 |
|
40 |
package compiler.profiling.spectrapredefineclass; |
|
41 |
||
42 |
import jdk.test.lib.JDKToolFinder; |
|
43 |
||
44 |
import java.io.File; |
|
45 |
import java.io.PrintWriter; |
|
46 |
||
23845
ebd1fafcc362
8038636: speculative traps break when classes are redefined
roland
parents:
diff
changeset
|
47 |
public class Launcher { |
ebd1fafcc362
8038636: speculative traps break when classes are redefined
roland
parents:
diff
changeset
|
48 |
public static void main(String[] args) throws Exception { |
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 |
PrintWriter pw = new PrintWriter("MANIFEST.MF"); |
40059 | 51 |
pw.println("Agent-Class: " + Launcher.class.getPackage().getName() +".Agent"); |
23845
ebd1fafcc362
8038636: speculative traps break when classes are redefined
roland
parents:
diff
changeset
|
52 |
pw.println("Can-Retransform-Classes: true"); |
ebd1fafcc362
8038636: speculative traps break when classes are redefined
roland
parents:
diff
changeset
|
53 |
pw.close(); |
ebd1fafcc362
8038636: speculative traps break when classes are redefined
roland
parents:
diff
changeset
|
54 |
|
ebd1fafcc362
8038636: speculative traps break when classes are redefined
roland
parents:
diff
changeset
|
55 |
ProcessBuilder pb = new ProcessBuilder(); |
40059 | 56 |
pb.command(new String[] { JDKToolFinder.getJDKTool("jar"), "cmf", "MANIFEST.MF", |
57 |
System.getProperty("test.classes",".") + "/agent.jar", |
|
58 |
"compiler/profiling/spectrapredefineclass/Agent.class".replace('/', File.separatorChar)}); |
|
23845
ebd1fafcc362
8038636: speculative traps break when classes are redefined
roland
parents:
diff
changeset
|
59 |
pb.start().waitFor(); |
ebd1fafcc362
8038636: speculative traps break when classes are redefined
roland
parents:
diff
changeset
|
60 |
} |
ebd1fafcc362
8038636: speculative traps break when classes are redefined
roland
parents:
diff
changeset
|
61 |
} |