Mercurial > hg > truffle
annotate test/compiler/6661247/Test.java @ 15557:8a66b661ed49
BaselineBytecodeParser: initial genArrayLength().
author | Josef Eisl <josef.eisl@jku.at> |
---|---|
date | Tue, 06 May 2014 20:10:28 +0200 |
parents | c18cbe5936b8 |
children |
rev | line source |
---|---|
70
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
1 /* |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
196
diff
changeset
|
2 * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. |
177 | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
70
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
4 * |
177 | 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. | |
70
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
8 * |
177 | 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). | |
70
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
14 * |
177 | 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. | |
70
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
18 * |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
196
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
196
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
196
diff
changeset
|
21 * questions. |
70
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
22 * |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
23 */ |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
24 |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
25 /* |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
26 * @test |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
27 * @bug 6661247 |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
28 * @summary Internal bug in 32-bit HotSpot optimizer while bit manipulations |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
29 */ |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
30 |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
31 import java.util.Random; |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
32 import java.nio.*; |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
33 |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
34 // This isn't a completely reliable test for 6661247 since the results |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
35 // depend on what the local schedule looks like but it does reproduce |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
36 // the issue in current builds. |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
37 |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
38 public class Test { |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
39 |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
40 public static void test(boolean[] src, int srcPos, LongBuffer dest, long destPos, int count) { |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
41 int countStart = (destPos & 63) == 0 ? 0 : 64 - (int)(destPos & 63); |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
42 if (countStart > count) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
43 countStart = count; |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
44 for (int srcPosMax = srcPos + countStart; srcPos < srcPosMax; srcPos++, destPos++) { |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
45 if (src[srcPos]) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
46 dest.put((int)(destPos >>> 6), dest.get((int)(destPos >>> 6)) | 1L << (destPos & 63)); |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
47 else |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
48 dest.put((int)(destPos >>> 6), dest.get((int)(destPos >>> 6)) & ~(1L << (destPos & 63))); |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
49 } |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
50 count -= countStart; |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
51 int cnt = count >>> 6; |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
52 for (int k = (int)(destPos >>> 6), kMax = k + cnt; k < kMax; k++) { |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
53 int low = (src[srcPos] ? 1 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
54 | (src[srcPos + 1] ? 1 << 1 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
55 | (src[srcPos + 2] ? 1 << 2 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
56 | (src[srcPos + 3] ? 1 << 3 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
57 | (src[srcPos + 4] ? 1 << 4 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
58 | (src[srcPos + 5] ? 1 << 5 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
59 | (src[srcPos + 6] ? 1 << 6 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
60 | (src[srcPos + 7] ? 1 << 7 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
61 | (src[srcPos + 8] ? 1 << 8 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
62 | (src[srcPos + 9] ? 1 << 9 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
63 | (src[srcPos + 10] ? 1 << 10 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
64 | (src[srcPos + 11] ? 1 << 11 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
65 | (src[srcPos + 12] ? 1 << 12 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
66 | (src[srcPos + 13] ? 1 << 13 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
67 | (src[srcPos + 14] ? 1 << 14 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
68 | (src[srcPos + 15] ? 1 << 15 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
69 | (src[srcPos + 16] ? 1 << 16 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
70 | (src[srcPos + 17] ? 1 << 17 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
71 | (src[srcPos + 18] ? 1 << 18 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
72 | (src[srcPos + 19] ? 1 << 19 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
73 | (src[srcPos + 20] ? 1 << 20 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
74 | (src[srcPos + 21] ? 1 << 21 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
75 | (src[srcPos + 22] ? 1 << 22 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
76 | (src[srcPos + 23] ? 1 << 23 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
77 | (src[srcPos + 24] ? 1 << 24 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
78 | (src[srcPos + 25] ? 1 << 25 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
79 | (src[srcPos + 26] ? 1 << 26 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
80 | (src[srcPos + 27] ? 1 << 27 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
81 | (src[srcPos + 28] ? 1 << 28 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
82 | (src[srcPos + 29] ? 1 << 29 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
83 | (src[srcPos + 30] ? 1 << 30 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
84 | (src[srcPos + 31] ? 1 << 31 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
85 ; |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
86 srcPos += 32; |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
87 int high = (src[srcPos] ? 1 : 0) // PROBLEM! |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
88 | (src[srcPos + 1] ? 1 << 1 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
89 | (src[srcPos + 2] ? 1 << 2 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
90 | (src[srcPos + 3] ? 1 << 3 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
91 | (src[srcPos + 4] ? 1 << 4 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
92 | (src[srcPos + 5] ? 1 << 5 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
93 | (src[srcPos + 6] ? 1 << 6 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
94 | (src[srcPos + 7] ? 1 << 7 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
95 | (src[srcPos + 8] ? 1 << 8 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
96 | (src[srcPos + 9] ? 1 << 9 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
97 | (src[srcPos + 10] ? 1 << 10 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
98 | (src[srcPos + 11] ? 1 << 11 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
99 | (src[srcPos + 12] ? 1 << 12 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
100 | (src[srcPos + 13] ? 1 << 13 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
101 | (src[srcPos + 14] ? 1 << 14 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
102 | (src[srcPos + 15] ? 1 << 15 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
103 | (src[srcPos + 16] ? 1 << 16 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
104 | (src[srcPos + 17] ? 1 << 17 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
105 | (src[srcPos + 18] ? 1 << 18 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
106 | (src[srcPos + 19] ? 1 << 19 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
107 | (src[srcPos + 20] ? 1 << 20 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
108 | (src[srcPos + 21] ? 1 << 21 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
109 | (src[srcPos + 22] ? 1 << 22 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
110 | (src[srcPos + 23] ? 1 << 23 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
111 | (src[srcPos + 24] ? 1 << 24 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
112 | (src[srcPos + 25] ? 1 << 25 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
113 | (src[srcPos + 26] ? 1 << 26 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
114 | (src[srcPos + 27] ? 1 << 27 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
115 | (src[srcPos + 28] ? 1 << 28 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
116 | (src[srcPos + 29] ? 1 << 29 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
117 | (src[srcPos + 30] ? 1 << 30 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
118 | (src[srcPos + 31] ? 1 << 31 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
119 ; |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
120 srcPos += 32; |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
121 dest.put(k, ((long)low & 0xFFFFFFFFL) | (((long)high) << 32)); |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
122 destPos += 64; |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
123 } |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
124 int countFinish = count & 63; |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
125 for (int srcPosMax = srcPos + countFinish; srcPos < srcPosMax; srcPos++, destPos++) { |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
126 if (src[srcPos]) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
127 dest.put((int)(destPos >>> 6), dest.get((int)(destPos >>> 6)) | 1L << (destPos & 63)); |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
128 else |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
129 dest.put((int)(destPos >>> 6), dest.get((int)(destPos >>> 6)) & ~(1L << (destPos & 63))); |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
130 } |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
131 } |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
132 public static void main(String[] args) { |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
133 Random r = new Random(); |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
134 int entries = 1000; |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
135 boolean[] src = new boolean[entries * 64]; |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
136 long[] dest = new long[entries]; |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
137 long[] result = new long[entries]; |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
138 |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
139 for (int c = 0; c < 2000; c++) { |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
140 for (int i = 0; i < entries; i++) { |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
141 long l = r.nextLong(); |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
142 for (int bit = 0; bit < 64; bit++) { |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
143 src[i * 64 + bit] = (l & (1L << bit)) != 0; |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
144 } |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
145 dest[i] = 0; |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
146 result[i] = l; |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
147 } |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
148 test(src, 0, LongBuffer.wrap(dest, 0, dest.length), 0, src.length); |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
149 for (int i = 0; i < entries; i++) { |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
150 if (dest[i] != result[i]) { |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
151 throw new InternalError(i + ": " + Long.toHexString(dest[i]) + " != " + Long.toHexString(result[i])); |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
152 } |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
153 } |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
154 } |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
155 } |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
156 } |