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.87 by jsr166, Wed Jan 9 02:51:36 2013 UTC vs.
Revision 1.90 by dl, Tue Jan 22 20:17:55 2013 UTC

# Line 1785 | Line 1785 | public class ConcurrentHashMapV8<K, V>
1785                              }
1786                          }
1787                          if (len != 0) {
1788 <                            if (len > 1)
1788 >                            if (len > 1) {
1789                                  addCount(delta, len);
1790 +                                delta = 0L;
1791 +                            }
1792                              break;
1793                          }
1794                      }
# Line 4577 | Line 4579 | public class ConcurrentHashMapV8<K, V>
4579      /**
4580       * Base class for views.
4581       */
4582 <    static abstract class CHMView<K, V> {
4582 >    abstract static class CHMView<K, V> {
4583          final ConcurrentHashMapV8<K, V> map;
4584          CHMView(ConcurrentHashMapV8<K, V> map)  { this.map = map; }
4585  
# Line 4593 | Line 4595 | public class ConcurrentHashMapV8<K, V>
4595          public final void clear()               { map.clear(); }
4596  
4597          // implementations below rely on concrete classes supplying these
4598 <        abstract public Iterator<?> iterator();
4599 <        abstract public boolean contains(Object o);
4600 <        abstract public boolean remove(Object o);
4598 >        public abstract Iterator<?> iterator();
4599 >        public abstract boolean contains(Object o);
4600 >        public abstract boolean remove(Object o);
4601  
4602          private static final String oomeMsg = "Required array size too large";
4603  
# Line 6804 | Line 6806 | public class ConcurrentHashMapV8<K, V>
6806      private static final int ASHIFT;
6807  
6808      static {
6807        int ss;
6809          try {
6810              U = getUnsafe();
6811              Class<?> k = ConcurrentHashMapV8.class;
# Line 6823 | Line 6824 | public class ConcurrentHashMapV8<K, V>
6824                  (ck.getDeclaredField("value"));
6825              Class<?> sc = Node[].class;
6826              ABASE = U.arrayBaseOffset(sc);
6827 <            ss = U.arrayIndexScale(sc);
6828 <            ASHIFT = 31 - Integer.numberOfLeadingZeros(ss);
6827 >            int scale = U.arrayIndexScale(sc);
6828 >            if ((scale & (scale - 1)) != 0)
6829 >                throw new Error("data type scale not a power of two");
6830 >            ASHIFT = 31 - Integer.numberOfLeadingZeros(scale);
6831          } catch (Exception e) {
6832              throw new Error(e);
6833          }
6831        if ((ss & (ss-1)) != 0)
6832            throw new Error("data type scale not a power of two");
6834      }
6835  
6836      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines