1026 |
|
private static final int ABASE; |
1027 |
|
private static final int ASHIFT; |
1028 |
|
static { |
1029 |
– |
int s; |
1029 |
|
try { |
1030 |
|
U = sun.misc.Unsafe.getUnsafe(); |
1031 |
|
Class<?> k = WorkQueue.class; |
1033 |
|
QLOCK = U.objectFieldOffset |
1034 |
|
(k.getDeclaredField("qlock")); |
1035 |
|
ABASE = U.arrayBaseOffset(ak); |
1036 |
< |
s = U.arrayIndexScale(ak); |
1036 |
> |
int scale = U.arrayIndexScale(ak); |
1037 |
> |
if ((scale & (scale - 1)) != 0) |
1038 |
> |
throw new Error("data type scale not a power of two"); |
1039 |
> |
ASHIFT = 31 - Integer.numberOfLeadingZeros(scale); |
1040 |
|
} catch (Exception e) { |
1041 |
|
throw new Error(e); |
1042 |
|
} |
1041 |
– |
if ((s & (s-1)) != 0) |
1042 |
– |
throw new Error("data type scale not a power of two"); |
1043 |
– |
ASHIFT = 31 - Integer.numberOfLeadingZeros(s); |
1043 |
|
} |
1044 |
|
} |
1045 |
|
|
3286 |
|
private static final long QLOCK; |
3287 |
|
|
3288 |
|
static { |
3289 |
< |
int s; // initialize field offsets for CAS etc |
3289 |
> |
// initialize field offsets for CAS etc |
3290 |
|
try { |
3291 |
|
U = sun.misc.Unsafe.getUnsafe(); |
3292 |
|
Class<?> k = ForkJoinPool.class; |
3306 |
|
(wk.getDeclaredField("qlock")); |
3307 |
|
Class<?> ak = ForkJoinTask[].class; |
3308 |
|
ABASE = U.arrayBaseOffset(ak); |
3309 |
< |
s = U.arrayIndexScale(ak); |
3310 |
< |
ASHIFT = 31 - Integer.numberOfLeadingZeros(s); |
3309 |
> |
int scale = U.arrayIndexScale(ak); |
3310 |
> |
if ((scale & (scale - 1)) != 0) |
3311 |
> |
throw new Error("data type scale not a power of two"); |
3312 |
> |
ASHIFT = 31 - Integer.numberOfLeadingZeros(scale); |
3313 |
|
} catch (Exception e) { |
3314 |
|
throw new Error(e); |
3315 |
|
} |
3315 |
– |
if ((s & (s-1)) != 0) |
3316 |
– |
throw new Error("data type scale not a power of two"); |
3316 |
|
|
3317 |
|
submitters = new ThreadLocal<Submitter>(); |
3318 |
|
ForkJoinWorkerThreadFactory fac = defaultForkJoinWorkerThreadFactory = |