Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/jdk17u
Path: blob/master/test/hotspot/jtreg/compiler/regalloc/TestC1OverlappingRegisterHint.java
64474 views
1
/*
2
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
*
5
* This code is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License version 2 only, as
7
* published by the Free Software Foundation.
8
*
9
* This code is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12
* version 2 for more details (a copy is included in the LICENSE file that
13
* accompanied this code).
14
*
15
* You should have received a copy of the GNU General Public License version
16
* 2 along with this work; if not, write to the Free Software Foundation,
17
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18
*
19
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20
* or visit www.oracle.com if you need additional information or have any
21
* questions.
22
*/
23
24
/*
25
* @test
26
* @bug 8249603
27
* @summary The C1 register allocator uses a register hint interval i as spill location for an interval j which
28
* overlaps with one of i's split children which has the same spill location which lets verification fail.
29
*
30
* @run main/othervm -Xcomp -XX:CompileCommand=compileonly,compiler.regalloc.TestC1OverlappingRegisterHint::*
31
* compiler.regalloc.TestC1OverlappingRegisterHint
32
*/
33
package compiler.regalloc;
34
35
public class TestC1OverlappingRegisterHint {
36
37
public static int iFldStatic = 10;
38
public int iFld = 11;
39
40
public int test() {
41
int a = 1;
42
int b = 2;
43
int c = 3;
44
int v = 4;
45
int w = 5;
46
int x = 6;
47
int y = 7;
48
int z = 8;
49
int iArr[] = new int[400];
50
51
double d = 1.5;
52
53
int k = 0;
54
for (a = 9; a < 283; a += 2) {
55
for (int i = 8; i < 183; i++) {
56
}
57
}
58
59
for (int i = 12; i < 283; i++) {
60
iFldStatic += i;
61
for (int j = 1; 93 > j; j += 2) {
62
x += (j - z);
63
c -= iFld;
64
k = 3;
65
while ((k -= 2) > 0) {
66
}
67
switch ((i % 8) + 52) {
68
case 52:
69
iArr[8] = 5;
70
for (int i20 = 1; i20 < 3; ++i20) {
71
x *= (int)d;
72
w += 5;
73
}
74
break;
75
case 53:
76
case 55:
77
v *= iFldStatic;
78
break;
79
case 56:
80
case 57:
81
try {
82
iArr[5] = a;
83
v = (a / b);
84
} catch (ArithmeticException a_e) {}
85
break;
86
default:
87
iFldStatic += iFldStatic;
88
}
89
}
90
}
91
return y + k;
92
}
93
94
public static void main(String[] strArr) {
95
TestC1OverlappingRegisterHint _instance = new TestC1OverlappingRegisterHint();
96
for (int i = 0; i < 10; i++) {
97
_instance.test();
98
}
99
}
100
}
101
102
103