author | sspitsyn |
Wed, 25 Feb 2015 01:02:04 -0800 | |
changeset 29383 | 971ae566f595 |
permissions | -rw-r--r-- |
29383
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
1 |
/* |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
2 |
* Copyright 2015 Google Inc. All Rights Reserved. |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
4 |
* |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
8 |
* |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
13 |
* accompanied this code). |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
14 |
* |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
18 |
* |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
21 |
* questions. |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
22 |
*/ |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
23 |
|
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
24 |
import java.io.File; |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
25 |
import java.io.FileWriter; |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
26 |
import java.io.PrintStream; |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
27 |
import java.lang.reflect.InvocationTargetException; |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
28 |
import java.lang.reflect.Method; |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
29 |
import java.lang.reflect.Type; |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
30 |
import java.net.URL; |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
31 |
import java.net.URLClassLoader; |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
32 |
import java.util.Arrays; |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
33 |
import java.util.List; |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
34 |
import javax.tools.JavaCompiler; |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
35 |
import javax.tools.StandardJavaFileManager; |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
36 |
import javax.tools.ToolProvider; |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
37 |
|
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
38 |
/** |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
39 |
* A manual benchmark of the JVMTI RedefineClasses when a |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
40 |
* single class (and its parent) contains many methods. |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
41 |
*/ |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
42 |
public class ManyMethodsBenchmarkApp { |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
43 |
// Limit is 64k but we can not put such many as the CP limit is 32k. |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
44 |
// In practice, it means a real limit is much lower (less than 22000). |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
45 |
static final int METHOD_COUNT = 20000; |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
46 |
|
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
47 |
static Class<?> loadClassInNewClassLoader(String className) throws Exception { |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
48 |
URL[] urls = { new File(".").toURI().toURL() }; |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
49 |
URLClassLoader ucl = new URLClassLoader(urls, null); |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
50 |
Class<?> klazz = Class.forName(className, true, ucl); |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
51 |
return klazz; |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
52 |
} |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
53 |
|
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
54 |
static void benchmarkClassOperations(String className) throws Exception { |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
55 |
Class<?> klazz = loadClassInNewClassLoader(className); |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
56 |
|
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
57 |
Method[] methods = klazz.getDeclaredMethods(); |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
58 |
if (methods.length != METHOD_COUNT) { |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
59 |
throw new AssertionError("unexpected method count: " + methods.length + |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
60 |
" expected: " + METHOD_COUNT); |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
61 |
} |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
62 |
|
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
63 |
methods = klazz.getMethods(); |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
64 |
// returned methods includes those inherited from Object |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
65 |
int objectMethodSlop = 100; |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
66 |
if (methods.length <= METHOD_COUNT || |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
67 |
methods.length >= METHOD_COUNT + objectMethodSlop) { |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
68 |
throw new AssertionError("unexpected method count: " + methods.length); |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
69 |
} |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
70 |
|
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
71 |
// Invoke methods to make them appear in the constant pool cache |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
72 |
Object obj = klazz.newInstance(); |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
73 |
Object[] args = new Object[0]; |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
74 |
for (Method m: methods) { |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
75 |
try { |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
76 |
Class<?>[] types = m.getParameterTypes(); |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
77 |
String name = m.getName(); |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
78 |
// System.out.println("method: " + name + "; argno: " + types.length); |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
79 |
if (types.length == 0 && name.length() == 2 && name.startsWith("f")) { |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
80 |
m.invoke(obj, args); |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
81 |
} |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
82 |
} catch (InvocationTargetException ex) { |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
83 |
ex.printStackTrace(); |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
84 |
} |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
85 |
} |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
86 |
} |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
87 |
|
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
88 |
public static void main(String[] args) throws Exception { |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
89 |
System.out.println("test started: ManyMethodsBenchmarkApp"); |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
90 |
|
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
91 |
// Create source files with many methods |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
92 |
File base = new File("Base.java"); |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
93 |
try (FileWriter fw = new FileWriter(base)) { |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
94 |
fw.write("public class Base {\n"); |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
95 |
final int L = 10; |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
96 |
// Each of the first L methods makes calls to its own chunk of METHOD_COUNT/L methods |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
97 |
for (int k = 0; k < L; k++) { |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
98 |
fw.write(" public void f" + k + "() {\n"); |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
99 |
int shift = (k == 0) ? L : 0; |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
100 |
for (int i = (k * (METHOD_COUNT/L)) + shift; i < (k + 1) * METHOD_COUNT/L; i++) { |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
101 |
fw.write(" f" + i + "();\n"); |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
102 |
} |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
103 |
fw.write(" }\n"); |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
104 |
} |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
105 |
|
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
106 |
// The rest of (METHOD_COUNT - L) methods have empty body |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
107 |
for (int i = L; i < METHOD_COUNT; i++) { |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
108 |
fw.write(" public static void f" + i + "() {}\n"); |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
109 |
} |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
110 |
fw.write("}\n"); |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
111 |
} |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
112 |
|
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
113 |
// Compile the generated source files. |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
114 |
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
115 |
List<File> files = Arrays.asList(new File[] { base }); |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
116 |
try (StandardJavaFileManager fileManager = |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
117 |
compiler.getStandardFileManager(null, null, null)) { |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
118 |
compiler.getTask(null, fileManager, null, null, null, |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
119 |
fileManager.getJavaFileObjectsFromFiles(files)) |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
120 |
.call(); |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
121 |
} |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
122 |
|
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
123 |
benchmarkClassOperations("Base"); |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
124 |
|
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
125 |
ManyMethodsBenchmarkAgent.instr(); |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
126 |
|
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
127 |
// Cleanup |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
128 |
base.delete(); |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
129 |
new File("Base.class").delete(); |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
130 |
if (!ManyMethodsBenchmarkAgent.completed) { |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
131 |
throw new Exception("ERROR: ManyMethodsBenchmarkAgent did not complete."); |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
132 |
} |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
133 |
|
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
134 |
if (ManyMethodsBenchmarkAgent.fail) { |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
135 |
throw new Exception("ERROR: ManyMethodsBenchmarkAgent failed."); |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
136 |
} else { |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
137 |
System.out.println("ManyMethodsBenchmarkAgent succeeded."); |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
138 |
} |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
139 |
System.out.println("test finished: ManyMethodsBenchmarkApp"); |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
140 |
} |
971ae566f595
8046246: the constantPoolCacheOopDesc::adjust_method_entries() used in RedefineClasses does not scale
sspitsyn
parents:
diff
changeset
|
141 |
} |