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.62 by dl, Fri Sep 21 18:41:30 2012 UTC vs.
Revision 1.63 by dl, Sat Sep 29 16:01:22 2012 UTC

# Line 2287 | Line 2287 | public class ConcurrentHashMapV8<K, V>
2287          int index;           // index of bin to use next
2288          int baseIndex;       // current index of initial table
2289          int baseLimit;       // index bound for initial table
2290 <        final int baseSize;  // initial table size
2290 >        int baseSize;        // initial table size
2291  
2292          /** Creates iterator for all entries in the table. */
2293          Traverser(ConcurrentHashMapV8<K, V> map) {
2294 <            this.tab = (this.map = map).table;
2295 <            baseLimit = baseSize = (tab == null) ? 0 : tab.length;
2294 >            this.map = map;
2295          }
2296  
2297          /** Creates iterator for split() methods */
2298          Traverser(Traverser<K,V,?> it) {
2299 <            this.map = it.map;
2300 <            this.tab = it.tab;
2299 >            ConcurrentHashMapV8<K, V> m; Node[] t;
2300 >            if ((m = this.map = it.map) == null)
2301 >                t = null;
2302 >            else if ((t = it.tab) == null && // force parent tab initialization
2303 >                     (t = it.tab = m.table) != null)
2304 >                it.baseLimit = it.baseSize = t.length;
2305 >            this.tab = t;
2306              this.baseSize = it.baseSize;
2307              it.baseLimit = this.index = this.baseIndex =
2308                  ((this.baseLimit = it.baseLimit) + it.baseIndex + 1) >>> 1;
# Line 2315 | Line 2319 | public class ConcurrentHashMapV8<K, V>
2319                  if (e != null)                  // advance past used/skipped node
2320                      e = e.next;
2321                  while (e == null) {             // get to next non-null bin
2322 +                    ConcurrentHashMapV8<K, V> m;
2323                      Node[] t; int b, i, n; Object ek; // checks must use locals
2324 <                    if ((b = baseIndex) >= baseLimit || (i = index) < 0 ||
2325 <                        (t = tab) == null || i >= (n = t.length))
2324 >                    if ((t = tab) != null)
2325 >                        n = t.length;
2326 >                    else if ((m = map) != null && (t = tab = m.table) != null)
2327 >                        n = baseLimit = baseSize = t.length;
2328 >                    else
2329                          break outer;
2330 <                    else if ((e = tabAt(t, i)) != null && e.hash == MOVED) {
2330 >                    if ((b = baseIndex) >= baseLimit ||
2331 >                        (i = index) < 0 || i >= n)
2332 >                        break outer;
2333 >                    if ((e = tabAt(t, i)) != null && e.hash == MOVED) {
2334                          if ((ek = e.key) instanceof TreeBin)
2335                              e = ((TreeBin)ek).first;
2336                          else {
# Line 4176 | Line 4187 | public class ConcurrentHashMapV8<K, V>
4187              (ConcurrentHashMapV8<K,V> map,
4188               BiAction<K,V> action) {
4189              if (action == null) throw new NullPointerException();
4190 <            return new ForEachMappingTask<K,V>(map, action);
4190 >            return new ForEachMappingTask<K,V>(map, null, -1, action);
4191          }
4192  
4193          /**
# Line 4197 | Line 4208 | public class ConcurrentHashMapV8<K, V>
4208              if (transformer == null || action == null)
4209                  throw new NullPointerException();
4210              return new ForEachTransformedMappingTask<K,V,U>
4211 <                (map, transformer, action);
4211 >                (map, null, -1, transformer, action);
4212          }
4213  
4214          /**
# Line 4217 | Line 4228 | public class ConcurrentHashMapV8<K, V>
4228               BiFun<? super K, ? super V, ? extends U> searchFunction) {
4229              if (searchFunction == null) throw new NullPointerException();
4230              return new SearchMappingsTask<K,V,U>
4231 <                (map, searchFunction,
4231 >                (map, null, -1, searchFunction,
4232                   new AtomicReference<U>());
4233          }
4234  
# Line 4240 | Line 4251 | public class ConcurrentHashMapV8<K, V>
4251              if (transformer == null || reducer == null)
4252                  throw new NullPointerException();
4253              return new MapReduceMappingsTask<K,V,U>
4254 <                (map, transformer, reducer);
4254 >                (map, null, -1, null, transformer, reducer);
4255          }
4256  
4257          /**
# Line 4264 | Line 4275 | public class ConcurrentHashMapV8<K, V>
4275              if (transformer == null || reducer == null)
4276                  throw new NullPointerException();
4277              return new MapReduceMappingsToDoubleTask<K,V>
4278 <                (map, transformer, basis, reducer);
4278 >                (map, null, -1, null, transformer, basis, reducer);
4279          }
4280  
4281          /**
# Line 4288 | Line 4299 | public class ConcurrentHashMapV8<K, V>
4299              if (transformer == null || reducer == null)
4300                  throw new NullPointerException();
4301              return new MapReduceMappingsToLongTask<K,V>
4302 <                (map, transformer, basis, reducer);
4302 >                (map, null, -1, null, transformer, basis, reducer);
4303          }
4304  
4305          /**
# Line 4311 | Line 4322 | public class ConcurrentHashMapV8<K, V>
4322              if (transformer == null || reducer == null)
4323                  throw new NullPointerException();
4324              return new MapReduceMappingsToIntTask<K,V>
4325 <                (map, transformer, basis, reducer);
4325 >                (map, null, -1, null, transformer, basis, reducer);
4326          }
4327  
4328          /**
# Line 4326 | Line 4337 | public class ConcurrentHashMapV8<K, V>
4337              (ConcurrentHashMapV8<K,V> map,
4338               Action<K> action) {
4339              if (action == null) throw new NullPointerException();
4340 <            return new ForEachKeyTask<K,V>(map, action);
4340 >            return new ForEachKeyTask<K,V>(map, null, -1, action);
4341          }
4342  
4343          /**
# Line 4347 | Line 4358 | public class ConcurrentHashMapV8<K, V>
4358              if (transformer == null || action == null)
4359                  throw new NullPointerException();
4360              return new ForEachTransformedKeyTask<K,V,U>
4361 <                (map, transformer, action);
4361 >                (map, null, -1, transformer, action);
4362          }
4363  
4364          /**
# Line 4367 | Line 4378 | public class ConcurrentHashMapV8<K, V>
4378               Fun<? super K, ? extends U> searchFunction) {
4379              if (searchFunction == null) throw new NullPointerException();
4380              return new SearchKeysTask<K,V,U>
4381 <                (map, searchFunction,
4381 >                (map, null, -1, searchFunction,
4382                   new AtomicReference<U>());
4383          }
4384  
# Line 4385 | Line 4396 | public class ConcurrentHashMapV8<K, V>
4396               BiFun<? super K, ? super K, ? extends K> reducer) {
4397              if (reducer == null) throw new NullPointerException();
4398              return new ReduceKeysTask<K,V>
4399 <                (map, reducer);
4399 >                (map, null, -1, null, reducer);
4400          }
4401  
4402          /**
# Line 4407 | Line 4418 | public class ConcurrentHashMapV8<K, V>
4418              if (transformer == null || reducer == null)
4419                  throw new NullPointerException();
4420              return new MapReduceKeysTask<K,V,U>
4421 <                (map, transformer, reducer);
4421 >                (map, null, -1, null, transformer, reducer);
4422          }
4423  
4424          /**
# Line 4431 | Line 4442 | public class ConcurrentHashMapV8<K, V>
4442              if (transformer == null || reducer == null)
4443                  throw new NullPointerException();
4444              return new MapReduceKeysToDoubleTask<K,V>
4445 <                (map, transformer, basis, reducer);
4445 >                (map, null, -1, null, transformer, basis, reducer);
4446          }
4447  
4448          /**
# Line 4455 | Line 4466 | public class ConcurrentHashMapV8<K, V>
4466              if (transformer == null || reducer == null)
4467                  throw new NullPointerException();
4468              return new MapReduceKeysToLongTask<K,V>
4469 <                (map, transformer, basis, reducer);
4469 >                (map, null, -1, null, transformer, basis, reducer);
4470          }
4471  
4472          /**
# Line 4479 | Line 4490 | public class ConcurrentHashMapV8<K, V>
4490              if (transformer == null || reducer == null)
4491                  throw new NullPointerException();
4492              return new MapReduceKeysToIntTask<K,V>
4493 <                (map, transformer, basis, reducer);
4493 >                (map, null, -1, null, transformer, basis, reducer);
4494          }
4495  
4496          /**
# Line 4493 | Line 4504 | public class ConcurrentHashMapV8<K, V>
4504              (ConcurrentHashMapV8<K,V> map,
4505               Action<V> action) {
4506              if (action == null) throw new NullPointerException();
4507 <            return new ForEachValueTask<K,V>(map, action);
4507 >            return new ForEachValueTask<K,V>(map, null, -1, action);
4508          }
4509  
4510          /**
# Line 4513 | Line 4524 | public class ConcurrentHashMapV8<K, V>
4524              if (transformer == null || action == null)
4525                  throw new NullPointerException();
4526              return new ForEachTransformedValueTask<K,V,U>
4527 <                (map, transformer, action);
4527 >                (map, null, -1, transformer, action);
4528          }
4529  
4530          /**
# Line 4534 | Line 4545 | public class ConcurrentHashMapV8<K, V>
4545               Fun<? super V, ? extends U> searchFunction) {
4546              if (searchFunction == null) throw new NullPointerException();
4547              return new SearchValuesTask<K,V,U>
4548 <                (map, searchFunction,
4548 >                (map, null, -1, searchFunction,
4549                   new AtomicReference<U>());
4550          }
4551  
# Line 4552 | Line 4563 | public class ConcurrentHashMapV8<K, V>
4563               BiFun<? super V, ? super V, ? extends V> reducer) {
4564              if (reducer == null) throw new NullPointerException();
4565              return new ReduceValuesTask<K,V>
4566 <                (map, reducer);
4566 >                (map, null, -1, null, reducer);
4567          }
4568  
4569          /**
# Line 4574 | Line 4585 | public class ConcurrentHashMapV8<K, V>
4585              if (transformer == null || reducer == null)
4586                  throw new NullPointerException();
4587              return new MapReduceValuesTask<K,V,U>
4588 <                (map, transformer, reducer);
4588 >                (map, null, -1, null, transformer, reducer);
4589          }
4590  
4591          /**
# Line 4598 | Line 4609 | public class ConcurrentHashMapV8<K, V>
4609              if (transformer == null || reducer == null)
4610                  throw new NullPointerException();
4611              return new MapReduceValuesToDoubleTask<K,V>
4612 <                (map, transformer, basis, reducer);
4612 >                (map, null, -1, null, transformer, basis, reducer);
4613          }
4614  
4615          /**
# Line 4622 | Line 4633 | public class ConcurrentHashMapV8<K, V>
4633              if (transformer == null || reducer == null)
4634                  throw new NullPointerException();
4635              return new MapReduceValuesToLongTask<K,V>
4636 <                (map, transformer, basis, reducer);
4636 >                (map, null, -1, null, transformer, basis, reducer);
4637          }
4638  
4639          /**
# Line 4646 | Line 4657 | public class ConcurrentHashMapV8<K, V>
4657              if (transformer == null || reducer == null)
4658                  throw new NullPointerException();
4659              return new MapReduceValuesToIntTask<K,V>
4660 <                (map, transformer, basis, reducer);
4660 >                (map, null, -1, null, transformer, basis, reducer);
4661          }
4662  
4663          /**
# Line 4660 | Line 4671 | public class ConcurrentHashMapV8<K, V>
4671              (ConcurrentHashMapV8<K,V> map,
4672               Action<Map.Entry<K,V>> action) {
4673              if (action == null) throw new NullPointerException();
4674 <            return new ForEachEntryTask<K,V>(map, action);
4674 >            return new ForEachEntryTask<K,V>(map, null, -1, action);
4675          }
4676  
4677          /**
# Line 4680 | Line 4691 | public class ConcurrentHashMapV8<K, V>
4691              if (transformer == null || action == null)
4692                  throw new NullPointerException();
4693              return new ForEachTransformedEntryTask<K,V,U>
4694 <                (map, transformer, action);
4694 >                (map, null, -1, transformer, action);
4695          }
4696  
4697          /**
# Line 4701 | Line 4712 | public class ConcurrentHashMapV8<K, V>
4712               Fun<Map.Entry<K,V>, ? extends U> searchFunction) {
4713              if (searchFunction == null) throw new NullPointerException();
4714              return new SearchEntriesTask<K,V,U>
4715 <                (map, searchFunction,
4715 >                (map, null, -1, searchFunction,
4716                   new AtomicReference<U>());
4717          }
4718  
# Line 4719 | Line 4730 | public class ConcurrentHashMapV8<K, V>
4730               BiFun<Map.Entry<K,V>, Map.Entry<K,V>, ? extends Map.Entry<K,V>> reducer) {
4731              if (reducer == null) throw new NullPointerException();
4732              return new ReduceEntriesTask<K,V>
4733 <                (map, reducer);
4733 >                (map, null, -1, null, reducer);
4734          }
4735  
4736          /**
# Line 4741 | Line 4752 | public class ConcurrentHashMapV8<K, V>
4752              if (transformer == null || reducer == null)
4753                  throw new NullPointerException();
4754              return new MapReduceEntriesTask<K,V,U>
4755 <                (map, transformer, reducer);
4755 >                (map, null, -1, null, transformer, reducer);
4756          }
4757  
4758          /**
# Line 4765 | Line 4776 | public class ConcurrentHashMapV8<K, V>
4776              if (transformer == null || reducer == null)
4777                  throw new NullPointerException();
4778              return new MapReduceEntriesToDoubleTask<K,V>
4779 <                (map, transformer, basis, reducer);
4779 >                (map, null, -1, null, transformer, basis, reducer);
4780          }
4781  
4782          /**
# Line 4789 | Line 4800 | public class ConcurrentHashMapV8<K, V>
4800              if (transformer == null || reducer == null)
4801                  throw new NullPointerException();
4802              return new MapReduceEntriesToLongTask<K,V>
4803 <                (map, transformer, basis, reducer);
4803 >                (map, null, -1, null, transformer, basis, reducer);
4804          }
4805  
4806          /**
# Line 4813 | Line 4824 | public class ConcurrentHashMapV8<K, V>
4824              if (transformer == null || reducer == null)
4825                  throw new NullPointerException();
4826              return new MapReduceEntriesToIntTask<K,V>
4827 <                (map, transformer, basis, reducer);
4827 >                (map, null, -1, null, transformer, basis, reducer);
4828          }
4829      }
4830  
# Line 4832 | Line 4843 | public class ConcurrentHashMapV8<K, V>
4843       */
4844      @SuppressWarnings("serial") static abstract class BulkTask<K,V,R> extends Traverser<K,V,R> {
4845          final BulkTask<K,V,?> parent;  // completion target
4846 <        int batch;                     // split control
4846 >        int batch;                     // split control; -1 for unknown
4847          int pending;                   // completion control
4848  
4849 <        /** Constructor for root tasks */
4850 <        BulkTask(ConcurrentHashMapV8<K,V> map) {
4849 >        BulkTask(ConcurrentHashMapV8<K,V> map, BulkTask<K,V,?> parent,
4850 >                 int batch) {
4851              super(map);
4841            this.parent = null;
4842            this.batch = -1; // force call to batch() on execution
4843        }
4844
4845        /** Constructor for subtasks */
4846        BulkTask(BulkTask<K,V,?> parent, int batch) {
4847            super(parent);
4852              this.parent = parent;
4853              this.batch = batch;
4854 +            if (parent != null && map != null) { // split parent
4855 +                Node[] t;
4856 +                if ((t = parent.tab) == null &&
4857 +                    (t = parent.tab = map.table) != null)
4858 +                    parent.baseLimit = parent.baseSize = t.length;
4859 +                this.tab = t;
4860 +                this.baseSize = parent.baseSize;
4861 +                int hi = this.baseLimit = parent.baseLimit;
4862 +                parent.baseLimit = this.index = this.baseIndex =
4863 +                    (hi + parent.baseIndex + 1) >>> 1;
4864 +            }
4865          }
4866  
4867          // FJ methods
# Line 4910 | Line 4925 | public class ConcurrentHashMapV8<K, V>
4925           * dividing by two anyway.
4926           */
4927          final int batch() {
4928 <            int b = batch;
4929 <            if (b < 0) {
4930 <                long n = map.counter.sum();
4931 <                int sp = getPool().getParallelism() << 3; // slack of 8
4932 <                b = batch = (n <= 0L) ? 0 : (n < (long)sp) ? (int)n : sp;
4928 >            ConcurrentHashMapV8<K, V> m; int b; Node[] t;
4929 >            if ((b = batch) < 0 && (m = map) != null) { // force initialization
4930 >                if ((t = tab) == null && (t = tab = m.table) != null)
4931 >                    baseLimit = baseSize = t.length;
4932 >                if (t != null) {
4933 >                    long n = m.counter.sum();
4934 >                    int sp = getPool().getParallelism() << 3; // slack of 8
4935 >                    b = batch = (n <= 0L) ? 0 : (n < (long)sp) ? (int)n : sp;
4936 >                }
4937              }
4938              return b;
4939          }
# Line 4950 | Line 4969 | public class ConcurrentHashMapV8<K, V>
4969          extends BulkTask<K,V,Void> {
4970          final Action<K> action;
4971          ForEachKeyTask
4972 <            (ConcurrentHashMapV8<K,V> m,
4972 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
4973               Action<K> action) {
4974 <            super(m);
4956 <            this.action = action;
4957 <        }
4958 <        ForEachKeyTask
4959 <            (BulkTask<K,V,?> p, int b,
4960 <             Action<K> action) {
4961 <            super(p, b);
4974 >            super(m, p, b);
4975              this.action = action;
4976          }
4977          @SuppressWarnings("unchecked") public final boolean exec() {
# Line 4969 | Line 4982 | public class ConcurrentHashMapV8<K, V>
4982                  int b = batch(), c;
4983                  while (b > 1 && baseIndex != baseLimit) {
4984                      do {} while (!casPending(c = pending, c+1));
4985 <                    new ForEachKeyTask<K,V>(this, b >>>= 1, action).fork();
4985 >                    new ForEachKeyTask<K,V>(map, this, b >>>= 1, action).fork();
4986                  }
4987                  while (advance() != null)
4988                      action.apply((K)nextKey);
# Line 4985 | Line 4998 | public class ConcurrentHashMapV8<K, V>
4998          extends BulkTask<K,V,Void> {
4999          final Action<V> action;
5000          ForEachValueTask
5001 <            (ConcurrentHashMapV8<K,V> m,
5001 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5002               Action<V> action) {
5003 <            super(m);
4991 <            this.action = action;
4992 <        }
4993 <        ForEachValueTask
4994 <            (BulkTask<K,V,?> p, int b,
4995 <             Action<V> action) {
4996 <            super(p, b);
5003 >            super(m, p, b);
5004              this.action = action;
5005          }
5006          @SuppressWarnings("unchecked") public final boolean exec() {
# Line 5004 | Line 5011 | public class ConcurrentHashMapV8<K, V>
5011                  int b = batch(), c;
5012                  while (b > 1 && baseIndex != baseLimit) {
5013                      do {} while (!casPending(c = pending, c+1));
5014 <                    new ForEachValueTask<K,V>(this, b >>>= 1, action).fork();
5014 >                    new ForEachValueTask<K,V>(map, this, b >>>= 1, action).fork();
5015                  }
5016                  Object v;
5017                  while ((v = advance()) != null)
# Line 5021 | Line 5028 | public class ConcurrentHashMapV8<K, V>
5028          extends BulkTask<K,V,Void> {
5029          final Action<Entry<K,V>> action;
5030          ForEachEntryTask
5031 <            (ConcurrentHashMapV8<K,V> m,
5025 <             Action<Entry<K,V>> action) {
5026 <            super(m);
5027 <            this.action = action;
5028 <        }
5029 <        ForEachEntryTask
5030 <            (BulkTask<K,V,?> p, int b,
5031 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5032               Action<Entry<K,V>> action) {
5033 <            super(p, b);
5033 >            super(m, p, b);
5034              this.action = action;
5035          }
5036          @SuppressWarnings("unchecked") public final boolean exec() {
# Line 5040 | Line 5041 | public class ConcurrentHashMapV8<K, V>
5041                  int b = batch(), c;
5042                  while (b > 1 && baseIndex != baseLimit) {
5043                      do {} while (!casPending(c = pending, c+1));
5044 <                    new ForEachEntryTask<K,V>(this, b >>>= 1, action).fork();
5044 >                    new ForEachEntryTask<K,V>(map, this, b >>>= 1, action).fork();
5045                  }
5046                  Object v;
5047                  while ((v = advance()) != null)
# Line 5057 | Line 5058 | public class ConcurrentHashMapV8<K, V>
5058          extends BulkTask<K,V,Void> {
5059          final BiAction<K,V> action;
5060          ForEachMappingTask
5061 <            (ConcurrentHashMapV8<K,V> m,
5061 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5062               BiAction<K,V> action) {
5063 <            super(m);
5063 >            super(m, p, b);
5064              this.action = action;
5065          }
5065        ForEachMappingTask
5066            (BulkTask<K,V,?> p, int b,
5067             BiAction<K,V> action) {
5068            super(p, b);
5069            this.action = action;
5070        }
5071
5066          @SuppressWarnings("unchecked") public final boolean exec() {
5067              final BiAction<K,V> action = this.action;
5068              if (action == null)
# Line 5077 | Line 5071 | public class ConcurrentHashMapV8<K, V>
5071                  int b = batch(), c;
5072                  while (b > 1 && baseIndex != baseLimit) {
5073                      do {} while (!casPending(c = pending, c+1));
5074 <                    new ForEachMappingTask<K,V>(this, b >>>= 1,
5074 >                    new ForEachMappingTask<K,V>(map, this, b >>>= 1,
5075                                                  action).fork();
5076                  }
5077                  Object v;
# Line 5096 | Line 5090 | public class ConcurrentHashMapV8<K, V>
5090          final Fun<? super K, ? extends U> transformer;
5091          final Action<U> action;
5092          ForEachTransformedKeyTask
5093 <            (ConcurrentHashMapV8<K,V> m,
5093 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5094               Fun<? super K, ? extends U> transformer,
5095               Action<U> action) {
5096 <            super(m);
5096 >            super(m, p, b);
5097              this.transformer = transformer;
5098              this.action = action;
5099  
5100          }
5107        ForEachTransformedKeyTask
5108            (BulkTask<K,V,?> p, int b,
5109             Fun<? super K, ? extends U> transformer,
5110             Action<U> action) {
5111            super(p, b);
5112            this.transformer = transformer;
5113            this.action = action;
5114        }
5101          @SuppressWarnings("unchecked") public final boolean exec() {
5102              final Fun<? super K, ? extends U> transformer =
5103                  this.transformer;
# Line 5123 | Line 5109 | public class ConcurrentHashMapV8<K, V>
5109                  while (b > 1 && baseIndex != baseLimit) {
5110                      do {} while (!casPending(c = pending, c+1));
5111                      new ForEachTransformedKeyTask<K,V,U>
5112 <                        (this, b >>>= 1, transformer, action).fork();
5112 >                        (map, this, b >>>= 1, transformer, action).fork();
5113                  }
5114                  U u;
5115                  while (advance() != null) {
# Line 5143 | Line 5129 | public class ConcurrentHashMapV8<K, V>
5129          final Fun<? super V, ? extends U> transformer;
5130          final Action<U> action;
5131          ForEachTransformedValueTask
5132 <            (ConcurrentHashMapV8<K,V> m,
5132 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5133               Fun<? super V, ? extends U> transformer,
5134               Action<U> action) {
5135 <            super(m);
5135 >            super(m, p, b);
5136              this.transformer = transformer;
5137              this.action = action;
5138  
5139          }
5154        ForEachTransformedValueTask
5155            (BulkTask<K,V,?> p, int b,
5156             Fun<? super V, ? extends U> transformer,
5157             Action<U> action) {
5158            super(p, b);
5159            this.transformer = transformer;
5160            this.action = action;
5161        }
5140          @SuppressWarnings("unchecked") public final boolean exec() {
5141              final Fun<? super V, ? extends U> transformer =
5142                  this.transformer;
# Line 5170 | Line 5148 | public class ConcurrentHashMapV8<K, V>
5148                  while (b > 1 && baseIndex != baseLimit) {
5149                      do {} while (!casPending(c = pending, c+1));
5150                      new ForEachTransformedValueTask<K,V,U>
5151 <                        (this, b >>>= 1, transformer, action).fork();
5151 >                        (map, this, b >>>= 1, transformer, action).fork();
5152                  }
5153                  Object v; U u;
5154                  while ((v = advance()) != null) {
# Line 5190 | Line 5168 | public class ConcurrentHashMapV8<K, V>
5168          final Fun<Map.Entry<K,V>, ? extends U> transformer;
5169          final Action<U> action;
5170          ForEachTransformedEntryTask
5171 <            (ConcurrentHashMapV8<K,V> m,
5171 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5172               Fun<Map.Entry<K,V>, ? extends U> transformer,
5173               Action<U> action) {
5174 <            super(m);
5174 >            super(m, p, b);
5175              this.transformer = transformer;
5176              this.action = action;
5177  
5178          }
5201        ForEachTransformedEntryTask
5202            (BulkTask<K,V,?> p, int b,
5203             Fun<Map.Entry<K,V>, ? extends U> transformer,
5204             Action<U> action) {
5205            super(p, b);
5206            this.transformer = transformer;
5207            this.action = action;
5208        }
5179          @SuppressWarnings("unchecked") public final boolean exec() {
5180              final Fun<Map.Entry<K,V>, ? extends U> transformer =
5181                  this.transformer;
# Line 5217 | Line 5187 | public class ConcurrentHashMapV8<K, V>
5187                  while (b > 1 && baseIndex != baseLimit) {
5188                      do {} while (!casPending(c = pending, c+1));
5189                      new ForEachTransformedEntryTask<K,V,U>
5190 <                        (this, b >>>= 1, transformer, action).fork();
5190 >                        (map, this, b >>>= 1, transformer, action).fork();
5191                  }
5192                  Object v; U u;
5193                  while ((v = advance()) != null) {
# Line 5237 | Line 5207 | public class ConcurrentHashMapV8<K, V>
5207          final BiFun<? super K, ? super V, ? extends U> transformer;
5208          final Action<U> action;
5209          ForEachTransformedMappingTask
5210 <            (ConcurrentHashMapV8<K,V> m,
5210 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5211               BiFun<? super K, ? super V, ? extends U> transformer,
5212               Action<U> action) {
5213 <            super(m);
5213 >            super(m, p, b);
5214              this.transformer = transformer;
5215              this.action = action;
5216  
5217          }
5248        ForEachTransformedMappingTask
5249            (BulkTask<K,V,?> p, int b,
5250             BiFun<? super K, ? super V, ? extends U> transformer,
5251             Action<U> action) {
5252            super(p, b);
5253            this.transformer = transformer;
5254            this.action = action;
5255        }
5218          @SuppressWarnings("unchecked") public final boolean exec() {
5219              final BiFun<? super K, ? super V, ? extends U> transformer =
5220                  this.transformer;
# Line 5264 | Line 5226 | public class ConcurrentHashMapV8<K, V>
5226                  while (b > 1 && baseIndex != baseLimit) {
5227                      do {} while (!casPending(c = pending, c+1));
5228                      new ForEachTransformedMappingTask<K,V,U>
5229 <                        (this, b >>>= 1, transformer, action).fork();
5229 >                        (map, this, b >>>= 1, transformer, action).fork();
5230                  }
5231                  Object v; U u;
5232                  while ((v = advance()) != null) {
# Line 5284 | Line 5246 | public class ConcurrentHashMapV8<K, V>
5246          final Fun<? super K, ? extends U> searchFunction;
5247          final AtomicReference<U> result;
5248          SearchKeysTask
5249 <            (ConcurrentHashMapV8<K,V> m,
5249 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5250               Fun<? super K, ? extends U> searchFunction,
5251               AtomicReference<U> result) {
5252 <            super(m);
5291 <            this.searchFunction = searchFunction; this.result = result;
5292 <        }
5293 <        SearchKeysTask
5294 <            (BulkTask<K,V,?> p, int b,
5295 <             Fun<? super K, ? extends U> searchFunction,
5296 <             AtomicReference<U> result) {
5297 <            super(p, b);
5252 >            super(m, p, b);
5253              this.searchFunction = searchFunction; this.result = result;
5254          }
5255          @SuppressWarnings("unchecked") public final boolean exec() {
# Line 5307 | Line 5262 | public class ConcurrentHashMapV8<K, V>
5262                  int b = batch(), c;
5263                  while (b > 1 && baseIndex != baseLimit && result.get() == null) {
5264                      do {} while (!casPending(c = pending, c+1));
5265 <                    new SearchKeysTask<K,V,U>(this, b >>>= 1,
5265 >                    new SearchKeysTask<K,V,U>(map, this, b >>>= 1,
5266                                                searchFunction, result).fork();
5267                  }
5268                  U u;
# Line 5332 | Line 5287 | public class ConcurrentHashMapV8<K, V>
5287          final Fun<? super V, ? extends U> searchFunction;
5288          final AtomicReference<U> result;
5289          SearchValuesTask
5290 <            (ConcurrentHashMapV8<K,V> m,
5336 <             Fun<? super V, ? extends U> searchFunction,
5337 <             AtomicReference<U> result) {
5338 <            super(m);
5339 <            this.searchFunction = searchFunction; this.result = result;
5340 <        }
5341 <        SearchValuesTask
5342 <            (BulkTask<K,V,?> p, int b,
5290 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5291               Fun<? super V, ? extends U> searchFunction,
5292               AtomicReference<U> result) {
5293 <            super(p, b);
5293 >            super(m, p, b);
5294              this.searchFunction = searchFunction; this.result = result;
5295          }
5296          @SuppressWarnings("unchecked") public final boolean exec() {
# Line 5355 | Line 5303 | public class ConcurrentHashMapV8<K, V>
5303                  int b = batch(), c;
5304                  while (b > 1 && baseIndex != baseLimit && result.get() == null) {
5305                      do {} while (!casPending(c = pending, c+1));
5306 <                    new SearchValuesTask<K,V,U>(this, b >>>= 1,
5306 >                    new SearchValuesTask<K,V,U>(map, this, b >>>= 1,
5307                                                  searchFunction, result).fork();
5308                  }
5309                  Object v; U u;
# Line 5380 | Line 5328 | public class ConcurrentHashMapV8<K, V>
5328          final Fun<Entry<K,V>, ? extends U> searchFunction;
5329          final AtomicReference<U> result;
5330          SearchEntriesTask
5331 <            (ConcurrentHashMapV8<K,V> m,
5384 <             Fun<Entry<K,V>, ? extends U> searchFunction,
5385 <             AtomicReference<U> result) {
5386 <            super(m);
5387 <            this.searchFunction = searchFunction; this.result = result;
5388 <        }
5389 <        SearchEntriesTask
5390 <            (BulkTask<K,V,?> p, int b,
5331 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5332               Fun<Entry<K,V>, ? extends U> searchFunction,
5333               AtomicReference<U> result) {
5334 <            super(p, b);
5334 >            super(m, p, b);
5335              this.searchFunction = searchFunction; this.result = result;
5336          }
5337          @SuppressWarnings("unchecked") public final boolean exec() {
# Line 5403 | Line 5344 | public class ConcurrentHashMapV8<K, V>
5344                  int b = batch(), c;
5345                  while (b > 1 && baseIndex != baseLimit && result.get() == null) {
5346                      do {} while (!casPending(c = pending, c+1));
5347 <                    new SearchEntriesTask<K,V,U>(this, b >>>= 1,
5347 >                    new SearchEntriesTask<K,V,U>(map, this, b >>>= 1,
5348                                                   searchFunction, result).fork();
5349                  }
5350                  Object v; U u;
# Line 5428 | Line 5369 | public class ConcurrentHashMapV8<K, V>
5369          final BiFun<? super K, ? super V, ? extends U> searchFunction;
5370          final AtomicReference<U> result;
5371          SearchMappingsTask
5372 <            (ConcurrentHashMapV8<K,V> m,
5432 <             BiFun<? super K, ? super V, ? extends U> searchFunction,
5433 <             AtomicReference<U> result) {
5434 <            super(m);
5435 <            this.searchFunction = searchFunction; this.result = result;
5436 <        }
5437 <        SearchMappingsTask
5438 <            (BulkTask<K,V,?> p, int b,
5372 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5373               BiFun<? super K, ? super V, ? extends U> searchFunction,
5374               AtomicReference<U> result) {
5375 <            super(p, b);
5375 >            super(m, p, b);
5376              this.searchFunction = searchFunction; this.result = result;
5377          }
5378          @SuppressWarnings("unchecked") public final boolean exec() {
# Line 5451 | Line 5385 | public class ConcurrentHashMapV8<K, V>
5385                  int b = batch(), c;
5386                  while (b > 1 && baseIndex != baseLimit && result.get() == null) {
5387                      do {} while (!casPending(c = pending, c+1));
5388 <                    new SearchMappingsTask<K,V,U>(this, b >>>= 1,
5388 >                    new SearchMappingsTask<K,V,U>(map, this, b >>>= 1,
5389                                                    searchFunction, result).fork();
5390                  }
5391                  Object v; U u;
# Line 5477 | Line 5411 | public class ConcurrentHashMapV8<K, V>
5411          K result;
5412          ReduceKeysTask<K,V> rights, nextRight;
5413          ReduceKeysTask
5414 <            (ConcurrentHashMapV8<K,V> m,
5481 <             BiFun<? super K, ? super K, ? extends K> reducer) {
5482 <            super(m);
5483 <            this.reducer = reducer;
5484 <        }
5485 <        ReduceKeysTask
5486 <            (BulkTask<K,V,?> p, int b,
5414 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5415               ReduceKeysTask<K,V> nextRight,
5416               BiFun<? super K, ? super K, ? extends K> reducer) {
5417 <            super(p, b); this.nextRight = nextRight;
5417 >            super(m, p, b); this.nextRight = nextRight;
5418              this.reducer = reducer;
5419          }
5492
5420          @SuppressWarnings("unchecked") public final boolean exec() {
5421              final BiFun<? super K, ? super K, ? extends K> reducer =
5422                  this.reducer;
# Line 5499 | Line 5426 | public class ConcurrentHashMapV8<K, V>
5426                  for (int c, b = batch(); b > 1 && baseIndex != baseLimit;) {
5427                      do {} while (!casPending(c = pending, c+1));
5428                      (rights = new ReduceKeysTask<K,V>
5429 <                     (this, b >>>= 1, rights, reducer)).fork();
5429 >                     (map, this, b >>>= 1, rights, reducer)).fork();
5430                  }
5431                  K r = null;
5432                  while (advance() != null) {
# Line 5538 | Line 5465 | public class ConcurrentHashMapV8<K, V>
5465          V result;
5466          ReduceValuesTask<K,V> rights, nextRight;
5467          ReduceValuesTask
5468 <            (ConcurrentHashMapV8<K,V> m,
5542 <             BiFun<? super V, ? super V, ? extends V> reducer) {
5543 <            super(m);
5544 <            this.reducer = reducer;
5545 <        }
5546 <        ReduceValuesTask
5547 <            (BulkTask<K,V,?> p, int b,
5468 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5469               ReduceValuesTask<K,V> nextRight,
5470               BiFun<? super V, ? super V, ? extends V> reducer) {
5471 <            super(p, b); this.nextRight = nextRight;
5471 >            super(m, p, b); this.nextRight = nextRight;
5472              this.reducer = reducer;
5473          }
5553
5474          @SuppressWarnings("unchecked") public final boolean exec() {
5475              final BiFun<? super V, ? super V, ? extends V> reducer =
5476                  this.reducer;
# Line 5560 | Line 5480 | public class ConcurrentHashMapV8<K, V>
5480                  for (int c, b = batch(); b > 1 && baseIndex != baseLimit;) {
5481                      do {} while (!casPending(c = pending, c+1));
5482                      (rights = new ReduceValuesTask<K,V>
5483 <                     (this, b >>>= 1, rights, reducer)).fork();
5483 >                     (map, this, b >>>= 1, rights, reducer)).fork();
5484                  }
5485                  V r = null;
5486                  Object v;
# Line 5600 | Line 5520 | public class ConcurrentHashMapV8<K, V>
5520          Map.Entry<K,V> result;
5521          ReduceEntriesTask<K,V> rights, nextRight;
5522          ReduceEntriesTask
5523 <            (ConcurrentHashMapV8<K,V> m,
5604 <             BiFun<Entry<K,V>, Map.Entry<K,V>, ? extends Map.Entry<K,V>> reducer) {
5605 <            super(m);
5606 <            this.reducer = reducer;
5607 <        }
5608 <        ReduceEntriesTask
5609 <            (BulkTask<K,V,?> p, int b,
5523 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5524               ReduceEntriesTask<K,V> nextRight,
5525 <             BiFun<Map.Entry<K,V>, Map.Entry<K,V>, ? extends Map.Entry<K,V>> reducer) {
5526 <            super(p, b); this.nextRight = nextRight;
5525 >             BiFun<Entry<K,V>, Map.Entry<K,V>, ? extends Map.Entry<K,V>> reducer) {
5526 >            super(m, p, b); this.nextRight = nextRight;
5527              this.reducer = reducer;
5528          }
5615
5529          @SuppressWarnings("unchecked") public final boolean exec() {
5530              final BiFun<Map.Entry<K,V>, Map.Entry<K,V>, ? extends Map.Entry<K,V>> reducer =
5531                  this.reducer;
# Line 5622 | Line 5535 | public class ConcurrentHashMapV8<K, V>
5535                  for (int c, b = batch(); b > 1 && baseIndex != baseLimit;) {
5536                      do {} while (!casPending(c = pending, c+1));
5537                      (rights = new ReduceEntriesTask<K,V>
5538 <                     (this, b >>>= 1, rights, reducer)).fork();
5538 >                     (map, this, b >>>= 1, rights, reducer)).fork();
5539                  }
5540                  Map.Entry<K,V> r = null;
5541                  Object v;
# Line 5663 | Line 5576 | public class ConcurrentHashMapV8<K, V>
5576          U result;
5577          MapReduceKeysTask<K,V,U> rights, nextRight;
5578          MapReduceKeysTask
5579 <            (ConcurrentHashMapV8<K,V> m,
5667 <             Fun<? super K, ? extends U> transformer,
5668 <             BiFun<? super U, ? super U, ? extends U> reducer) {
5669 <            super(m);
5670 <            this.transformer = transformer;
5671 <            this.reducer = reducer;
5672 <        }
5673 <        MapReduceKeysTask
5674 <            (BulkTask<K,V,?> p, int b,
5579 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5580               MapReduceKeysTask<K,V,U> nextRight,
5581               Fun<? super K, ? extends U> transformer,
5582               BiFun<? super U, ? super U, ? extends U> reducer) {
5583 <            super(p, b); this.nextRight = nextRight;
5583 >            super(m, p, b); this.nextRight = nextRight;
5584              this.transformer = transformer;
5585              this.reducer = reducer;
5586          }
# Line 5690 | Line 5595 | public class ConcurrentHashMapV8<K, V>
5595                  for (int c, b = batch(); b > 1 && baseIndex != baseLimit;) {
5596                      do {} while (!casPending(c = pending, c+1));
5597                      (rights = new MapReduceKeysTask<K,V,U>
5598 <                     (this, b >>>= 1, rights, transformer, reducer)).fork();
5598 >                     (map, this, b >>>= 1, rights, transformer, reducer)).fork();
5599                  }
5600                  U r = null, u;
5601                  while (advance() != null) {
# Line 5730 | Line 5635 | public class ConcurrentHashMapV8<K, V>
5635          U result;
5636          MapReduceValuesTask<K,V,U> rights, nextRight;
5637          MapReduceValuesTask
5638 <            (ConcurrentHashMapV8<K,V> m,
5734 <             Fun<? super V, ? extends U> transformer,
5735 <             BiFun<? super U, ? super U, ? extends U> reducer) {
5736 <            super(m);
5737 <            this.transformer = transformer;
5738 <            this.reducer = reducer;
5739 <        }
5740 <        MapReduceValuesTask
5741 <            (BulkTask<K,V,?> p, int b,
5638 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5639               MapReduceValuesTask<K,V,U> nextRight,
5640               Fun<? super V, ? extends U> transformer,
5641               BiFun<? super U, ? super U, ? extends U> reducer) {
5642 <            super(p, b); this.nextRight = nextRight;
5642 >            super(m, p, b); this.nextRight = nextRight;
5643              this.transformer = transformer;
5644              this.reducer = reducer;
5645          }
# Line 5757 | Line 5654 | public class ConcurrentHashMapV8<K, V>
5654                  for (int c, b = batch(); b > 1 && baseIndex != baseLimit;) {
5655                      do {} while (!casPending(c = pending, c+1));
5656                      (rights = new MapReduceValuesTask<K,V,U>
5657 <                     (this, b >>>= 1, rights, transformer, reducer)).fork();
5657 >                     (map, this, b >>>= 1, rights, transformer, reducer)).fork();
5658                  }
5659                  U r = null, u;
5660                  Object v;
# Line 5798 | Line 5695 | public class ConcurrentHashMapV8<K, V>
5695          U result;
5696          MapReduceEntriesTask<K,V,U> rights, nextRight;
5697          MapReduceEntriesTask
5698 <            (ConcurrentHashMapV8<K,V> m,
5802 <             Fun<Map.Entry<K,V>, ? extends U> transformer,
5803 <             BiFun<? super U, ? super U, ? extends U> reducer) {
5804 <            super(m);
5805 <            this.transformer = transformer;
5806 <            this.reducer = reducer;
5807 <        }
5808 <        MapReduceEntriesTask
5809 <            (BulkTask<K,V,?> p, int b,
5698 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5699               MapReduceEntriesTask<K,V,U> nextRight,
5700               Fun<Map.Entry<K,V>, ? extends U> transformer,
5701               BiFun<? super U, ? super U, ? extends U> reducer) {
5702 <            super(p, b); this.nextRight = nextRight;
5702 >            super(m, p, b); this.nextRight = nextRight;
5703              this.transformer = transformer;
5704              this.reducer = reducer;
5705          }
# Line 5825 | Line 5714 | public class ConcurrentHashMapV8<K, V>
5714                  for (int c, b = batch(); b > 1 && baseIndex != baseLimit;) {
5715                      do {} while (!casPending(c = pending, c+1));
5716                      (rights = new MapReduceEntriesTask<K,V,U>
5717 <                     (this, b >>>= 1, rights, transformer, reducer)).fork();
5717 >                     (map, this, b >>>= 1, rights, transformer, reducer)).fork();
5718                  }
5719                  U r = null, u;
5720                  Object v;
# Line 5866 | Line 5755 | public class ConcurrentHashMapV8<K, V>
5755          U result;
5756          MapReduceMappingsTask<K,V,U> rights, nextRight;
5757          MapReduceMappingsTask
5758 <            (ConcurrentHashMapV8<K,V> m,
5870 <             BiFun<? super K, ? super V, ? extends U> transformer,
5871 <             BiFun<? super U, ? super U, ? extends U> reducer) {
5872 <            super(m);
5873 <            this.transformer = transformer;
5874 <            this.reducer = reducer;
5875 <        }
5876 <        MapReduceMappingsTask
5877 <            (BulkTask<K,V,?> p, int b,
5758 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5759               MapReduceMappingsTask<K,V,U> nextRight,
5760               BiFun<? super K, ? super V, ? extends U> transformer,
5761               BiFun<? super U, ? super U, ? extends U> reducer) {
5762 <            super(p, b); this.nextRight = nextRight;
5762 >            super(m, p, b); this.nextRight = nextRight;
5763              this.transformer = transformer;
5764              this.reducer = reducer;
5765          }
# Line 5893 | Line 5774 | public class ConcurrentHashMapV8<K, V>
5774                  for (int c, b = batch(); b > 1 && baseIndex != baseLimit;) {
5775                      do {} while (!casPending(c = pending, c+1));
5776                      (rights = new MapReduceMappingsTask<K,V,U>
5777 <                     (this, b >>>= 1, rights, transformer, reducer)).fork();
5777 >                     (map, this, b >>>= 1, rights, transformer, reducer)).fork();
5778                  }
5779                  U r = null, u;
5780                  Object v;
# Line 5935 | Line 5816 | public class ConcurrentHashMapV8<K, V>
5816          double result;
5817          MapReduceKeysToDoubleTask<K,V> rights, nextRight;
5818          MapReduceKeysToDoubleTask
5819 <            (ConcurrentHashMapV8<K,V> m,
5939 <             ObjectToDouble<? super K> transformer,
5940 <             double basis,
5941 <             DoubleByDoubleToDouble reducer) {
5942 <            super(m);
5943 <            this.transformer = transformer;
5944 <            this.basis = basis; this.reducer = reducer;
5945 <        }
5946 <        MapReduceKeysToDoubleTask
5947 <            (BulkTask<K,V,?> p, int b,
5819 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5820               MapReduceKeysToDoubleTask<K,V> nextRight,
5821               ObjectToDouble<? super K> transformer,
5822               double basis,
5823               DoubleByDoubleToDouble reducer) {
5824 <            super(p, b); this.nextRight = nextRight;
5824 >            super(m, p, b); this.nextRight = nextRight;
5825              this.transformer = transformer;
5826              this.basis = basis; this.reducer = reducer;
5827          }
# Line 5964 | Line 5836 | public class ConcurrentHashMapV8<K, V>
5836                  for (int c, b = batch(); b > 1 && baseIndex != baseLimit;) {
5837                      do {} while (!casPending(c = pending, c+1));
5838                      (rights = new MapReduceKeysToDoubleTask<K,V>
5839 <                     (this, b >>>= 1, rights, transformer, id, reducer)).fork();
5839 >                     (map, this, b >>>= 1, rights, transformer, id, reducer)).fork();
5840                  }
5841                  double r = id;
5842                  while (advance() != null)
# Line 6002 | Line 5874 | public class ConcurrentHashMapV8<K, V>
5874          double result;
5875          MapReduceValuesToDoubleTask<K,V> rights, nextRight;
5876          MapReduceValuesToDoubleTask
5877 <            (ConcurrentHashMapV8<K,V> m,
6006 <             ObjectToDouble<? super V> transformer,
6007 <             double basis,
6008 <             DoubleByDoubleToDouble reducer) {
6009 <            super(m);
6010 <            this.transformer = transformer;
6011 <            this.basis = basis; this.reducer = reducer;
6012 <        }
6013 <        MapReduceValuesToDoubleTask
6014 <            (BulkTask<K,V,?> p, int b,
5877 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5878               MapReduceValuesToDoubleTask<K,V> nextRight,
5879               ObjectToDouble<? super V> transformer,
5880               double basis,
5881               DoubleByDoubleToDouble reducer) {
5882 <            super(p, b); this.nextRight = nextRight;
5882 >            super(m, p, b); this.nextRight = nextRight;
5883              this.transformer = transformer;
5884              this.basis = basis; this.reducer = reducer;
5885          }
# Line 6031 | Line 5894 | public class ConcurrentHashMapV8<K, V>
5894                  for (int c, b = batch(); b > 1 && baseIndex != baseLimit;) {
5895                      do {} while (!casPending(c = pending, c+1));
5896                      (rights = new MapReduceValuesToDoubleTask<K,V>
5897 <                     (this, b >>>= 1, rights, transformer, id, reducer)).fork();
5897 >                     (map, this, b >>>= 1, rights, transformer, id, reducer)).fork();
5898                  }
5899                  double r = id;
5900                  Object v;
# Line 6070 | Line 5933 | public class ConcurrentHashMapV8<K, V>
5933          double result;
5934          MapReduceEntriesToDoubleTask<K,V> rights, nextRight;
5935          MapReduceEntriesToDoubleTask
5936 <            (ConcurrentHashMapV8<K,V> m,
6074 <             ObjectToDouble<Map.Entry<K,V>> transformer,
6075 <             double basis,
6076 <             DoubleByDoubleToDouble reducer) {
6077 <            super(m);
6078 <            this.transformer = transformer;
6079 <            this.basis = basis; this.reducer = reducer;
6080 <        }
6081 <        MapReduceEntriesToDoubleTask
6082 <            (BulkTask<K,V,?> p, int b,
5936 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5937               MapReduceEntriesToDoubleTask<K,V> nextRight,
5938               ObjectToDouble<Map.Entry<K,V>> transformer,
5939               double basis,
5940               DoubleByDoubleToDouble reducer) {
5941 <            super(p, b); this.nextRight = nextRight;
5941 >            super(m, p, b); this.nextRight = nextRight;
5942              this.transformer = transformer;
5943              this.basis = basis; this.reducer = reducer;
5944          }
# Line 6099 | Line 5953 | public class ConcurrentHashMapV8<K, V>
5953                  for (int c, b = batch(); b > 1 && baseIndex != baseLimit;) {
5954                      do {} while (!casPending(c = pending, c+1));
5955                      (rights = new MapReduceEntriesToDoubleTask<K,V>
5956 <                     (this, b >>>= 1, rights, transformer, id, reducer)).fork();
5956 >                     (map, this, b >>>= 1, rights, transformer, id, reducer)).fork();
5957                  }
5958                  double r = id;
5959                  Object v;
# Line 6138 | Line 5992 | public class ConcurrentHashMapV8<K, V>
5992          double result;
5993          MapReduceMappingsToDoubleTask<K,V> rights, nextRight;
5994          MapReduceMappingsToDoubleTask
5995 <            (ConcurrentHashMapV8<K,V> m,
6142 <             ObjectByObjectToDouble<? super K, ? super V> transformer,
6143 <             double basis,
6144 <             DoubleByDoubleToDouble reducer) {
6145 <            super(m);
6146 <            this.transformer = transformer;
6147 <            this.basis = basis; this.reducer = reducer;
6148 <        }
6149 <        MapReduceMappingsToDoubleTask
6150 <            (BulkTask<K,V,?> p, int b,
5995 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5996               MapReduceMappingsToDoubleTask<K,V> nextRight,
5997               ObjectByObjectToDouble<? super K, ? super V> transformer,
5998               double basis,
5999               DoubleByDoubleToDouble reducer) {
6000 <            super(p, b); this.nextRight = nextRight;
6000 >            super(m, p, b); this.nextRight = nextRight;
6001              this.transformer = transformer;
6002              this.basis = basis; this.reducer = reducer;
6003          }
# Line 6167 | Line 6012 | public class ConcurrentHashMapV8<K, V>
6012                  for (int c, b = batch(); b > 1 && baseIndex != baseLimit;) {
6013                      do {} while (!casPending(c = pending, c+1));
6014                      (rights = new MapReduceMappingsToDoubleTask<K,V>
6015 <                     (this, b >>>= 1, rights, transformer, id, reducer)).fork();
6015 >                     (map, this, b >>>= 1, rights, transformer, id, reducer)).fork();
6016                  }
6017                  double r = id;
6018                  Object v;
# Line 6206 | Line 6051 | public class ConcurrentHashMapV8<K, V>
6051          long result;
6052          MapReduceKeysToLongTask<K,V> rights, nextRight;
6053          MapReduceKeysToLongTask
6054 <            (ConcurrentHashMapV8<K,V> m,
6210 <             ObjectToLong<? super K> transformer,
6211 <             long basis,
6212 <             LongByLongToLong reducer) {
6213 <            super(m);
6214 <            this.transformer = transformer;
6215 <            this.basis = basis; this.reducer = reducer;
6216 <        }
6217 <        MapReduceKeysToLongTask
6218 <            (BulkTask<K,V,?> p, int b,
6054 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
6055               MapReduceKeysToLongTask<K,V> nextRight,
6056               ObjectToLong<? super K> transformer,
6057               long basis,
6058               LongByLongToLong reducer) {
6059 <            super(p, b); this.nextRight = nextRight;
6059 >            super(m, p, b); this.nextRight = nextRight;
6060              this.transformer = transformer;
6061              this.basis = basis; this.reducer = reducer;
6062          }
# Line 6235 | Line 6071 | public class ConcurrentHashMapV8<K, V>
6071                  for (int c, b = batch(); b > 1 && baseIndex != baseLimit;) {
6072                      do {} while (!casPending(c = pending, c+1));
6073                      (rights = new MapReduceKeysToLongTask<K,V>
6074 <                     (this, b >>>= 1, rights, transformer, id, reducer)).fork();
6074 >                     (map, this, b >>>= 1, rights, transformer, id, reducer)).fork();
6075                  }
6076                  long r = id;
6077                  while (advance() != null)
# Line 6273 | Line 6109 | public class ConcurrentHashMapV8<K, V>
6109          long result;
6110          MapReduceValuesToLongTask<K,V> rights, nextRight;
6111          MapReduceValuesToLongTask
6112 <            (ConcurrentHashMapV8<K,V> m,
6277 <             ObjectToLong<? super V> transformer,
6278 <             long basis,
6279 <             LongByLongToLong reducer) {
6280 <            super(m);
6281 <            this.transformer = transformer;
6282 <            this.basis = basis; this.reducer = reducer;
6283 <        }
6284 <        MapReduceValuesToLongTask
6285 <            (BulkTask<K,V,?> p, int b,
6112 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
6113               MapReduceValuesToLongTask<K,V> nextRight,
6114               ObjectToLong<? super V> transformer,
6115               long basis,
6116               LongByLongToLong reducer) {
6117 <            super(p, b); this.nextRight = nextRight;
6117 >            super(m, p, b); this.nextRight = nextRight;
6118              this.transformer = transformer;
6119              this.basis = basis; this.reducer = reducer;
6120          }
# Line 6302 | Line 6129 | public class ConcurrentHashMapV8<K, V>
6129                  for (int c, b = batch(); b > 1 && baseIndex != baseLimit;) {
6130                      do {} while (!casPending(c = pending, c+1));
6131                      (rights = new MapReduceValuesToLongTask<K,V>
6132 <                     (this, b >>>= 1, rights, transformer, id, reducer)).fork();
6132 >                     (map, this, b >>>= 1, rights, transformer, id, reducer)).fork();
6133                  }
6134                  long r = id;
6135                  Object v;
# Line 6341 | Line 6168 | public class ConcurrentHashMapV8<K, V>
6168          long result;
6169          MapReduceEntriesToLongTask<K,V> rights, nextRight;
6170          MapReduceEntriesToLongTask
6171 <            (ConcurrentHashMapV8<K,V> m,
6345 <             ObjectToLong<Map.Entry<K,V>> transformer,
6346 <             long basis,
6347 <             LongByLongToLong reducer) {
6348 <            super(m);
6349 <            this.transformer = transformer;
6350 <            this.basis = basis; this.reducer = reducer;
6351 <        }
6352 <        MapReduceEntriesToLongTask
6353 <            (BulkTask<K,V,?> p, int b,
6171 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
6172               MapReduceEntriesToLongTask<K,V> nextRight,
6173               ObjectToLong<Map.Entry<K,V>> transformer,
6174               long basis,
6175               LongByLongToLong reducer) {
6176 <            super(p, b); this.nextRight = nextRight;
6176 >            super(m, p, b); this.nextRight = nextRight;
6177              this.transformer = transformer;
6178              this.basis = basis; this.reducer = reducer;
6179          }
# Line 6370 | Line 6188 | public class ConcurrentHashMapV8<K, V>
6188                  for (int c, b = batch(); b > 1 && baseIndex != baseLimit;) {
6189                      do {} while (!casPending(c = pending, c+1));
6190                      (rights = new MapReduceEntriesToLongTask<K,V>
6191 <                     (this, b >>>= 1, rights, transformer, id, reducer)).fork();
6191 >                     (map, this, b >>>= 1, rights, transformer, id, reducer)).fork();
6192                  }
6193                  long r = id;
6194                  Object v;
# Line 6409 | Line 6227 | public class ConcurrentHashMapV8<K, V>
6227          long result;
6228          MapReduceMappingsToLongTask<K,V> rights, nextRight;
6229          MapReduceMappingsToLongTask
6230 <            (ConcurrentHashMapV8<K,V> m,
6413 <             ObjectByObjectToLong<? super K, ? super V> transformer,
6414 <             long basis,
6415 <             LongByLongToLong reducer) {
6416 <            super(m);
6417 <            this.transformer = transformer;
6418 <            this.basis = basis; this.reducer = reducer;
6419 <        }
6420 <        MapReduceMappingsToLongTask
6421 <            (BulkTask<K,V,?> p, int b,
6230 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
6231               MapReduceMappingsToLongTask<K,V> nextRight,
6232               ObjectByObjectToLong<? super K, ? super V> transformer,
6233               long basis,
6234               LongByLongToLong reducer) {
6235 <            super(p, b); this.nextRight = nextRight;
6235 >            super(m, p, b); this.nextRight = nextRight;
6236              this.transformer = transformer;
6237              this.basis = basis; this.reducer = reducer;
6238          }
# Line 6438 | Line 6247 | public class ConcurrentHashMapV8<K, V>
6247                  for (int c, b = batch(); b > 1 && baseIndex != baseLimit;) {
6248                      do {} while (!casPending(c = pending, c+1));
6249                      (rights = new MapReduceMappingsToLongTask<K,V>
6250 <                     (this, b >>>= 1, rights, transformer, id, reducer)).fork();
6250 >                     (map, this, b >>>= 1, rights, transformer, id, reducer)).fork();
6251                  }
6252                  long r = id;
6253                  Object v;
# Line 6477 | Line 6286 | public class ConcurrentHashMapV8<K, V>
6286          int result;
6287          MapReduceKeysToIntTask<K,V> rights, nextRight;
6288          MapReduceKeysToIntTask
6289 <            (ConcurrentHashMapV8<K,V> m,
6481 <             ObjectToInt<? super K> transformer,
6482 <             int basis,
6483 <             IntByIntToInt reducer) {
6484 <            super(m);
6485 <            this.transformer = transformer;
6486 <            this.basis = basis; this.reducer = reducer;
6487 <        }
6488 <        MapReduceKeysToIntTask
6489 <            (BulkTask<K,V,?> p, int b,
6289 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
6290               MapReduceKeysToIntTask<K,V> nextRight,
6291               ObjectToInt<? super K> transformer,
6292               int basis,
6293               IntByIntToInt reducer) {
6294 <            super(p, b); this.nextRight = nextRight;
6294 >            super(m, p, b); this.nextRight = nextRight;
6295              this.transformer = transformer;
6296              this.basis = basis; this.reducer = reducer;
6297          }
# Line 6506 | Line 6306 | public class ConcurrentHashMapV8<K, V>
6306                  for (int c, b = batch(); b > 1 && baseIndex != baseLimit;) {
6307                      do {} while (!casPending(c = pending, c+1));
6308                      (rights = new MapReduceKeysToIntTask<K,V>
6309 <                     (this, b >>>= 1, rights, transformer, id, reducer)).fork();
6309 >                     (map, this, b >>>= 1, rights, transformer, id, reducer)).fork();
6310                  }
6311                  int r = id;
6312                  while (advance() != null)
# Line 6544 | Line 6344 | public class ConcurrentHashMapV8<K, V>
6344          int result;
6345          MapReduceValuesToIntTask<K,V> rights, nextRight;
6346          MapReduceValuesToIntTask
6347 <            (ConcurrentHashMapV8<K,V> m,
6548 <             ObjectToInt<? super V> transformer,
6549 <             int basis,
6550 <             IntByIntToInt reducer) {
6551 <            super(m);
6552 <            this.transformer = transformer;
6553 <            this.basis = basis; this.reducer = reducer;
6554 <        }
6555 <        MapReduceValuesToIntTask
6556 <            (BulkTask<K,V,?> p, int b,
6347 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
6348               MapReduceValuesToIntTask<K,V> nextRight,
6349               ObjectToInt<? super V> transformer,
6350               int basis,
6351               IntByIntToInt reducer) {
6352 <            super(p, b); this.nextRight = nextRight;
6352 >            super(m, p, b); this.nextRight = nextRight;
6353              this.transformer = transformer;
6354              this.basis = basis; this.reducer = reducer;
6355          }
# Line 6573 | Line 6364 | public class ConcurrentHashMapV8<K, V>
6364                  for (int c, b = batch(); b > 1 && baseIndex != baseLimit;) {
6365                      do {} while (!casPending(c = pending, c+1));
6366                      (rights = new MapReduceValuesToIntTask<K,V>
6367 <                     (this, b >>>= 1, rights, transformer, id, reducer)).fork();
6367 >                     (map, this, b >>>= 1, rights, transformer, id, reducer)).fork();
6368                  }
6369                  int r = id;
6370                  Object v;
# Line 6612 | Line 6403 | public class ConcurrentHashMapV8<K, V>
6403          int result;
6404          MapReduceEntriesToIntTask<K,V> rights, nextRight;
6405          MapReduceEntriesToIntTask
6406 <            (ConcurrentHashMapV8<K,V> m,
6616 <             ObjectToInt<Map.Entry<K,V>> transformer,
6617 <             int basis,
6618 <             IntByIntToInt reducer) {
6619 <            super(m);
6620 <            this.transformer = transformer;
6621 <            this.basis = basis; this.reducer = reducer;
6622 <        }
6623 <        MapReduceEntriesToIntTask
6624 <            (BulkTask<K,V,?> p, int b,
6406 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
6407               MapReduceEntriesToIntTask<K,V> nextRight,
6408               ObjectToInt<Map.Entry<K,V>> transformer,
6409               int basis,
6410               IntByIntToInt reducer) {
6411 <            super(p, b); this.nextRight = nextRight;
6411 >            super(m, p, b); this.nextRight = nextRight;
6412              this.transformer = transformer;
6413              this.basis = basis; this.reducer = reducer;
6414          }
# Line 6641 | Line 6423 | public class ConcurrentHashMapV8<K, V>
6423                  for (int c, b = batch(); b > 1 && baseIndex != baseLimit;) {
6424                      do {} while (!casPending(c = pending, c+1));
6425                      (rights = new MapReduceEntriesToIntTask<K,V>
6426 <                     (this, b >>>= 1, rights, transformer, id, reducer)).fork();
6426 >                     (map, this, b >>>= 1, rights, transformer, id, reducer)).fork();
6427                  }
6428                  int r = id;
6429                  Object v;
# Line 6680 | Line 6462 | public class ConcurrentHashMapV8<K, V>
6462          int result;
6463          MapReduceMappingsToIntTask<K,V> rights, nextRight;
6464          MapReduceMappingsToIntTask
6465 <            (ConcurrentHashMapV8<K,V> m,
6466 <             ObjectByObjectToInt<? super K, ? super V> transformer,
6685 <             int basis,
6686 <             IntByIntToInt reducer) {
6687 <            super(m);
6688 <            this.transformer = transformer;
6689 <            this.basis = basis; this.reducer = reducer;
6690 <        }
6691 <        MapReduceMappingsToIntTask
6692 <            (BulkTask<K,V,?> p, int b,
6693 <             MapReduceMappingsToIntTask<K,V> nextRight,
6465 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
6466 >             MapReduceMappingsToIntTask<K,V> rights,
6467               ObjectByObjectToInt<? super K, ? super V> transformer,
6468               int basis,
6469               IntByIntToInt reducer) {
6470 <            super(p, b); this.nextRight = nextRight;
6470 >            super(m, p, b); this.nextRight = nextRight;
6471              this.transformer = transformer;
6472              this.basis = basis; this.reducer = reducer;
6473          }
# Line 6709 | Line 6482 | public class ConcurrentHashMapV8<K, V>
6482                  for (int c, b = batch(); b > 1 && baseIndex != baseLimit;) {
6483                      do {} while (!casPending(c = pending, c+1));
6484                      (rights = new MapReduceMappingsToIntTask<K,V>
6485 <                     (this, b >>>= 1, rights, transformer, id, reducer)).fork();
6485 >                     (map, this, b >>>= 1, rights, transformer, id, reducer)).fork();
6486                  }
6487                  int r = id;
6488                  Object v;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines