1026 |
|
private static final int ABASE; |
1027 |
|
private static final int ASHIFT; |
1028 |
|
static { |
1029 |
– |
int s; |
1029 |
|
try { |
1030 |
|
U = 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 |
|
|
3329 |
|
private static final long QLOCK; |
3330 |
|
|
3331 |
|
static { |
3332 |
< |
int s; // initialize field offsets for CAS etc |
3332 |
> |
// initialize field offsets for CAS etc |
3333 |
|
try { |
3334 |
|
U = getUnsafe(); |
3335 |
|
Class<?> k = ForkJoinPool.class; |
3349 |
|
(wk.getDeclaredField("qlock")); |
3350 |
|
Class<?> ak = ForkJoinTask[].class; |
3351 |
|
ABASE = U.arrayBaseOffset(ak); |
3352 |
< |
s = U.arrayIndexScale(ak); |
3353 |
< |
ASHIFT = 31 - Integer.numberOfLeadingZeros(s); |
3352 |
> |
int scale = U.arrayIndexScale(ak); |
3353 |
> |
if ((scale & (scale - 1)) != 0) |
3354 |
> |
throw new Error("data type scale not a power of two"); |
3355 |
> |
ASHIFT = 31 - Integer.numberOfLeadingZeros(scale); |
3356 |
|
} catch (Exception e) { |
3357 |
|
throw new Error(e); |
3358 |
|
} |
3358 |
– |
if ((s & (s-1)) != 0) |
3359 |
– |
throw new Error("data type scale not a power of two"); |
3359 |
|
|
3360 |
|
submitters = new ThreadLocal<Submitter>(); |
3361 |
|
ForkJoinWorkerThreadFactory fac = defaultForkJoinWorkerThreadFactory = |