author | alanb |
Thu, 01 Dec 2016 15:54:39 +0000 | |
changeset 42309 | 21f9f3fbc302 |
parent 40631 | ed82623d7831 |
child 43455 | 96560cffef4d |
permissions | -rw-r--r-- |
28932
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
1 |
/* |
40631
ed82623d7831
8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents:
40067
diff
changeset
|
2 |
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. |
28932
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
4 |
* |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
8 |
* |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
13 |
* accompanied this code). |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
14 |
* |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
18 |
* |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
21 |
* questions. |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
22 |
*/ |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
23 |
|
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
24 |
/* |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
25 |
* @test |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
26 |
* @bug 8072016 |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
27 |
* @summary Infinite deoptimization/recompilation cycles in case of arraycopy with tightly coupled allocation |
40067
db6c74a53556
8151280: update hotspot tests to use vm.compMode instead of their own logic
tpivovarova
parents:
40059
diff
changeset
|
28 |
* @requires vm.flavor == "server" |
40631
ed82623d7831
8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents:
40067
diff
changeset
|
29 |
* @library /test/lib / |
36851 | 30 |
* @modules java.base/jdk.internal.misc |
29678
dd2f3932c21e
8075586: Add @modules as needed to the open hotspot tests
ykantser
parents:
28932
diff
changeset
|
31 |
* java.management |
40059 | 32 |
* |
40631
ed82623d7831
8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents:
40067
diff
changeset
|
33 |
* @build sun.hotspot.WhiteBox |
40059 | 34 |
* @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission |
30201
cfe623bb3f9c
8075663: compiler/rangechecks/TestExplicitRangeChecks.java fails in compiler nightlies
roland
parents:
30185
diff
changeset
|
35 |
* @run main/othervm -Xmixed -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI |
28932
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
36 |
* -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:TypeProfileLevel=020 |
40059 | 37 |
* compiler.arraycopy.TestArrayCopyNoInitDeopt |
28932
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
38 |
*/ |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
39 |
|
40059 | 40 |
package compiler.arraycopy; |
41 |
||
42 |
import compiler.whitebox.CompilerWhiteBoxTest; |
|
30604
b8d532cb6420
8067013: Rename the com.oracle.java.testlibary package
ykantser
parents:
30307
diff
changeset
|
43 |
import jdk.test.lib.Platform; |
40059 | 44 |
import sun.hotspot.WhiteBox; |
45 |
||
46 |
import java.lang.reflect.Method; |
|
28932
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
47 |
|
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
48 |
public class TestArrayCopyNoInitDeopt { |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
49 |
|
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
50 |
public static int[] m1(Object src) { |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
51 |
if (src == null) return null; |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
52 |
int[] dest = new int[10]; |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
53 |
try { |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
54 |
System.arraycopy(src, 0, dest, 0, 10); |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
55 |
} catch (ArrayStoreException npe) { |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
56 |
} |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
57 |
return dest; |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
58 |
} |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
59 |
|
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
60 |
static Object m2_src(Object src) { |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
61 |
return src; |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
62 |
} |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
63 |
|
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
64 |
public static int[] m2(Object src) { |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
65 |
if (src == null) return null; |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
66 |
src = m2_src(src); |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
67 |
int[] dest = new int[10]; |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
68 |
try { |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
69 |
System.arraycopy(src, 0, dest, 0, 10); |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
70 |
} catch (ArrayStoreException npe) { |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
71 |
} |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
72 |
return dest; |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
73 |
} |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
74 |
|
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
75 |
private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox(); |
38036
f51b942d970c
8154073: Several compiler tests fail when are executed with C1 only
thartmann
parents:
36851
diff
changeset
|
76 |
private static final int TIERED_STOP_AT_LEVEL = WHITE_BOX.getIntxVMFlag("TieredStopAtLevel").intValue(); |
28932
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
77 |
|
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
78 |
static boolean deoptimize(Method method, Object src_obj) throws Exception { |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
79 |
for (int i = 0; i < 10; i++) { |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
80 |
method.invoke(null, src_obj); |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
81 |
if (!WHITE_BOX.isMethodCompiled(method)) { |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
82 |
return true; |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
83 |
} |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
84 |
} |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
85 |
return false; |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
86 |
} |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
87 |
|
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
88 |
static public void main(String[] args) throws Exception { |
40067
db6c74a53556
8151280: update hotspot tests to use vm.compMode instead of their own logic
tpivovarova
parents:
40059
diff
changeset
|
89 |
if (!Platform.isServer()) { |
db6c74a53556
8151280: update hotspot tests to use vm.compMode instead of their own logic
tpivovarova
parents:
40059
diff
changeset
|
90 |
throw new Error("TESTBUG: Not server VM"); |
db6c74a53556
8151280: update hotspot tests to use vm.compMode instead of their own logic
tpivovarova
parents:
40059
diff
changeset
|
91 |
} |
38036
f51b942d970c
8154073: Several compiler tests fail when are executed with C1 only
thartmann
parents:
36851
diff
changeset
|
92 |
// Only execute if C2 is available |
40067
db6c74a53556
8151280: update hotspot tests to use vm.compMode instead of their own logic
tpivovarova
parents:
40059
diff
changeset
|
93 |
if (TIERED_STOP_AT_LEVEL == CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION) { |
28932
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
94 |
int[] src = new int[10]; |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
95 |
Object src_obj = new Object(); |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
96 |
Method method_m1 = TestArrayCopyNoInitDeopt.class.getMethod("m1", Object.class); |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
97 |
Method method_m2 = TestArrayCopyNoInitDeopt.class.getMethod("m2", Object.class); |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
98 |
|
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
99 |
// Warm up |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
100 |
for (int i = 0; i < 20000; i++) { |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
101 |
m1(src); |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
102 |
} |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
103 |
|
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
104 |
// And make sure m1 is compiled by C2 |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
105 |
WHITE_BOX.enqueueMethodForCompilation(method_m1, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION); |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
106 |
|
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
107 |
if (!WHITE_BOX.isMethodCompiled(method_m1)) { |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
108 |
throw new RuntimeException("m1 not compiled"); |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
109 |
} |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
110 |
|
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
111 |
// should deoptimize for type check |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
112 |
if (!deoptimize(method_m1, src_obj)) { |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
113 |
throw new RuntimeException("m1 not deoptimized"); |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
114 |
} |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
115 |
|
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
116 |
WHITE_BOX.enqueueMethodForCompilation(method_m1, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION); |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
117 |
|
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
118 |
if (!WHITE_BOX.isMethodCompiled(method_m1)) { |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
119 |
throw new RuntimeException("m1 not recompiled"); |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
120 |
} |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
121 |
|
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
122 |
if (deoptimize(method_m1, src_obj)) { |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
123 |
throw new RuntimeException("m1 deoptimized again"); |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
124 |
} |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
125 |
|
30307
9769a4813f52
8078444: compiler/arraycopy/TestArrayCopyNoInitDeopt.java fails with exception 'm2 not deoptimized'
roland
parents:
30216
diff
changeset
|
126 |
if (WHITE_BOX.getUintxVMFlag("TypeProfileLevel") == 20) { |
9769a4813f52
8078444: compiler/arraycopy/TestArrayCopyNoInitDeopt.java fails with exception 'm2 not deoptimized'
roland
parents:
30216
diff
changeset
|
127 |
// Same test as above but with speculative types |
28932
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
128 |
|
30307
9769a4813f52
8078444: compiler/arraycopy/TestArrayCopyNoInitDeopt.java fails with exception 'm2 not deoptimized'
roland
parents:
30216
diff
changeset
|
129 |
// Warm up & make sure we collect type profiling |
9769a4813f52
8078444: compiler/arraycopy/TestArrayCopyNoInitDeopt.java fails with exception 'm2 not deoptimized'
roland
parents:
30216
diff
changeset
|
130 |
for (int i = 0; i < 20000; i++) { |
9769a4813f52
8078444: compiler/arraycopy/TestArrayCopyNoInitDeopt.java fails with exception 'm2 not deoptimized'
roland
parents:
30216
diff
changeset
|
131 |
m2(src); |
9769a4813f52
8078444: compiler/arraycopy/TestArrayCopyNoInitDeopt.java fails with exception 'm2 not deoptimized'
roland
parents:
30216
diff
changeset
|
132 |
} |
28932
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
133 |
|
30307
9769a4813f52
8078444: compiler/arraycopy/TestArrayCopyNoInitDeopt.java fails with exception 'm2 not deoptimized'
roland
parents:
30216
diff
changeset
|
134 |
// And make sure m2 is compiled by C2 |
9769a4813f52
8078444: compiler/arraycopy/TestArrayCopyNoInitDeopt.java fails with exception 'm2 not deoptimized'
roland
parents:
30216
diff
changeset
|
135 |
WHITE_BOX.enqueueMethodForCompilation(method_m2, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION); |
28932
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
136 |
|
30307
9769a4813f52
8078444: compiler/arraycopy/TestArrayCopyNoInitDeopt.java fails with exception 'm2 not deoptimized'
roland
parents:
30216
diff
changeset
|
137 |
if (!WHITE_BOX.isMethodCompiled(method_m2)) { |
9769a4813f52
8078444: compiler/arraycopy/TestArrayCopyNoInitDeopt.java fails with exception 'm2 not deoptimized'
roland
parents:
30216
diff
changeset
|
138 |
throw new RuntimeException("m2 not compiled"); |
9769a4813f52
8078444: compiler/arraycopy/TestArrayCopyNoInitDeopt.java fails with exception 'm2 not deoptimized'
roland
parents:
30216
diff
changeset
|
139 |
} |
28932
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
140 |
|
30307
9769a4813f52
8078444: compiler/arraycopy/TestArrayCopyNoInitDeopt.java fails with exception 'm2 not deoptimized'
roland
parents:
30216
diff
changeset
|
141 |
// should deoptimize for speculative type check |
9769a4813f52
8078444: compiler/arraycopy/TestArrayCopyNoInitDeopt.java fails with exception 'm2 not deoptimized'
roland
parents:
30216
diff
changeset
|
142 |
if (!deoptimize(method_m2, src_obj)) { |
9769a4813f52
8078444: compiler/arraycopy/TestArrayCopyNoInitDeopt.java fails with exception 'm2 not deoptimized'
roland
parents:
30216
diff
changeset
|
143 |
throw new RuntimeException("m2 not deoptimized"); |
9769a4813f52
8078444: compiler/arraycopy/TestArrayCopyNoInitDeopt.java fails with exception 'm2 not deoptimized'
roland
parents:
30216
diff
changeset
|
144 |
} |
28932
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
145 |
|
30307
9769a4813f52
8078444: compiler/arraycopy/TestArrayCopyNoInitDeopt.java fails with exception 'm2 not deoptimized'
roland
parents:
30216
diff
changeset
|
146 |
WHITE_BOX.enqueueMethodForCompilation(method_m2, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION); |
28932
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
147 |
|
30307
9769a4813f52
8078444: compiler/arraycopy/TestArrayCopyNoInitDeopt.java fails with exception 'm2 not deoptimized'
roland
parents:
30216
diff
changeset
|
148 |
if (!WHITE_BOX.isMethodCompiled(method_m2)) { |
9769a4813f52
8078444: compiler/arraycopy/TestArrayCopyNoInitDeopt.java fails with exception 'm2 not deoptimized'
roland
parents:
30216
diff
changeset
|
149 |
throw new RuntimeException("m2 not recompiled"); |
9769a4813f52
8078444: compiler/arraycopy/TestArrayCopyNoInitDeopt.java fails with exception 'm2 not deoptimized'
roland
parents:
30216
diff
changeset
|
150 |
} |
28932
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
151 |
|
30307
9769a4813f52
8078444: compiler/arraycopy/TestArrayCopyNoInitDeopt.java fails with exception 'm2 not deoptimized'
roland
parents:
30216
diff
changeset
|
152 |
// should deoptimize for actual type check |
9769a4813f52
8078444: compiler/arraycopy/TestArrayCopyNoInitDeopt.java fails with exception 'm2 not deoptimized'
roland
parents:
30216
diff
changeset
|
153 |
if (!deoptimize(method_m2, src_obj)) { |
9769a4813f52
8078444: compiler/arraycopy/TestArrayCopyNoInitDeopt.java fails with exception 'm2 not deoptimized'
roland
parents:
30216
diff
changeset
|
154 |
throw new RuntimeException("m2 not deoptimized"); |
9769a4813f52
8078444: compiler/arraycopy/TestArrayCopyNoInitDeopt.java fails with exception 'm2 not deoptimized'
roland
parents:
30216
diff
changeset
|
155 |
} |
28932
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
156 |
|
30307
9769a4813f52
8078444: compiler/arraycopy/TestArrayCopyNoInitDeopt.java fails with exception 'm2 not deoptimized'
roland
parents:
30216
diff
changeset
|
157 |
WHITE_BOX.enqueueMethodForCompilation(method_m2, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION); |
28932
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
158 |
|
30307
9769a4813f52
8078444: compiler/arraycopy/TestArrayCopyNoInitDeopt.java fails with exception 'm2 not deoptimized'
roland
parents:
30216
diff
changeset
|
159 |
if (!WHITE_BOX.isMethodCompiled(method_m2)) { |
9769a4813f52
8078444: compiler/arraycopy/TestArrayCopyNoInitDeopt.java fails with exception 'm2 not deoptimized'
roland
parents:
30216
diff
changeset
|
160 |
throw new RuntimeException("m2 not recompiled"); |
9769a4813f52
8078444: compiler/arraycopy/TestArrayCopyNoInitDeopt.java fails with exception 'm2 not deoptimized'
roland
parents:
30216
diff
changeset
|
161 |
} |
28932
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
162 |
|
30307
9769a4813f52
8078444: compiler/arraycopy/TestArrayCopyNoInitDeopt.java fails with exception 'm2 not deoptimized'
roland
parents:
30216
diff
changeset
|
163 |
if (deoptimize(method_m2, src_obj)) { |
9769a4813f52
8078444: compiler/arraycopy/TestArrayCopyNoInitDeopt.java fails with exception 'm2 not deoptimized'
roland
parents:
30216
diff
changeset
|
164 |
throw new RuntimeException("m2 deoptimized again"); |
9769a4813f52
8078444: compiler/arraycopy/TestArrayCopyNoInitDeopt.java fails with exception 'm2 not deoptimized'
roland
parents:
30216
diff
changeset
|
165 |
} |
28932
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
166 |
} |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
167 |
} |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
168 |
} |
4df7f6cfac99
8072016: Array copy may cause infinite cycle of deoptimization/compilation
roland
parents:
diff
changeset
|
169 |
} |