Mercurial > hg > truffle
annotate test/compiler/6661247/Test.java @ 208:35ca13d63fe8
6688799: Second fix for Guarantee failure "Unexpected dirty card found"
Summary: Expand cardtable without committing over existing regions.
Reviewed-by: apetrusenko
author | jmasa |
---|---|
date | Tue, 10 Jun 2008 07:26:42 -0700 |
parents | b683f557224b |
children | 2a8ec427fbe1 |
rev | line source |
---|---|
70
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
1 /* |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
2 * Copyright 2008 Sun Microsystems, Inc. All rights reserved. |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
3 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
4 * |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
5 * |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
6 * |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
7 * |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
8 * |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
9 * |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
10 * |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
11 * |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
12 * |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
13 * |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
14 * |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
15 * |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
16 * |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
17 * |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
18 * |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
19 * |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
20 * |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
21 * |
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 * @test |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
26 * @bug 6661247 |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
27 * @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
|
28 */ |
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 import java.util.Random; |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
31 import java.nio.*; |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
32 |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
33 // 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
|
34 // 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
|
35 // the issue in current builds. |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
36 |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
37 public class Test { |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
38 |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
39 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
|
40 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
|
41 if (countStart > count) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
42 countStart = count; |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
43 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
|
44 if (src[srcPos]) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
45 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
|
46 else |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
47 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
|
48 } |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
49 count -= countStart; |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
50 int cnt = count >>> 6; |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
51 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
|
52 int low = (src[srcPos] ? 1 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
53 | (src[srcPos + 1] ? 1 << 1 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
54 | (src[srcPos + 2] ? 1 << 2 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
55 | (src[srcPos + 3] ? 1 << 3 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
56 | (src[srcPos + 4] ? 1 << 4 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
57 | (src[srcPos + 5] ? 1 << 5 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
58 | (src[srcPos + 6] ? 1 << 6 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
59 | (src[srcPos + 7] ? 1 << 7 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
60 | (src[srcPos + 8] ? 1 << 8 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
61 | (src[srcPos + 9] ? 1 << 9 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
62 | (src[srcPos + 10] ? 1 << 10 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
63 | (src[srcPos + 11] ? 1 << 11 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
64 | (src[srcPos + 12] ? 1 << 12 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
65 | (src[srcPos + 13] ? 1 << 13 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
66 | (src[srcPos + 14] ? 1 << 14 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
67 | (src[srcPos + 15] ? 1 << 15 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
68 | (src[srcPos + 16] ? 1 << 16 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
69 | (src[srcPos + 17] ? 1 << 17 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
70 | (src[srcPos + 18] ? 1 << 18 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
71 | (src[srcPos + 19] ? 1 << 19 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
72 | (src[srcPos + 20] ? 1 << 20 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
73 | (src[srcPos + 21] ? 1 << 21 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
74 | (src[srcPos + 22] ? 1 << 22 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
75 | (src[srcPos + 23] ? 1 << 23 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
76 | (src[srcPos + 24] ? 1 << 24 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
77 | (src[srcPos + 25] ? 1 << 25 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
78 | (src[srcPos + 26] ? 1 << 26 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
79 | (src[srcPos + 27] ? 1 << 27 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
80 | (src[srcPos + 28] ? 1 << 28 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
81 | (src[srcPos + 29] ? 1 << 29 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
82 | (src[srcPos + 30] ? 1 << 30 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
83 | (src[srcPos + 31] ? 1 << 31 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
84 ; |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
85 srcPos += 32; |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
86 int high = (src[srcPos] ? 1 : 0) // PROBLEM! |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
87 | (src[srcPos + 1] ? 1 << 1 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
88 | (src[srcPos + 2] ? 1 << 2 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
89 | (src[srcPos + 3] ? 1 << 3 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
90 | (src[srcPos + 4] ? 1 << 4 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
91 | (src[srcPos + 5] ? 1 << 5 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
92 | (src[srcPos + 6] ? 1 << 6 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
93 | (src[srcPos + 7] ? 1 << 7 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
94 | (src[srcPos + 8] ? 1 << 8 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
95 | (src[srcPos + 9] ? 1 << 9 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
96 | (src[srcPos + 10] ? 1 << 10 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
97 | (src[srcPos + 11] ? 1 << 11 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
98 | (src[srcPos + 12] ? 1 << 12 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
99 | (src[srcPos + 13] ? 1 << 13 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
100 | (src[srcPos + 14] ? 1 << 14 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
101 | (src[srcPos + 15] ? 1 << 15 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
102 | (src[srcPos + 16] ? 1 << 16 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
103 | (src[srcPos + 17] ? 1 << 17 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
104 | (src[srcPos + 18] ? 1 << 18 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
105 | (src[srcPos + 19] ? 1 << 19 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
106 | (src[srcPos + 20] ? 1 << 20 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
107 | (src[srcPos + 21] ? 1 << 21 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
108 | (src[srcPos + 22] ? 1 << 22 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
109 | (src[srcPos + 23] ? 1 << 23 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
110 | (src[srcPos + 24] ? 1 << 24 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
111 | (src[srcPos + 25] ? 1 << 25 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
112 | (src[srcPos + 26] ? 1 << 26 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
113 | (src[srcPos + 27] ? 1 << 27 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
114 | (src[srcPos + 28] ? 1 << 28 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
115 | (src[srcPos + 29] ? 1 << 29 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
116 | (src[srcPos + 30] ? 1 << 30 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
117 | (src[srcPos + 31] ? 1 << 31 : 0) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
118 ; |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
119 srcPos += 32; |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
120 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
|
121 destPos += 64; |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
122 } |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
123 int countFinish = count & 63; |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
124 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
|
125 if (src[srcPos]) |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
126 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
|
127 else |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
128 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
|
129 } |
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 public static void main(String[] args) { |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
132 Random r = new Random(); |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
133 int entries = 1000; |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
134 boolean[] src = new boolean[entries * 64]; |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
135 long[] dest = new long[entries]; |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
136 long[] result = new long[entries]; |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
137 |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
138 for (int c = 0; c < 2000; c++) { |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
139 for (int i = 0; i < entries; i++) { |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
140 long l = r.nextLong(); |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
141 for (int bit = 0; bit < 64; bit++) { |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
142 src[i * 64 + bit] = (l & (1L << bit)) != 0; |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
143 } |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
144 dest[i] = 0; |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
145 result[i] = l; |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
146 } |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
147 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
|
148 for (int i = 0; i < entries; i++) { |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
149 if (dest[i] != result[i]) { |
b683f557224b
6661247: Internal bug in 32-bit HotSpot optimizer while bit manipulations
never
parents:
diff
changeset
|
150 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
|
151 } |
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 } |