ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/jsr166e/ConcurrentHashMapV8.java
(Generate patch)

Comparing jsr166/src/jsr166e/ConcurrentHashMapV8.java (file contents):
Revision 1.88 by jsr166, Fri Jan 18 04:23:27 2013 UTC vs.
Revision 1.89 by jsr166, Sat Jan 19 20:39:43 2013 UTC

# Line 6804 | Line 6804 | public class ConcurrentHashMapV8<K, V>
6804      private static final int ASHIFT;
6805  
6806      static {
6807        int ss;
6807          try {
6808              U = getUnsafe();
6809              Class<?> k = ConcurrentHashMapV8.class;
# Line 6823 | Line 6822 | public class ConcurrentHashMapV8<K, V>
6822                  (ck.getDeclaredField("value"));
6823              Class<?> sc = Node[].class;
6824              ABASE = U.arrayBaseOffset(sc);
6825 <            ss = U.arrayIndexScale(sc);
6826 <            ASHIFT = 31 - Integer.numberOfLeadingZeros(ss);
6825 >            int scale = U.arrayIndexScale(sc);
6826 >            if ((scale & (scale - 1)) != 0)
6827 >                throw new Error("data type scale not a power of two");
6828 >            ASHIFT = 31 - Integer.numberOfLeadingZeros(scale);
6829          } catch (Exception e) {
6830              throw new Error(e);
6831          }
6831        if ((ss & (ss-1)) != 0)
6832            throw new Error("data type scale not a power of two");
6832      }
6833  
6834      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines