Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/hotspot/jtreg/compiler/loopopts/LoopUnrollBadNodeBudget.java
41149 views
1
/*
2
* Copyright (c) 2019, 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 8229499
27
* @summary Node estimate for loop unrolling is not correct/sufficient:
28
* assert(delta <= 2 * required) failed: Bad node estimate ...
29
*
30
* @requires !vm.graal.enabled
31
*
32
* @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation
33
* LoopUnrollBadNodeBudget
34
*
35
*/
36
37
public class LoopUnrollBadNodeBudget {
38
39
int a;
40
long b;
41
int c;
42
int d(long e, short f, int g) {
43
int h, j = 2, k, l[][] = new int[a][];
44
for (h = 8; h < 58; ++h)
45
for (k = 1; 7 > k; ++k)
46
switch (h % 9 * 5 + 43) {
47
case 70:
48
case 65:
49
case 86:
50
case 81:
51
case 62:
52
case 69:
53
case 74:
54
g = j;
55
}
56
long m = u(l);
57
return (int)m;
58
}
59
void n(int p, int o) { d(b, (short)0, p); }
60
void r(String[] q) {
61
int i = 4;
62
n(i, c);
63
}
64
long u(int[][] a) {
65
long sum = 0;
66
return sum;
67
}
68
public static void main(String[] t) {
69
try {
70
LoopUnrollBadNodeBudget s = new LoopUnrollBadNodeBudget();
71
for (int i = 5000; i > 0; i--)
72
s.r(t);
73
} catch (Exception ex) {
74
}
75
}
76
}
77
78