author | iignatyev |
Thu, 04 Dec 2014 14:14:09 -0800 | |
changeset 27925 | 84a23e5ef17c |
parent 25958 | 8dc85547d6d6 |
child 28190 | 5a6b07edeb21 |
permissions | -rw-r--r-- |
24011
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
1 |
/* |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
2 |
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
4 |
* |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
8 |
* |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
13 |
* accompanied this code). |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
14 |
* |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
18 |
* |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
21 |
* questions. |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
22 |
*/ |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
23 |
|
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
24 |
/* |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
25 |
* @test CorrectnessTest |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
26 |
* @bug 8038418 |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
27 |
* @library /testlibrary /testlibrary/whitebox |
27925 | 28 |
* @ignore 8066173 |
24011
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
29 |
* @compile execution/TypeConflict.java execution/TypeProfile.java |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
30 |
* execution/MethodHandleDelegate.java |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
31 |
* @build CorrectnessTest |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
32 |
* @run main ClassFileInstaller sun.hotspot.WhiteBox |
25958
8dc85547d6d6
8011397: JTREG needs to copy additional WhiteBox class file to JTwork/scratch/sun/hotspot
mgerdin
parents:
24011
diff
changeset
|
33 |
* sun.hotspot.WhiteBox$WhiteBoxPermission |
24011
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
34 |
* @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
35 |
* -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
36 |
* -XX:TypeProfileLevel=222 -XX:+UseTypeSpeculation |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
37 |
* -XX:CompileCommand=exclude,execution/*::methodNotToCompile |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
38 |
* -XX:CompileCommand=dontinline,scenarios/Scenario::collectReturnType |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
39 |
* CorrectnessTest RETURN |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
40 |
* @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
41 |
* -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
42 |
* -XX:TypeProfileLevel=222 -XX:+UseTypeSpeculation |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
43 |
* -XX:CompileCommand=exclude,execution/*::methodNotToCompile |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
44 |
* -XX:CompileCommand=dontinline,scenarios/Scenario::collectReturnType |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
45 |
* CorrectnessTest PARAMETERS |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
46 |
* @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
47 |
* -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
48 |
* -XX:TypeProfileLevel=222 -XX:+UseTypeSpeculation |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
49 |
* -XX:CompileCommand=exclude,execution/*::methodNotToCompile |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
50 |
* -XX:CompileCommand=dontinline,scenarios/Scenario::collectReturnType |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
51 |
* CorrectnessTest ARGUMENTS |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
52 |
* @summary Tests correctness of type usage with type profiling and speculations |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
53 |
*/ |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
54 |
|
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
55 |
import com.oracle.java.testlibrary.Asserts; |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
56 |
import com.oracle.java.testlibrary.Platform; |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
57 |
import execution.Execution; |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
58 |
import execution.MethodHandleDelegate; |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
59 |
import execution.TypeConflict; |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
60 |
import execution.TypeProfile; |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
61 |
import hierarchies.*; |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
62 |
import scenarios.*; |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
63 |
import sun.hotspot.WhiteBox; |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
64 |
|
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
65 |
import java.lang.reflect.Constructor; |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
66 |
import java.lang.reflect.Method; |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
67 |
import java.util.ArrayList; |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
68 |
import java.util.List; |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
69 |
import java.util.function.BiFunction; |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
70 |
|
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
71 |
public class CorrectnessTest { |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
72 |
private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox(); |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
73 |
|
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
74 |
public static void main(String[] args) { |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
75 |
if (!Platform.isServer()) { |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
76 |
System.out.println("ALL TESTS SKIPPED"); |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
77 |
} |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
78 |
Asserts.assertGTE(args.length, 1); |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
79 |
ProfilingType profilingType = ProfilingType.valueOf(args[0]); |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
80 |
if (runTests(profilingType)) { |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
81 |
System.out.println("ALL TESTS PASSED"); |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
82 |
} else { |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
83 |
throw new RuntimeException("SOME TESTS FAILED"); |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
84 |
} |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
85 |
} |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
86 |
|
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
87 |
@SuppressWarnings("unchecked") |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
88 |
public static boolean runTests(ProfilingType profilingType) { |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
89 |
boolean result = true; |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
90 |
|
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
91 |
List<Execution> executionList = new ArrayList<>(); |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
92 |
executionList.add(new TypeConflict()); |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
93 |
executionList.add(new TypeProfile()); |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
94 |
for (int i = 0, n = executionList.size(); i < n; i++) { |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
95 |
executionList.add(new MethodHandleDelegate(executionList.get(i))); |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
96 |
} |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
97 |
|
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
98 |
List<TypeHierarchy> hierarchyList = new ArrayList<>(); |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
99 |
hierarchyList.add(new DefaultMethodInterface.Hierarchy()); |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
100 |
hierarchyList.add(new DefaultMethodInterface2.Hierarchy()); |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
101 |
hierarchyList.add(new Linear.Hierarchy()); |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
102 |
hierarchyList.add(new Linear2.Hierarchy()); |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
103 |
hierarchyList.add(new OneRank.Hierarchy()); |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
104 |
for (int i = 0, n = hierarchyList.size(); i < n; i++) { |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
105 |
hierarchyList.add(new NullableType(hierarchyList.get(i))); |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
106 |
} |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
107 |
|
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
108 |
List<BiFunction<ProfilingType, TypeHierarchy, Scenario<?, ?>>> testCasesConstructors |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
109 |
= new ArrayList<>(); |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
110 |
testCasesConstructors.add(ArrayCopy::new); |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
111 |
testCasesConstructors.add(ArrayReferenceStore::new); |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
112 |
testCasesConstructors.add(ClassIdentity::new); |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
113 |
testCasesConstructors.add(ClassInstanceOf::new); |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
114 |
testCasesConstructors.add(ClassIsInstance::new); |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
115 |
testCasesConstructors.add(ReceiverAtInvokes::new); |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
116 |
testCasesConstructors.add(CheckCast::new); |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
117 |
|
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
118 |
for (TypeHierarchy hierarchy : hierarchyList) { |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
119 |
for (BiFunction<ProfilingType, TypeHierarchy, Scenario<?, ?>> constructor : testCasesConstructors) { |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
120 |
for (Execution execution : executionList) { |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
121 |
Scenario<?, ?> scenario = constructor.apply(profilingType, hierarchy); |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
122 |
if (scenario.isApplicable()) { |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
123 |
result &= executeTest(hierarchy, execution, scenario); |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
124 |
} |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
125 |
} |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
126 |
} |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
127 |
} |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
128 |
return result; |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
129 |
} |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
130 |
|
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
131 |
/** |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
132 |
* Executes test case |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
133 |
* |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
134 |
* @param hierarchy type hierarchy for the test |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
135 |
* @param execution execution scenario |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
136 |
* @param scenario test scenario executed with given Execution |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
137 |
*/ |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
138 |
private static boolean executeTest(TypeHierarchy hierarchy, Execution execution, Scenario<?, ?> scenario) { |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
139 |
boolean testCaseResult = false; |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
140 |
String testName = hierarchy.getClass().getName() + " :: " + scenario.getName() + " @ " + execution.getName(); |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
141 |
clearAllMethodsState(scenario.getClass()); |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
142 |
try { |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
143 |
execution.execute(scenario); |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
144 |
testCaseResult = true; |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
145 |
} catch (Exception e) { |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
146 |
System.err.println(testName + " failed with exception " + e); |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
147 |
e.printStackTrace(); |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
148 |
} |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
149 |
System.out.println((testCaseResult ? "PASSED: " : "FAILED: ") + testName); |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
150 |
return testCaseResult; |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
151 |
} |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
152 |
|
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
153 |
private static void clearAllMethodsState(Class aClass) { |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
154 |
while (aClass != null) { |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
155 |
for (Method m : aClass.getDeclaredMethods()) { |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
156 |
WHITE_BOX.clearMethodState(m); |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
157 |
} |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
158 |
aClass = aClass.getSuperclass(); |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
159 |
} |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
160 |
} |
c2dc59a495eb
8038418: New tests development for type profiling and speculation
iignatyev
parents:
diff
changeset
|
161 |
} |