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.61 by dl, Thu Sep 13 10:41:37 2012 UTC vs.
Revision 1.69 by jsr166, Sun Oct 21 06:14:11 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 2494 | Line 2505 | public class ConcurrentHashMapV8<K, V>
2505      }
2506  
2507      /**
2508 +     * Returns the value to which the specified key is mapped,
2509 +     * or the given defaultValue if this map contains no mapping for the key.
2510 +     *
2511 +     * @param key the key
2512 +     * @param defaultValue the value to return if this map contains
2513 +     * no mapping for the given key
2514 +     * @return the mapping for the key, if present; else the defaultValue
2515 +     * @throws NullPointerException if the specified key is null
2516 +     */
2517 +    @SuppressWarnings("unchecked") public V getValueOrDefault(Object key, V defaultValue) {
2518 +        if (key == null)
2519 +            throw new NullPointerException();
2520 +        V v = (V) internalGet(key);
2521 +        return v == null ? defaultValue : v;
2522 +    }
2523 +
2524 +    /**
2525       * Tests if the specified object is a key in this table.
2526       *
2527       * @param  key   possible key
# Line 2622 | Line 2650 | public class ConcurrentHashMapV8<K, V>
2650       * @param key key with which the specified value is to be associated
2651       * @param mappingFunction the function to compute a value
2652       * @return the current (existing or computed) value associated with
2653 <     *         the specified key, or null if the computed value is null.
2653 >     *         the specified key, or null if the computed value is null
2654       * @throws NullPointerException if the specified key or mappingFunction
2655       *         is null
2656       * @throws IllegalStateException if the computation detectably
# Line 3643 | Line 3671 | public class ConcurrentHashMapV8<K, V>
3671           * of each (key, value).
3672           *
3673           * @param transformer a function returning the transformation
3674 <         * for an element, or null of there is no transformation (in
3675 <         * which case the action is not applied).
3674 >         * for an element, or null if there is no transformation (in
3675 >         * which case the action is not applied)
3676           * @param action the action
3677           */
3678          public <U> void forEach(BiFun<? super K, ? super V, ? extends U> transformer,
# Line 3676 | Line 3704 | public class ConcurrentHashMapV8<K, V>
3704           * combine values, or null if none.
3705           *
3706           * @param transformer a function returning the transformation
3707 <         * for an element, or null of there is no transformation (in
3708 <         * which case it is not combined).
3707 >         * for an element, or null if there is no transformation (in
3708 >         * which case it is not combined)
3709           * @param reducer a commutative associative combining function
3710           * @return the result of accumulating the given transformation
3711           * of all (key, value) pairs
# Line 3760 | Line 3788 | public class ConcurrentHashMapV8<K, V>
3788           * of each key.
3789           *
3790           * @param transformer a function returning the transformation
3791 <         * for an element, or null of there is no transformation (in
3792 <         * which case the action is not applied).
3791 >         * for an element, or null if there is no transformation (in
3792 >         * which case the action is not applied)
3793           * @param action the action
3794           */
3795          public <U> void forEachKey(Fun<? super K, ? extends U> transformer,
# Line 3806 | Line 3834 | public class ConcurrentHashMapV8<K, V>
3834           * null if none.
3835           *
3836           * @param transformer a function returning the transformation
3837 <         * for an element, or null of there is no transformation (in
3838 <         * which case it is not combined).
3837 >         * for an element, or null if there is no transformation (in
3838 >         * which case it is not combined)
3839           * @param reducer a commutative associative combining function
3840           * @return the result of accumulating the given transformation
3841           * of all keys
# Line 3890 | Line 3918 | public class ConcurrentHashMapV8<K, V>
3918           * of each value.
3919           *
3920           * @param transformer a function returning the transformation
3921 <         * for an element, or null of there is no transformation (in
3922 <         * which case the action is not applied).
3921 >         * for an element, or null if there is no transformation (in
3922 >         * which case the action is not applied)
3923           */
3924          public <U> void forEachValue(Fun<? super V, ? extends U> transformer,
3925                                       Action<U> action) {
# Line 3910 | Line 3938 | public class ConcurrentHashMapV8<K, V>
3938           * result on success, else null
3939           * @return a non-null result from applying the given search
3940           * function on each value, or null if none
3913         *
3941           */
3942          public <U> U searchValues(Fun<? super V, ? extends U> searchFunction) {
3943              return fjp.invoke(ForkJoinTasks.searchValues
# Line 3935 | Line 3962 | public class ConcurrentHashMapV8<K, V>
3962           * null if none.
3963           *
3964           * @param transformer a function returning the transformation
3965 <         * for an element, or null of there is no transformation (in
3966 <         * which case it is not combined).
3965 >         * for an element, or null if there is no transformation (in
3966 >         * which case it is not combined)
3967           * @param reducer a commutative associative combining function
3968           * @return the result of accumulating the given transformation
3969           * of all values
# Line 4019 | Line 4046 | public class ConcurrentHashMapV8<K, V>
4046           * of each entry.
4047           *
4048           * @param transformer a function returning the transformation
4049 <         * for an element, or null of there is no transformation (in
4050 <         * which case the action is not applied).
4049 >         * for an element, or null if there is no transformation (in
4050 >         * which case the action is not applied)
4051           * @param action the action
4052           */
4053          public <U> void forEachEntry(Fun<Map.Entry<K,V>, ? extends U> transformer,
# Line 4064 | Line 4091 | public class ConcurrentHashMapV8<K, V>
4091           * or null if none.
4092           *
4093           * @param transformer a function returning the transformation
4094 <         * for an element, or null of there is no transformation (in
4094 >         * for an element, or null if there is no transformation (in
4095           * which case it is not combined).
4096           * @param reducer a commutative associative combining function
4097           * @return the result of accumulating the given transformation
# Line 4159 | Line 4186 | public class ConcurrentHashMapV8<K, V>
4186              (ConcurrentHashMapV8<K,V> map,
4187               BiAction<K,V> action) {
4188              if (action == null) throw new NullPointerException();
4189 <            return new ForEachMappingTask<K,V>(map, action);
4189 >            return new ForEachMappingTask<K,V>(map, null, -1, action);
4190          }
4191  
4192          /**
# Line 4168 | Line 4195 | public class ConcurrentHashMapV8<K, V>
4195           *
4196           * @param map the map
4197           * @param transformer a function returning the transformation
4198 <         * for an element, or null of there is no transformation (in
4199 <         * which case the action is not applied).
4198 >         * for an element, or null if there is no transformation (in
4199 >         * which case the action is not applied)
4200           * @param action the action
4201           * @return the task
4202           */
# Line 4180 | Line 4207 | public class ConcurrentHashMapV8<K, V>
4207              if (transformer == null || action == null)
4208                  throw new NullPointerException();
4209              return new ForEachTransformedMappingTask<K,V,U>
4210 <                (map, transformer, action);
4210 >                (map, null, -1, transformer, action);
4211          }
4212  
4213          /**
# Line 4200 | Line 4227 | public class ConcurrentHashMapV8<K, V>
4227               BiFun<? super K, ? super V, ? extends U> searchFunction) {
4228              if (searchFunction == null) throw new NullPointerException();
4229              return new SearchMappingsTask<K,V,U>
4230 <                (map, searchFunction,
4230 >                (map, null, -1, searchFunction,
4231                   new AtomicReference<U>());
4232          }
4233  
# Line 4211 | Line 4238 | public class ConcurrentHashMapV8<K, V>
4238           *
4239           * @param map the map
4240           * @param transformer a function returning the transformation
4241 <         * for an element, or null of there is no transformation (in
4241 >         * for an element, or null if there is no transformation (in
4242           * which case it is not combined).
4243           * @param reducer a commutative associative combining function
4244           * @return the task
# Line 4223 | Line 4250 | public class ConcurrentHashMapV8<K, V>
4250              if (transformer == null || reducer == null)
4251                  throw new NullPointerException();
4252              return new MapReduceMappingsTask<K,V,U>
4253 <                (map, transformer, reducer);
4253 >                (map, null, -1, null, transformer, reducer);
4254          }
4255  
4256          /**
# Line 4247 | Line 4274 | public class ConcurrentHashMapV8<K, V>
4274              if (transformer == null || reducer == null)
4275                  throw new NullPointerException();
4276              return new MapReduceMappingsToDoubleTask<K,V>
4277 <                (map, transformer, basis, reducer);
4277 >                (map, null, -1, null, transformer, basis, reducer);
4278          }
4279  
4280          /**
# Line 4271 | Line 4298 | public class ConcurrentHashMapV8<K, V>
4298              if (transformer == null || reducer == null)
4299                  throw new NullPointerException();
4300              return new MapReduceMappingsToLongTask<K,V>
4301 <                (map, transformer, basis, reducer);
4301 >                (map, null, -1, null, transformer, basis, reducer);
4302          }
4303  
4304          /**
# Line 4294 | Line 4321 | public class ConcurrentHashMapV8<K, V>
4321              if (transformer == null || reducer == null)
4322                  throw new NullPointerException();
4323              return new MapReduceMappingsToIntTask<K,V>
4324 <                (map, transformer, basis, reducer);
4324 >                (map, null, -1, null, transformer, basis, reducer);
4325          }
4326  
4327          /**
# Line 4309 | Line 4336 | public class ConcurrentHashMapV8<K, V>
4336              (ConcurrentHashMapV8<K,V> map,
4337               Action<K> action) {
4338              if (action == null) throw new NullPointerException();
4339 <            return new ForEachKeyTask<K,V>(map, action);
4339 >            return new ForEachKeyTask<K,V>(map, null, -1, action);
4340          }
4341  
4342          /**
# Line 4318 | Line 4345 | public class ConcurrentHashMapV8<K, V>
4345           *
4346           * @param map the map
4347           * @param transformer a function returning the transformation
4348 <         * for an element, or null of there is no transformation (in
4349 <         * which case the action is not applied).
4348 >         * for an element, or null if there is no transformation (in
4349 >         * which case the action is not applied)
4350           * @param action the action
4351           * @return the task
4352           */
# Line 4330 | Line 4357 | public class ConcurrentHashMapV8<K, V>
4357              if (transformer == null || action == null)
4358                  throw new NullPointerException();
4359              return new ForEachTransformedKeyTask<K,V,U>
4360 <                (map, transformer, action);
4360 >                (map, null, -1, transformer, action);
4361          }
4362  
4363          /**
# Line 4350 | Line 4377 | public class ConcurrentHashMapV8<K, V>
4377               Fun<? super K, ? extends U> searchFunction) {
4378              if (searchFunction == null) throw new NullPointerException();
4379              return new SearchKeysTask<K,V,U>
4380 <                (map, searchFunction,
4380 >                (map, null, -1, searchFunction,
4381                   new AtomicReference<U>());
4382          }
4383  
# Line 4368 | Line 4395 | public class ConcurrentHashMapV8<K, V>
4395               BiFun<? super K, ? super K, ? extends K> reducer) {
4396              if (reducer == null) throw new NullPointerException();
4397              return new ReduceKeysTask<K,V>
4398 <                (map, reducer);
4398 >                (map, null, -1, null, reducer);
4399          }
4400  
4401          /**
# Line 4378 | Line 4405 | public class ConcurrentHashMapV8<K, V>
4405           *
4406           * @param map the map
4407           * @param transformer a function returning the transformation
4408 <         * for an element, or null of there is no transformation (in
4408 >         * for an element, or null if there is no transformation (in
4409           * which case it is not combined).
4410           * @param reducer a commutative associative combining function
4411           * @return the task
# Line 4390 | Line 4417 | public class ConcurrentHashMapV8<K, V>
4417              if (transformer == null || reducer == null)
4418                  throw new NullPointerException();
4419              return new MapReduceKeysTask<K,V,U>
4420 <                (map, transformer, reducer);
4420 >                (map, null, -1, null, transformer, reducer);
4421          }
4422  
4423          /**
# Line 4414 | Line 4441 | public class ConcurrentHashMapV8<K, V>
4441              if (transformer == null || reducer == null)
4442                  throw new NullPointerException();
4443              return new MapReduceKeysToDoubleTask<K,V>
4444 <                (map, transformer, basis, reducer);
4444 >                (map, null, -1, null, transformer, basis, reducer);
4445          }
4446  
4447          /**
# Line 4438 | Line 4465 | public class ConcurrentHashMapV8<K, V>
4465              if (transformer == null || reducer == null)
4466                  throw new NullPointerException();
4467              return new MapReduceKeysToLongTask<K,V>
4468 <                (map, transformer, basis, reducer);
4468 >                (map, null, -1, null, transformer, basis, reducer);
4469          }
4470  
4471          /**
# Line 4462 | Line 4489 | public class ConcurrentHashMapV8<K, V>
4489              if (transformer == null || reducer == null)
4490                  throw new NullPointerException();
4491              return new MapReduceKeysToIntTask<K,V>
4492 <                (map, transformer, basis, reducer);
4492 >                (map, null, -1, null, transformer, basis, reducer);
4493          }
4494  
4495          /**
# Line 4476 | Line 4503 | public class ConcurrentHashMapV8<K, V>
4503              (ConcurrentHashMapV8<K,V> map,
4504               Action<V> action) {
4505              if (action == null) throw new NullPointerException();
4506 <            return new ForEachValueTask<K,V>(map, action);
4506 >            return new ForEachValueTask<K,V>(map, null, -1, action);
4507          }
4508  
4509          /**
# Line 4485 | Line 4512 | public class ConcurrentHashMapV8<K, V>
4512           *
4513           * @param map the map
4514           * @param transformer a function returning the transformation
4515 <         * for an element, or null of there is no transformation (in
4516 <         * which case the action is not applied).
4515 >         * for an element, or null if there is no transformation (in
4516 >         * which case the action is not applied)
4517           * @param action the action
4518           */
4519          public static <K,V,U> ForkJoinTask<Void> forEachValue
# Line 4496 | Line 4523 | public class ConcurrentHashMapV8<K, V>
4523              if (transformer == null || action == null)
4524                  throw new NullPointerException();
4525              return new ForEachTransformedValueTask<K,V,U>
4526 <                (map, transformer, action);
4526 >                (map, null, -1, transformer, action);
4527          }
4528  
4529          /**
# Line 4510 | Line 4537 | public class ConcurrentHashMapV8<K, V>
4537           * @param searchFunction a function returning a non-null
4538           * result on success, else null
4539           * @return the task
4513         *
4540           */
4541          public static <K,V,U> ForkJoinTask<U> searchValues
4542              (ConcurrentHashMapV8<K,V> map,
4543               Fun<? super V, ? extends U> searchFunction) {
4544              if (searchFunction == null) throw new NullPointerException();
4545              return new SearchValuesTask<K,V,U>
4546 <                (map, searchFunction,
4546 >                (map, null, -1, searchFunction,
4547                   new AtomicReference<U>());
4548          }
4549  
# Line 4535 | Line 4561 | public class ConcurrentHashMapV8<K, V>
4561               BiFun<? super V, ? super V, ? extends V> reducer) {
4562              if (reducer == null) throw new NullPointerException();
4563              return new ReduceValuesTask<K,V>
4564 <                (map, reducer);
4564 >                (map, null, -1, null, reducer);
4565          }
4566  
4567          /**
# Line 4545 | Line 4571 | public class ConcurrentHashMapV8<K, V>
4571           *
4572           * @param map the map
4573           * @param transformer a function returning the transformation
4574 <         * for an element, or null of there is no transformation (in
4574 >         * for an element, or null if there is no transformation (in
4575           * which case it is not combined).
4576           * @param reducer a commutative associative combining function
4577           * @return the task
# Line 4557 | Line 4583 | public class ConcurrentHashMapV8<K, V>
4583              if (transformer == null || reducer == null)
4584                  throw new NullPointerException();
4585              return new MapReduceValuesTask<K,V,U>
4586 <                (map, transformer, reducer);
4586 >                (map, null, -1, null, transformer, reducer);
4587          }
4588  
4589          /**
# Line 4581 | Line 4607 | public class ConcurrentHashMapV8<K, V>
4607              if (transformer == null || reducer == null)
4608                  throw new NullPointerException();
4609              return new MapReduceValuesToDoubleTask<K,V>
4610 <                (map, transformer, basis, reducer);
4610 >                (map, null, -1, null, transformer, basis, reducer);
4611          }
4612  
4613          /**
# Line 4605 | Line 4631 | public class ConcurrentHashMapV8<K, V>
4631              if (transformer == null || reducer == null)
4632                  throw new NullPointerException();
4633              return new MapReduceValuesToLongTask<K,V>
4634 <                (map, transformer, basis, reducer);
4634 >                (map, null, -1, null, transformer, basis, reducer);
4635          }
4636  
4637          /**
# Line 4629 | Line 4655 | public class ConcurrentHashMapV8<K, V>
4655              if (transformer == null || reducer == null)
4656                  throw new NullPointerException();
4657              return new MapReduceValuesToIntTask<K,V>
4658 <                (map, transformer, basis, reducer);
4658 >                (map, null, -1, null, transformer, basis, reducer);
4659          }
4660  
4661          /**
# Line 4643 | Line 4669 | public class ConcurrentHashMapV8<K, V>
4669              (ConcurrentHashMapV8<K,V> map,
4670               Action<Map.Entry<K,V>> action) {
4671              if (action == null) throw new NullPointerException();
4672 <            return new ForEachEntryTask<K,V>(map, action);
4672 >            return new ForEachEntryTask<K,V>(map, null, -1, action);
4673          }
4674  
4675          /**
# Line 4652 | Line 4678 | public class ConcurrentHashMapV8<K, V>
4678           *
4679           * @param map the map
4680           * @param transformer a function returning the transformation
4681 <         * for an element, or null of there is no transformation (in
4682 <         * which case the action is not applied).
4681 >         * for an element, or null if there is no transformation (in
4682 >         * which case the action is not applied)
4683           * @param action the action
4684           */
4685          public static <K,V,U> ForkJoinTask<Void> forEachEntry
# Line 4663 | Line 4689 | public class ConcurrentHashMapV8<K, V>
4689              if (transformer == null || action == null)
4690                  throw new NullPointerException();
4691              return new ForEachTransformedEntryTask<K,V,U>
4692 <                (map, transformer, action);
4692 >                (map, null, -1, transformer, action);
4693          }
4694  
4695          /**
# Line 4677 | Line 4703 | public class ConcurrentHashMapV8<K, V>
4703           * @param searchFunction a function returning a non-null
4704           * result on success, else null
4705           * @return the task
4680         *
4706           */
4707          public static <K,V,U> ForkJoinTask<U> searchEntries
4708              (ConcurrentHashMapV8<K,V> map,
4709               Fun<Map.Entry<K,V>, ? extends U> searchFunction) {
4710              if (searchFunction == null) throw new NullPointerException();
4711              return new SearchEntriesTask<K,V,U>
4712 <                (map, searchFunction,
4712 >                (map, null, -1, searchFunction,
4713                   new AtomicReference<U>());
4714          }
4715  
# Line 4702 | Line 4727 | public class ConcurrentHashMapV8<K, V>
4727               BiFun<Map.Entry<K,V>, Map.Entry<K,V>, ? extends Map.Entry<K,V>> reducer) {
4728              if (reducer == null) throw new NullPointerException();
4729              return new ReduceEntriesTask<K,V>
4730 <                (map, reducer);
4730 >                (map, null, -1, null, reducer);
4731          }
4732  
4733          /**
# Line 4712 | Line 4737 | public class ConcurrentHashMapV8<K, V>
4737           *
4738           * @param map the map
4739           * @param transformer a function returning the transformation
4740 <         * for an element, or null of there is no transformation (in
4740 >         * for an element, or null if there is no transformation (in
4741           * which case it is not combined).
4742           * @param reducer a commutative associative combining function
4743           * @return the task
# Line 4724 | Line 4749 | public class ConcurrentHashMapV8<K, V>
4749              if (transformer == null || reducer == null)
4750                  throw new NullPointerException();
4751              return new MapReduceEntriesTask<K,V,U>
4752 <                (map, transformer, reducer);
4752 >                (map, null, -1, null, transformer, reducer);
4753          }
4754  
4755          /**
# Line 4748 | Line 4773 | public class ConcurrentHashMapV8<K, V>
4773              if (transformer == null || reducer == null)
4774                  throw new NullPointerException();
4775              return new MapReduceEntriesToDoubleTask<K,V>
4776 <                (map, transformer, basis, reducer);
4776 >                (map, null, -1, null, transformer, basis, reducer);
4777          }
4778  
4779          /**
# Line 4772 | Line 4797 | public class ConcurrentHashMapV8<K, V>
4797              if (transformer == null || reducer == null)
4798                  throw new NullPointerException();
4799              return new MapReduceEntriesToLongTask<K,V>
4800 <                (map, transformer, basis, reducer);
4800 >                (map, null, -1, null, transformer, basis, reducer);
4801          }
4802  
4803          /**
# Line 4796 | Line 4821 | public class ConcurrentHashMapV8<K, V>
4821              if (transformer == null || reducer == null)
4822                  throw new NullPointerException();
4823              return new MapReduceEntriesToIntTask<K,V>
4824 <                (map, transformer, basis, reducer);
4824 >                (map, null, -1, null, transformer, basis, reducer);
4825          }
4826      }
4827  
# Line 4815 | Line 4840 | public class ConcurrentHashMapV8<K, V>
4840       */
4841      @SuppressWarnings("serial") static abstract class BulkTask<K,V,R> extends Traverser<K,V,R> {
4842          final BulkTask<K,V,?> parent;  // completion target
4843 <        int batch;                     // split control
4843 >        int batch;                     // split control; -1 for unknown
4844          int pending;                   // completion control
4845  
4846 <        /** Constructor for root tasks */
4847 <        BulkTask(ConcurrentHashMapV8<K,V> map) {
4846 >        BulkTask(ConcurrentHashMapV8<K,V> map, BulkTask<K,V,?> parent,
4847 >                 int batch) {
4848              super(map);
4824            this.parent = null;
4825            this.batch = -1; // force call to batch() on execution
4826        }
4827
4828        /** Constructor for subtasks */
4829        BulkTask(BulkTask<K,V,?> parent, int batch) {
4830            super(parent);
4849              this.parent = parent;
4850              this.batch = batch;
4851 +            if (parent != null && map != null) { // split parent
4852 +                Node[] t;
4853 +                if ((t = parent.tab) == null &&
4854 +                    (t = parent.tab = map.table) != null)
4855 +                    parent.baseLimit = parent.baseSize = t.length;
4856 +                this.tab = t;
4857 +                this.baseSize = parent.baseSize;
4858 +                int hi = this.baseLimit = parent.baseLimit;
4859 +                parent.baseLimit = this.index = this.baseIndex =
4860 +                    (hi + parent.baseIndex + 1) >>> 1;
4861 +            }
4862          }
4863  
4864          // FJ methods
# Line 4893 | Line 4922 | public class ConcurrentHashMapV8<K, V>
4922           * dividing by two anyway.
4923           */
4924          final int batch() {
4925 <            int b = batch;
4926 <            if (b < 0) {
4927 <                long n = map.counter.sum();
4928 <                int sp = getPool().getParallelism() << 3; // slack of 8
4929 <                b = batch = (n <= 0L) ? 0 : (n < (long)sp) ? (int)n : sp;
4925 >            ConcurrentHashMapV8<K, V> m; int b; Node[] t;
4926 >            if ((b = batch) < 0 && (m = map) != null) { // force initialization
4927 >                if ((t = tab) == null && (t = tab = m.table) != null)
4928 >                    baseLimit = baseSize = t.length;
4929 >                if (t != null) {
4930 >                    long n = m.counter.sum();
4931 >                    int sp = getPool().getParallelism() << 3; // slack of 8
4932 >                    b = batch = (n <= 0L) ? 0 : (n < (long)sp) ? (int)n : sp;
4933 >                }
4934              }
4935              return b;
4936          }
# Line 4933 | Line 4966 | public class ConcurrentHashMapV8<K, V>
4966          extends BulkTask<K,V,Void> {
4967          final Action<K> action;
4968          ForEachKeyTask
4969 <            (ConcurrentHashMapV8<K,V> m,
4937 <             Action<K> action) {
4938 <            super(m);
4939 <            this.action = action;
4940 <        }
4941 <        ForEachKeyTask
4942 <            (BulkTask<K,V,?> p, int b,
4969 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
4970               Action<K> action) {
4971 <            super(p, b);
4971 >            super(m, p, b);
4972              this.action = action;
4973          }
4974          @SuppressWarnings("unchecked") public final boolean exec() {
# Line 4952 | Line 4979 | public class ConcurrentHashMapV8<K, V>
4979                  int b = batch(), c;
4980                  while (b > 1 && baseIndex != baseLimit) {
4981                      do {} while (!casPending(c = pending, c+1));
4982 <                    new ForEachKeyTask<K,V>(this, b >>>= 1, action).fork();
4982 >                    new ForEachKeyTask<K,V>(map, this, b >>>= 1, action).fork();
4983                  }
4984                  while (advance() != null)
4985                      action.apply((K)nextKey);
# Line 4968 | Line 4995 | public class ConcurrentHashMapV8<K, V>
4995          extends BulkTask<K,V,Void> {
4996          final Action<V> action;
4997          ForEachValueTask
4998 <            (ConcurrentHashMapV8<K,V> m,
4998 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
4999               Action<V> action) {
5000 <            super(m);
4974 <            this.action = action;
4975 <        }
4976 <        ForEachValueTask
4977 <            (BulkTask<K,V,?> p, int b,
4978 <             Action<V> action) {
4979 <            super(p, b);
5000 >            super(m, p, b);
5001              this.action = action;
5002          }
5003          @SuppressWarnings("unchecked") public final boolean exec() {
# Line 4987 | Line 5008 | public class ConcurrentHashMapV8<K, V>
5008                  int b = batch(), c;
5009                  while (b > 1 && baseIndex != baseLimit) {
5010                      do {} while (!casPending(c = pending, c+1));
5011 <                    new ForEachValueTask<K,V>(this, b >>>= 1, action).fork();
5011 >                    new ForEachValueTask<K,V>(map, this, b >>>= 1, action).fork();
5012                  }
5013                  Object v;
5014                  while ((v = advance()) != null)
# Line 5004 | Line 5025 | public class ConcurrentHashMapV8<K, V>
5025          extends BulkTask<K,V,Void> {
5026          final Action<Entry<K,V>> action;
5027          ForEachEntryTask
5028 <            (ConcurrentHashMapV8<K,V> m,
5028 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5029               Action<Entry<K,V>> action) {
5030 <            super(m);
5010 <            this.action = action;
5011 <        }
5012 <        ForEachEntryTask
5013 <            (BulkTask<K,V,?> p, int b,
5014 <             Action<Entry<K,V>> action) {
5015 <            super(p, b);
5030 >            super(m, p, b);
5031              this.action = action;
5032          }
5033          @SuppressWarnings("unchecked") public final boolean exec() {
# Line 5023 | Line 5038 | public class ConcurrentHashMapV8<K, V>
5038                  int b = batch(), c;
5039                  while (b > 1 && baseIndex != baseLimit) {
5040                      do {} while (!casPending(c = pending, c+1));
5041 <                    new ForEachEntryTask<K,V>(this, b >>>= 1, action).fork();
5041 >                    new ForEachEntryTask<K,V>(map, this, b >>>= 1, action).fork();
5042                  }
5043                  Object v;
5044                  while ((v = advance()) != null)
# Line 5040 | Line 5055 | public class ConcurrentHashMapV8<K, V>
5055          extends BulkTask<K,V,Void> {
5056          final BiAction<K,V> action;
5057          ForEachMappingTask
5058 <            (ConcurrentHashMapV8<K,V> m,
5044 <             BiAction<K,V> action) {
5045 <            super(m);
5046 <            this.action = action;
5047 <        }
5048 <        ForEachMappingTask
5049 <            (BulkTask<K,V,?> p, int b,
5058 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5059               BiAction<K,V> action) {
5060 <            super(p, b);
5060 >            super(m, p, b);
5061              this.action = action;
5062          }
5054
5063          @SuppressWarnings("unchecked") public final boolean exec() {
5064              final BiAction<K,V> action = this.action;
5065              if (action == null)
# Line 5060 | Line 5068 | public class ConcurrentHashMapV8<K, V>
5068                  int b = batch(), c;
5069                  while (b > 1 && baseIndex != baseLimit) {
5070                      do {} while (!casPending(c = pending, c+1));
5071 <                    new ForEachMappingTask<K,V>(this, b >>>= 1,
5071 >                    new ForEachMappingTask<K,V>(map, this, b >>>= 1,
5072                                                  action).fork();
5073                  }
5074                  Object v;
# Line 5079 | Line 5087 | public class ConcurrentHashMapV8<K, V>
5087          final Fun<? super K, ? extends U> transformer;
5088          final Action<U> action;
5089          ForEachTransformedKeyTask
5090 <            (ConcurrentHashMapV8<K,V> m,
5090 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5091               Fun<? super K, ? extends U> transformer,
5092               Action<U> action) {
5093 <            super(m);
5093 >            super(m, p, b);
5094              this.transformer = transformer;
5095              this.action = action;
5096  
5097          }
5090        ForEachTransformedKeyTask
5091            (BulkTask<K,V,?> p, int b,
5092             Fun<? super K, ? extends U> transformer,
5093             Action<U> action) {
5094            super(p, b);
5095            this.transformer = transformer;
5096            this.action = action;
5097        }
5098          @SuppressWarnings("unchecked") public final boolean exec() {
5099              final Fun<? super K, ? extends U> transformer =
5100                  this.transformer;
# Line 5106 | Line 5106 | public class ConcurrentHashMapV8<K, V>
5106                  while (b > 1 && baseIndex != baseLimit) {
5107                      do {} while (!casPending(c = pending, c+1));
5108                      new ForEachTransformedKeyTask<K,V,U>
5109 <                        (this, b >>>= 1, transformer, action).fork();
5109 >                        (map, this, b >>>= 1, transformer, action).fork();
5110                  }
5111                  U u;
5112                  while (advance() != null) {
# Line 5126 | Line 5126 | public class ConcurrentHashMapV8<K, V>
5126          final Fun<? super V, ? extends U> transformer;
5127          final Action<U> action;
5128          ForEachTransformedValueTask
5129 <            (ConcurrentHashMapV8<K,V> m,
5129 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5130               Fun<? super V, ? extends U> transformer,
5131               Action<U> action) {
5132 <            super(m);
5132 >            super(m, p, b);
5133              this.transformer = transformer;
5134              this.action = action;
5135  
5136          }
5137        ForEachTransformedValueTask
5138            (BulkTask<K,V,?> p, int b,
5139             Fun<? super V, ? extends U> transformer,
5140             Action<U> action) {
5141            super(p, b);
5142            this.transformer = transformer;
5143            this.action = action;
5144        }
5137          @SuppressWarnings("unchecked") public final boolean exec() {
5138              final Fun<? super V, ? extends U> transformer =
5139                  this.transformer;
# Line 5153 | Line 5145 | public class ConcurrentHashMapV8<K, V>
5145                  while (b > 1 && baseIndex != baseLimit) {
5146                      do {} while (!casPending(c = pending, c+1));
5147                      new ForEachTransformedValueTask<K,V,U>
5148 <                        (this, b >>>= 1, transformer, action).fork();
5148 >                        (map, this, b >>>= 1, transformer, action).fork();
5149                  }
5150                  Object v; U u;
5151                  while ((v = advance()) != null) {
# Line 5173 | Line 5165 | public class ConcurrentHashMapV8<K, V>
5165          final Fun<Map.Entry<K,V>, ? extends U> transformer;
5166          final Action<U> action;
5167          ForEachTransformedEntryTask
5168 <            (ConcurrentHashMapV8<K,V> m,
5168 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5169               Fun<Map.Entry<K,V>, ? extends U> transformer,
5170               Action<U> action) {
5171 <            super(m);
5171 >            super(m, p, b);
5172              this.transformer = transformer;
5173              this.action = action;
5174  
5175          }
5184        ForEachTransformedEntryTask
5185            (BulkTask<K,V,?> p, int b,
5186             Fun<Map.Entry<K,V>, ? extends U> transformer,
5187             Action<U> action) {
5188            super(p, b);
5189            this.transformer = transformer;
5190            this.action = action;
5191        }
5176          @SuppressWarnings("unchecked") public final boolean exec() {
5177              final Fun<Map.Entry<K,V>, ? extends U> transformer =
5178                  this.transformer;
# Line 5200 | Line 5184 | public class ConcurrentHashMapV8<K, V>
5184                  while (b > 1 && baseIndex != baseLimit) {
5185                      do {} while (!casPending(c = pending, c+1));
5186                      new ForEachTransformedEntryTask<K,V,U>
5187 <                        (this, b >>>= 1, transformer, action).fork();
5187 >                        (map, this, b >>>= 1, transformer, action).fork();
5188                  }
5189                  Object v; U u;
5190                  while ((v = advance()) != null) {
# Line 5220 | Line 5204 | public class ConcurrentHashMapV8<K, V>
5204          final BiFun<? super K, ? super V, ? extends U> transformer;
5205          final Action<U> action;
5206          ForEachTransformedMappingTask
5207 <            (ConcurrentHashMapV8<K,V> m,
5207 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5208               BiFun<? super K, ? super V, ? extends U> transformer,
5209               Action<U> action) {
5210 <            super(m);
5210 >            super(m, p, b);
5211              this.transformer = transformer;
5212              this.action = action;
5213  
5214          }
5231        ForEachTransformedMappingTask
5232            (BulkTask<K,V,?> p, int b,
5233             BiFun<? super K, ? super V, ? extends U> transformer,
5234             Action<U> action) {
5235            super(p, b);
5236            this.transformer = transformer;
5237            this.action = action;
5238        }
5215          @SuppressWarnings("unchecked") public final boolean exec() {
5216              final BiFun<? super K, ? super V, ? extends U> transformer =
5217                  this.transformer;
# Line 5247 | Line 5223 | public class ConcurrentHashMapV8<K, V>
5223                  while (b > 1 && baseIndex != baseLimit) {
5224                      do {} while (!casPending(c = pending, c+1));
5225                      new ForEachTransformedMappingTask<K,V,U>
5226 <                        (this, b >>>= 1, transformer, action).fork();
5226 >                        (map, this, b >>>= 1, transformer, action).fork();
5227                  }
5228                  Object v; U u;
5229                  while ((v = advance()) != null) {
# Line 5267 | Line 5243 | public class ConcurrentHashMapV8<K, V>
5243          final Fun<? super K, ? extends U> searchFunction;
5244          final AtomicReference<U> result;
5245          SearchKeysTask
5246 <            (ConcurrentHashMapV8<K,V> m,
5271 <             Fun<? super K, ? extends U> searchFunction,
5272 <             AtomicReference<U> result) {
5273 <            super(m);
5274 <            this.searchFunction = searchFunction; this.result = result;
5275 <        }
5276 <        SearchKeysTask
5277 <            (BulkTask<K,V,?> p, int b,
5246 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5247               Fun<? super K, ? extends U> searchFunction,
5248               AtomicReference<U> result) {
5249 <            super(p, b);
5249 >            super(m, p, b);
5250              this.searchFunction = searchFunction; this.result = result;
5251          }
5252          @SuppressWarnings("unchecked") public final boolean exec() {
# Line 5290 | Line 5259 | public class ConcurrentHashMapV8<K, V>
5259                  int b = batch(), c;
5260                  while (b > 1 && baseIndex != baseLimit && result.get() == null) {
5261                      do {} while (!casPending(c = pending, c+1));
5262 <                    new SearchKeysTask<K,V,U>(this, b >>>= 1,
5262 >                    new SearchKeysTask<K,V,U>(map, this, b >>>= 1,
5263                                                searchFunction, result).fork();
5264                  }
5265                  U u;
# Line 5315 | Line 5284 | public class ConcurrentHashMapV8<K, V>
5284          final Fun<? super V, ? extends U> searchFunction;
5285          final AtomicReference<U> result;
5286          SearchValuesTask
5287 <            (ConcurrentHashMapV8<K,V> m,
5287 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5288               Fun<? super V, ? extends U> searchFunction,
5289               AtomicReference<U> result) {
5290 <            super(m);
5322 <            this.searchFunction = searchFunction; this.result = result;
5323 <        }
5324 <        SearchValuesTask
5325 <            (BulkTask<K,V,?> p, int b,
5326 <             Fun<? super V, ? extends U> searchFunction,
5327 <             AtomicReference<U> result) {
5328 <            super(p, b);
5290 >            super(m, p, b);
5291              this.searchFunction = searchFunction; this.result = result;
5292          }
5293          @SuppressWarnings("unchecked") public final boolean exec() {
# Line 5338 | Line 5300 | public class ConcurrentHashMapV8<K, V>
5300                  int b = batch(), c;
5301                  while (b > 1 && baseIndex != baseLimit && result.get() == null) {
5302                      do {} while (!casPending(c = pending, c+1));
5303 <                    new SearchValuesTask<K,V,U>(this, b >>>= 1,
5303 >                    new SearchValuesTask<K,V,U>(map, this, b >>>= 1,
5304                                                  searchFunction, result).fork();
5305                  }
5306                  Object v; U u;
# Line 5363 | Line 5325 | public class ConcurrentHashMapV8<K, V>
5325          final Fun<Entry<K,V>, ? extends U> searchFunction;
5326          final AtomicReference<U> result;
5327          SearchEntriesTask
5328 <            (ConcurrentHashMapV8<K,V> m,
5367 <             Fun<Entry<K,V>, ? extends U> searchFunction,
5368 <             AtomicReference<U> result) {
5369 <            super(m);
5370 <            this.searchFunction = searchFunction; this.result = result;
5371 <        }
5372 <        SearchEntriesTask
5373 <            (BulkTask<K,V,?> p, int b,
5328 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5329               Fun<Entry<K,V>, ? extends U> searchFunction,
5330               AtomicReference<U> result) {
5331 <            super(p, b);
5331 >            super(m, p, b);
5332              this.searchFunction = searchFunction; this.result = result;
5333          }
5334          @SuppressWarnings("unchecked") public final boolean exec() {
# Line 5386 | Line 5341 | public class ConcurrentHashMapV8<K, V>
5341                  int b = batch(), c;
5342                  while (b > 1 && baseIndex != baseLimit && result.get() == null) {
5343                      do {} while (!casPending(c = pending, c+1));
5344 <                    new SearchEntriesTask<K,V,U>(this, b >>>= 1,
5344 >                    new SearchEntriesTask<K,V,U>(map, this, b >>>= 1,
5345                                                   searchFunction, result).fork();
5346                  }
5347                  Object v; U u;
# Line 5411 | Line 5366 | public class ConcurrentHashMapV8<K, V>
5366          final BiFun<? super K, ? super V, ? extends U> searchFunction;
5367          final AtomicReference<U> result;
5368          SearchMappingsTask
5369 <            (ConcurrentHashMapV8<K,V> m,
5369 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5370               BiFun<? super K, ? super V, ? extends U> searchFunction,
5371               AtomicReference<U> result) {
5372 <            super(m);
5418 <            this.searchFunction = searchFunction; this.result = result;
5419 <        }
5420 <        SearchMappingsTask
5421 <            (BulkTask<K,V,?> p, int b,
5422 <             BiFun<? super K, ? super V, ? extends U> searchFunction,
5423 <             AtomicReference<U> result) {
5424 <            super(p, b);
5372 >            super(m, p, b);
5373              this.searchFunction = searchFunction; this.result = result;
5374          }
5375          @SuppressWarnings("unchecked") public final boolean exec() {
# Line 5434 | Line 5382 | public class ConcurrentHashMapV8<K, V>
5382                  int b = batch(), c;
5383                  while (b > 1 && baseIndex != baseLimit && result.get() == null) {
5384                      do {} while (!casPending(c = pending, c+1));
5385 <                    new SearchMappingsTask<K,V,U>(this, b >>>= 1,
5385 >                    new SearchMappingsTask<K,V,U>(map, this, b >>>= 1,
5386                                                    searchFunction, result).fork();
5387                  }
5388                  Object v; U u;
# Line 5460 | Line 5408 | public class ConcurrentHashMapV8<K, V>
5408          K result;
5409          ReduceKeysTask<K,V> rights, nextRight;
5410          ReduceKeysTask
5411 <            (ConcurrentHashMapV8<K,V> m,
5464 <             BiFun<? super K, ? super K, ? extends K> reducer) {
5465 <            super(m);
5466 <            this.reducer = reducer;
5467 <        }
5468 <        ReduceKeysTask
5469 <            (BulkTask<K,V,?> p, int b,
5411 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5412               ReduceKeysTask<K,V> nextRight,
5413               BiFun<? super K, ? super K, ? extends K> reducer) {
5414 <            super(p, b); this.nextRight = nextRight;
5414 >            super(m, p, b); this.nextRight = nextRight;
5415              this.reducer = reducer;
5416          }
5475
5417          @SuppressWarnings("unchecked") public final boolean exec() {
5418              final BiFun<? super K, ? super K, ? extends K> reducer =
5419                  this.reducer;
# Line 5482 | Line 5423 | public class ConcurrentHashMapV8<K, V>
5423                  for (int c, b = batch(); b > 1 && baseIndex != baseLimit;) {
5424                      do {} while (!casPending(c = pending, c+1));
5425                      (rights = new ReduceKeysTask<K,V>
5426 <                     (this, b >>>= 1, rights, reducer)).fork();
5426 >                     (map, this, b >>>= 1, rights, reducer)).fork();
5427                  }
5428                  K r = null;
5429                  while (advance() != null) {
# Line 5495 | Line 5436 | public class ConcurrentHashMapV8<K, V>
5436                      if ((c = t.pending) == 0) {
5437                          for (s = t.rights; s != null; s = t.rights = s.nextRight) {
5438                              if ((sr = s.result) != null)
5439 <                                t.result = (tr = t.result) == null? sr : reducer.apply(tr, sr);
5439 >                                t.result = ((tr = t.result) == null) ? sr : reducer.apply(tr, sr);
5440                          }
5441                          if ((par = t.parent) == null ||
5442                              !(par instanceof ReduceKeysTask)) {
# Line 5521 | Line 5462 | public class ConcurrentHashMapV8<K, V>
5462          V result;
5463          ReduceValuesTask<K,V> rights, nextRight;
5464          ReduceValuesTask
5465 <            (ConcurrentHashMapV8<K,V> m,
5525 <             BiFun<? super V, ? super V, ? extends V> reducer) {
5526 <            super(m);
5527 <            this.reducer = reducer;
5528 <        }
5529 <        ReduceValuesTask
5530 <            (BulkTask<K,V,?> p, int b,
5465 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5466               ReduceValuesTask<K,V> nextRight,
5467               BiFun<? super V, ? super V, ? extends V> reducer) {
5468 <            super(p, b); this.nextRight = nextRight;
5468 >            super(m, p, b); this.nextRight = nextRight;
5469              this.reducer = reducer;
5470          }
5536
5471          @SuppressWarnings("unchecked") public final boolean exec() {
5472              final BiFun<? super V, ? super V, ? extends V> reducer =
5473                  this.reducer;
# Line 5543 | Line 5477 | public class ConcurrentHashMapV8<K, V>
5477                  for (int c, b = batch(); b > 1 && baseIndex != baseLimit;) {
5478                      do {} while (!casPending(c = pending, c+1));
5479                      (rights = new ReduceValuesTask<K,V>
5480 <                     (this, b >>>= 1, rights, reducer)).fork();
5480 >                     (map, this, b >>>= 1, rights, reducer)).fork();
5481                  }
5482                  V r = null;
5483                  Object v;
# Line 5557 | Line 5491 | public class ConcurrentHashMapV8<K, V>
5491                      if ((c = t.pending) == 0) {
5492                          for (s = t.rights; s != null; s = t.rights = s.nextRight) {
5493                              if ((sr = s.result) != null)
5494 <                                t.result = (tr = t.result) == null? sr : reducer.apply(tr, sr);
5494 >                                t.result = ((tr = t.result) == null) ? sr : reducer.apply(tr, sr);
5495                          }
5496                          if ((par = t.parent) == null ||
5497                              !(par instanceof ReduceValuesTask)) {
# Line 5583 | Line 5517 | public class ConcurrentHashMapV8<K, V>
5517          Map.Entry<K,V> result;
5518          ReduceEntriesTask<K,V> rights, nextRight;
5519          ReduceEntriesTask
5520 <            (ConcurrentHashMapV8<K,V> m,
5587 <             BiFun<Entry<K,V>, Map.Entry<K,V>, ? extends Map.Entry<K,V>> reducer) {
5588 <            super(m);
5589 <            this.reducer = reducer;
5590 <        }
5591 <        ReduceEntriesTask
5592 <            (BulkTask<K,V,?> p, int b,
5520 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5521               ReduceEntriesTask<K,V> nextRight,
5522 <             BiFun<Map.Entry<K,V>, Map.Entry<K,V>, ? extends Map.Entry<K,V>> reducer) {
5523 <            super(p, b); this.nextRight = nextRight;
5522 >             BiFun<Entry<K,V>, Map.Entry<K,V>, ? extends Map.Entry<K,V>> reducer) {
5523 >            super(m, p, b); this.nextRight = nextRight;
5524              this.reducer = reducer;
5525          }
5598
5526          @SuppressWarnings("unchecked") public final boolean exec() {
5527              final BiFun<Map.Entry<K,V>, Map.Entry<K,V>, ? extends Map.Entry<K,V>> reducer =
5528                  this.reducer;
# Line 5605 | Line 5532 | public class ConcurrentHashMapV8<K, V>
5532                  for (int c, b = batch(); b > 1 && baseIndex != baseLimit;) {
5533                      do {} while (!casPending(c = pending, c+1));
5534                      (rights = new ReduceEntriesTask<K,V>
5535 <                     (this, b >>>= 1, rights, reducer)).fork();
5535 >                     (map, this, b >>>= 1, rights, reducer)).fork();
5536                  }
5537                  Map.Entry<K,V> r = null;
5538                  Object v;
# Line 5619 | Line 5546 | public class ConcurrentHashMapV8<K, V>
5546                      if ((c = t.pending) == 0) {
5547                          for (s = t.rights; s != null; s = t.rights = s.nextRight) {
5548                              if ((sr = s.result) != null)
5549 <                                t.result = (tr = t.result) == null? sr : reducer.apply(tr, sr);
5549 >                                t.result = ((tr = t.result) == null) ? sr : reducer.apply(tr, sr);
5550                          }
5551                          if ((par = t.parent) == null ||
5552                              !(par instanceof ReduceEntriesTask)) {
# Line 5646 | Line 5573 | public class ConcurrentHashMapV8<K, V>
5573          U result;
5574          MapReduceKeysTask<K,V,U> rights, nextRight;
5575          MapReduceKeysTask
5576 <            (ConcurrentHashMapV8<K,V> m,
5650 <             Fun<? super K, ? extends U> transformer,
5651 <             BiFun<? super U, ? super U, ? extends U> reducer) {
5652 <            super(m);
5653 <            this.transformer = transformer;
5654 <            this.reducer = reducer;
5655 <        }
5656 <        MapReduceKeysTask
5657 <            (BulkTask<K,V,?> p, int b,
5576 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5577               MapReduceKeysTask<K,V,U> nextRight,
5578               Fun<? super K, ? extends U> transformer,
5579               BiFun<? super U, ? super U, ? extends U> reducer) {
5580 <            super(p, b); this.nextRight = nextRight;
5580 >            super(m, p, b); this.nextRight = nextRight;
5581              this.transformer = transformer;
5582              this.reducer = reducer;
5583          }
# Line 5673 | Line 5592 | public class ConcurrentHashMapV8<K, V>
5592                  for (int c, b = batch(); b > 1 && baseIndex != baseLimit;) {
5593                      do {} while (!casPending(c = pending, c+1));
5594                      (rights = new MapReduceKeysTask<K,V,U>
5595 <                     (this, b >>>= 1, rights, transformer, reducer)).fork();
5595 >                     (map, this, b >>>= 1, rights, transformer, reducer)).fork();
5596                  }
5597                  U r = null, u;
5598                  while (advance() != null) {
# Line 5686 | Line 5605 | public class ConcurrentHashMapV8<K, V>
5605                      if ((c = t.pending) == 0) {
5606                          for (s = t.rights; s != null; s = t.rights = s.nextRight) {
5607                              if ((sr = s.result) != null)
5608 <                                t.result = (tr = t.result) == null? sr : reducer.apply(tr, sr);
5608 >                                t.result = ((tr = t.result) == null) ? sr : reducer.apply(tr, sr);
5609                          }
5610                          if ((par = t.parent) == null ||
5611                              !(par instanceof MapReduceKeysTask)) {
# Line 5713 | Line 5632 | public class ConcurrentHashMapV8<K, V>
5632          U result;
5633          MapReduceValuesTask<K,V,U> rights, nextRight;
5634          MapReduceValuesTask
5635 <            (ConcurrentHashMapV8<K,V> m,
5717 <             Fun<? super V, ? extends U> transformer,
5718 <             BiFun<? super U, ? super U, ? extends U> reducer) {
5719 <            super(m);
5720 <            this.transformer = transformer;
5721 <            this.reducer = reducer;
5722 <        }
5723 <        MapReduceValuesTask
5724 <            (BulkTask<K,V,?> p, int b,
5635 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5636               MapReduceValuesTask<K,V,U> nextRight,
5637               Fun<? super V, ? extends U> transformer,
5638               BiFun<? super U, ? super U, ? extends U> reducer) {
5639 <            super(p, b); this.nextRight = nextRight;
5639 >            super(m, p, b); this.nextRight = nextRight;
5640              this.transformer = transformer;
5641              this.reducer = reducer;
5642          }
# Line 5740 | Line 5651 | public class ConcurrentHashMapV8<K, V>
5651                  for (int c, b = batch(); b > 1 && baseIndex != baseLimit;) {
5652                      do {} while (!casPending(c = pending, c+1));
5653                      (rights = new MapReduceValuesTask<K,V,U>
5654 <                     (this, b >>>= 1, rights, transformer, reducer)).fork();
5654 >                     (map, this, b >>>= 1, rights, transformer, reducer)).fork();
5655                  }
5656                  U r = null, u;
5657                  Object v;
# Line 5754 | Line 5665 | public class ConcurrentHashMapV8<K, V>
5665                      if ((c = t.pending) == 0) {
5666                          for (s = t.rights; s != null; s = t.rights = s.nextRight) {
5667                              if ((sr = s.result) != null)
5668 <                                t.result = (tr = t.result) == null? sr : reducer.apply(tr, sr);
5668 >                                t.result = ((tr = t.result) == null) ? sr : reducer.apply(tr, sr);
5669                          }
5670                          if ((par = t.parent) == null ||
5671                              !(par instanceof MapReduceValuesTask)) {
# Line 5781 | Line 5692 | public class ConcurrentHashMapV8<K, V>
5692          U result;
5693          MapReduceEntriesTask<K,V,U> rights, nextRight;
5694          MapReduceEntriesTask
5695 <            (ConcurrentHashMapV8<K,V> m,
5785 <             Fun<Map.Entry<K,V>, ? extends U> transformer,
5786 <             BiFun<? super U, ? super U, ? extends U> reducer) {
5787 <            super(m);
5788 <            this.transformer = transformer;
5789 <            this.reducer = reducer;
5790 <        }
5791 <        MapReduceEntriesTask
5792 <            (BulkTask<K,V,?> p, int b,
5695 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5696               MapReduceEntriesTask<K,V,U> nextRight,
5697               Fun<Map.Entry<K,V>, ? extends U> transformer,
5698               BiFun<? super U, ? super U, ? extends U> reducer) {
5699 <            super(p, b); this.nextRight = nextRight;
5699 >            super(m, p, b); this.nextRight = nextRight;
5700              this.transformer = transformer;
5701              this.reducer = reducer;
5702          }
# Line 5808 | Line 5711 | public class ConcurrentHashMapV8<K, V>
5711                  for (int c, b = batch(); b > 1 && baseIndex != baseLimit;) {
5712                      do {} while (!casPending(c = pending, c+1));
5713                      (rights = new MapReduceEntriesTask<K,V,U>
5714 <                     (this, b >>>= 1, rights, transformer, reducer)).fork();
5714 >                     (map, this, b >>>= 1, rights, transformer, reducer)).fork();
5715                  }
5716                  U r = null, u;
5717                  Object v;
# Line 5822 | Line 5725 | public class ConcurrentHashMapV8<K, V>
5725                      if ((c = t.pending) == 0) {
5726                          for (s = t.rights; s != null; s = t.rights = s.nextRight) {
5727                              if ((sr = s.result) != null)
5728 <                                t.result = (tr = t.result) == null? sr : reducer.apply(tr, sr);
5728 >                                t.result = ((tr = t.result) == null) ? sr : reducer.apply(tr, sr);
5729                          }
5730                          if ((par = t.parent) == null ||
5731                              !(par instanceof MapReduceEntriesTask)) {
# Line 5849 | Line 5752 | public class ConcurrentHashMapV8<K, V>
5752          U result;
5753          MapReduceMappingsTask<K,V,U> rights, nextRight;
5754          MapReduceMappingsTask
5755 <            (ConcurrentHashMapV8<K,V> m,
5853 <             BiFun<? super K, ? super V, ? extends U> transformer,
5854 <             BiFun<? super U, ? super U, ? extends U> reducer) {
5855 <            super(m);
5856 <            this.transformer = transformer;
5857 <            this.reducer = reducer;
5858 <        }
5859 <        MapReduceMappingsTask
5860 <            (BulkTask<K,V,?> p, int b,
5755 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5756               MapReduceMappingsTask<K,V,U> nextRight,
5757               BiFun<? super K, ? super V, ? extends U> transformer,
5758               BiFun<? super U, ? super U, ? extends U> reducer) {
5759 <            super(p, b); this.nextRight = nextRight;
5759 >            super(m, p, b); this.nextRight = nextRight;
5760              this.transformer = transformer;
5761              this.reducer = reducer;
5762          }
# Line 5876 | Line 5771 | public class ConcurrentHashMapV8<K, V>
5771                  for (int c, b = batch(); b > 1 && baseIndex != baseLimit;) {
5772                      do {} while (!casPending(c = pending, c+1));
5773                      (rights = new MapReduceMappingsTask<K,V,U>
5774 <                     (this, b >>>= 1, rights, transformer, reducer)).fork();
5774 >                     (map, this, b >>>= 1, rights, transformer, reducer)).fork();
5775                  }
5776                  U r = null, u;
5777                  Object v;
# Line 5890 | Line 5785 | public class ConcurrentHashMapV8<K, V>
5785                      if ((c = t.pending) == 0) {
5786                          for (s = t.rights; s != null; s = t.rights = s.nextRight) {
5787                              if ((sr = s.result) != null)
5788 <                                t.result = (tr = t.result) == null? sr : reducer.apply(tr, sr);
5788 >                                t.result = ((tr = t.result) == null) ? sr : reducer.apply(tr, sr);
5789                          }
5790                          if ((par = t.parent) == null ||
5791                              !(par instanceof MapReduceMappingsTask)) {
# Line 5918 | Line 5813 | public class ConcurrentHashMapV8<K, V>
5813          double result;
5814          MapReduceKeysToDoubleTask<K,V> rights, nextRight;
5815          MapReduceKeysToDoubleTask
5816 <            (ConcurrentHashMapV8<K,V> m,
5922 <             ObjectToDouble<? super K> transformer,
5923 <             double basis,
5924 <             DoubleByDoubleToDouble reducer) {
5925 <            super(m);
5926 <            this.transformer = transformer;
5927 <            this.basis = basis; this.reducer = reducer;
5928 <        }
5929 <        MapReduceKeysToDoubleTask
5930 <            (BulkTask<K,V,?> p, int b,
5816 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5817               MapReduceKeysToDoubleTask<K,V> nextRight,
5818               ObjectToDouble<? super K> transformer,
5819               double basis,
5820               DoubleByDoubleToDouble reducer) {
5821 <            super(p, b); this.nextRight = nextRight;
5821 >            super(m, p, b); this.nextRight = nextRight;
5822              this.transformer = transformer;
5823              this.basis = basis; this.reducer = reducer;
5824          }
# Line 5947 | Line 5833 | public class ConcurrentHashMapV8<K, V>
5833                  for (int c, b = batch(); b > 1 && baseIndex != baseLimit;) {
5834                      do {} while (!casPending(c = pending, c+1));
5835                      (rights = new MapReduceKeysToDoubleTask<K,V>
5836 <                     (this, b >>>= 1, rights, transformer, id, reducer)).fork();
5836 >                     (map, this, b >>>= 1, rights, transformer, id, reducer)).fork();
5837                  }
5838                  double r = id;
5839                  while (advance() != null)
# Line 5985 | Line 5871 | public class ConcurrentHashMapV8<K, V>
5871          double result;
5872          MapReduceValuesToDoubleTask<K,V> rights, nextRight;
5873          MapReduceValuesToDoubleTask
5874 <            (ConcurrentHashMapV8<K,V> m,
5989 <             ObjectToDouble<? super V> transformer,
5990 <             double basis,
5991 <             DoubleByDoubleToDouble reducer) {
5992 <            super(m);
5993 <            this.transformer = transformer;
5994 <            this.basis = basis; this.reducer = reducer;
5995 <        }
5996 <        MapReduceValuesToDoubleTask
5997 <            (BulkTask<K,V,?> p, int b,
5874 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5875               MapReduceValuesToDoubleTask<K,V> nextRight,
5876               ObjectToDouble<? super V> transformer,
5877               double basis,
5878               DoubleByDoubleToDouble reducer) {
5879 <            super(p, b); this.nextRight = nextRight;
5879 >            super(m, p, b); this.nextRight = nextRight;
5880              this.transformer = transformer;
5881              this.basis = basis; this.reducer = reducer;
5882          }
# Line 6014 | Line 5891 | public class ConcurrentHashMapV8<K, V>
5891                  for (int c, b = batch(); b > 1 && baseIndex != baseLimit;) {
5892                      do {} while (!casPending(c = pending, c+1));
5893                      (rights = new MapReduceValuesToDoubleTask<K,V>
5894 <                     (this, b >>>= 1, rights, transformer, id, reducer)).fork();
5894 >                     (map, this, b >>>= 1, rights, transformer, id, reducer)).fork();
5895                  }
5896                  double r = id;
5897                  Object v;
# Line 6053 | Line 5930 | public class ConcurrentHashMapV8<K, V>
5930          double result;
5931          MapReduceEntriesToDoubleTask<K,V> rights, nextRight;
5932          MapReduceEntriesToDoubleTask
5933 <            (ConcurrentHashMapV8<K,V> m,
6057 <             ObjectToDouble<Map.Entry<K,V>> transformer,
6058 <             double basis,
6059 <             DoubleByDoubleToDouble reducer) {
6060 <            super(m);
6061 <            this.transformer = transformer;
6062 <            this.basis = basis; this.reducer = reducer;
6063 <        }
6064 <        MapReduceEntriesToDoubleTask
6065 <            (BulkTask<K,V,?> p, int b,
5933 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5934               MapReduceEntriesToDoubleTask<K,V> nextRight,
5935               ObjectToDouble<Map.Entry<K,V>> transformer,
5936               double basis,
5937               DoubleByDoubleToDouble reducer) {
5938 <            super(p, b); this.nextRight = nextRight;
5938 >            super(m, p, b); this.nextRight = nextRight;
5939              this.transformer = transformer;
5940              this.basis = basis; this.reducer = reducer;
5941          }
# Line 6082 | Line 5950 | public class ConcurrentHashMapV8<K, V>
5950                  for (int c, b = batch(); b > 1 && baseIndex != baseLimit;) {
5951                      do {} while (!casPending(c = pending, c+1));
5952                      (rights = new MapReduceEntriesToDoubleTask<K,V>
5953 <                     (this, b >>>= 1, rights, transformer, id, reducer)).fork();
5953 >                     (map, this, b >>>= 1, rights, transformer, id, reducer)).fork();
5954                  }
5955                  double r = id;
5956                  Object v;
# Line 6121 | Line 5989 | public class ConcurrentHashMapV8<K, V>
5989          double result;
5990          MapReduceMappingsToDoubleTask<K,V> rights, nextRight;
5991          MapReduceMappingsToDoubleTask
5992 <            (ConcurrentHashMapV8<K,V> m,
6125 <             ObjectByObjectToDouble<? super K, ? super V> transformer,
6126 <             double basis,
6127 <             DoubleByDoubleToDouble reducer) {
6128 <            super(m);
6129 <            this.transformer = transformer;
6130 <            this.basis = basis; this.reducer = reducer;
6131 <        }
6132 <        MapReduceMappingsToDoubleTask
6133 <            (BulkTask<K,V,?> p, int b,
5992 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
5993               MapReduceMappingsToDoubleTask<K,V> nextRight,
5994               ObjectByObjectToDouble<? super K, ? super V> transformer,
5995               double basis,
5996               DoubleByDoubleToDouble reducer) {
5997 <            super(p, b); this.nextRight = nextRight;
5997 >            super(m, p, b); this.nextRight = nextRight;
5998              this.transformer = transformer;
5999              this.basis = basis; this.reducer = reducer;
6000          }
# Line 6150 | Line 6009 | public class ConcurrentHashMapV8<K, V>
6009                  for (int c, b = batch(); b > 1 && baseIndex != baseLimit;) {
6010                      do {} while (!casPending(c = pending, c+1));
6011                      (rights = new MapReduceMappingsToDoubleTask<K,V>
6012 <                     (this, b >>>= 1, rights, transformer, id, reducer)).fork();
6012 >                     (map, this, b >>>= 1, rights, transformer, id, reducer)).fork();
6013                  }
6014                  double r = id;
6015                  Object v;
# Line 6189 | Line 6048 | public class ConcurrentHashMapV8<K, V>
6048          long result;
6049          MapReduceKeysToLongTask<K,V> rights, nextRight;
6050          MapReduceKeysToLongTask
6051 <            (ConcurrentHashMapV8<K,V> m,
6193 <             ObjectToLong<? super K> transformer,
6194 <             long basis,
6195 <             LongByLongToLong reducer) {
6196 <            super(m);
6197 <            this.transformer = transformer;
6198 <            this.basis = basis; this.reducer = reducer;
6199 <        }
6200 <        MapReduceKeysToLongTask
6201 <            (BulkTask<K,V,?> p, int b,
6051 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
6052               MapReduceKeysToLongTask<K,V> nextRight,
6053               ObjectToLong<? super K> transformer,
6054               long basis,
6055               LongByLongToLong reducer) {
6056 <            super(p, b); this.nextRight = nextRight;
6056 >            super(m, p, b); this.nextRight = nextRight;
6057              this.transformer = transformer;
6058              this.basis = basis; this.reducer = reducer;
6059          }
# Line 6218 | Line 6068 | public class ConcurrentHashMapV8<K, V>
6068                  for (int c, b = batch(); b > 1 && baseIndex != baseLimit;) {
6069                      do {} while (!casPending(c = pending, c+1));
6070                      (rights = new MapReduceKeysToLongTask<K,V>
6071 <                     (this, b >>>= 1, rights, transformer, id, reducer)).fork();
6071 >                     (map, this, b >>>= 1, rights, transformer, id, reducer)).fork();
6072                  }
6073                  long r = id;
6074                  while (advance() != null)
# Line 6256 | Line 6106 | public class ConcurrentHashMapV8<K, V>
6106          long result;
6107          MapReduceValuesToLongTask<K,V> rights, nextRight;
6108          MapReduceValuesToLongTask
6109 <            (ConcurrentHashMapV8<K,V> m,
6260 <             ObjectToLong<? super V> transformer,
6261 <             long basis,
6262 <             LongByLongToLong reducer) {
6263 <            super(m);
6264 <            this.transformer = transformer;
6265 <            this.basis = basis; this.reducer = reducer;
6266 <        }
6267 <        MapReduceValuesToLongTask
6268 <            (BulkTask<K,V,?> p, int b,
6109 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
6110               MapReduceValuesToLongTask<K,V> nextRight,
6111               ObjectToLong<? super V> transformer,
6112               long basis,
6113               LongByLongToLong reducer) {
6114 <            super(p, b); this.nextRight = nextRight;
6114 >            super(m, p, b); this.nextRight = nextRight;
6115              this.transformer = transformer;
6116              this.basis = basis; this.reducer = reducer;
6117          }
# Line 6285 | Line 6126 | public class ConcurrentHashMapV8<K, V>
6126                  for (int c, b = batch(); b > 1 && baseIndex != baseLimit;) {
6127                      do {} while (!casPending(c = pending, c+1));
6128                      (rights = new MapReduceValuesToLongTask<K,V>
6129 <                     (this, b >>>= 1, rights, transformer, id, reducer)).fork();
6129 >                     (map, this, b >>>= 1, rights, transformer, id, reducer)).fork();
6130                  }
6131                  long r = id;
6132                  Object v;
# Line 6324 | Line 6165 | public class ConcurrentHashMapV8<K, V>
6165          long result;
6166          MapReduceEntriesToLongTask<K,V> rights, nextRight;
6167          MapReduceEntriesToLongTask
6168 <            (ConcurrentHashMapV8<K,V> m,
6328 <             ObjectToLong<Map.Entry<K,V>> transformer,
6329 <             long basis,
6330 <             LongByLongToLong reducer) {
6331 <            super(m);
6332 <            this.transformer = transformer;
6333 <            this.basis = basis; this.reducer = reducer;
6334 <        }
6335 <        MapReduceEntriesToLongTask
6336 <            (BulkTask<K,V,?> p, int b,
6168 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
6169               MapReduceEntriesToLongTask<K,V> nextRight,
6170               ObjectToLong<Map.Entry<K,V>> transformer,
6171               long basis,
6172               LongByLongToLong reducer) {
6173 <            super(p, b); this.nextRight = nextRight;
6173 >            super(m, p, b); this.nextRight = nextRight;
6174              this.transformer = transformer;
6175              this.basis = basis; this.reducer = reducer;
6176          }
# Line 6353 | Line 6185 | public class ConcurrentHashMapV8<K, V>
6185                  for (int c, b = batch(); b > 1 && baseIndex != baseLimit;) {
6186                      do {} while (!casPending(c = pending, c+1));
6187                      (rights = new MapReduceEntriesToLongTask<K,V>
6188 <                     (this, b >>>= 1, rights, transformer, id, reducer)).fork();
6188 >                     (map, this, b >>>= 1, rights, transformer, id, reducer)).fork();
6189                  }
6190                  long r = id;
6191                  Object v;
# Line 6392 | Line 6224 | public class ConcurrentHashMapV8<K, V>
6224          long result;
6225          MapReduceMappingsToLongTask<K,V> rights, nextRight;
6226          MapReduceMappingsToLongTask
6227 <            (ConcurrentHashMapV8<K,V> m,
6396 <             ObjectByObjectToLong<? super K, ? super V> transformer,
6397 <             long basis,
6398 <             LongByLongToLong reducer) {
6399 <            super(m);
6400 <            this.transformer = transformer;
6401 <            this.basis = basis; this.reducer = reducer;
6402 <        }
6403 <        MapReduceMappingsToLongTask
6404 <            (BulkTask<K,V,?> p, int b,
6227 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
6228               MapReduceMappingsToLongTask<K,V> nextRight,
6229               ObjectByObjectToLong<? super K, ? super V> transformer,
6230               long basis,
6231               LongByLongToLong reducer) {
6232 <            super(p, b); this.nextRight = nextRight;
6232 >            super(m, p, b); this.nextRight = nextRight;
6233              this.transformer = transformer;
6234              this.basis = basis; this.reducer = reducer;
6235          }
# Line 6421 | Line 6244 | public class ConcurrentHashMapV8<K, V>
6244                  for (int c, b = batch(); b > 1 && baseIndex != baseLimit;) {
6245                      do {} while (!casPending(c = pending, c+1));
6246                      (rights = new MapReduceMappingsToLongTask<K,V>
6247 <                     (this, b >>>= 1, rights, transformer, id, reducer)).fork();
6247 >                     (map, this, b >>>= 1, rights, transformer, id, reducer)).fork();
6248                  }
6249                  long r = id;
6250                  Object v;
# Line 6460 | Line 6283 | public class ConcurrentHashMapV8<K, V>
6283          int result;
6284          MapReduceKeysToIntTask<K,V> rights, nextRight;
6285          MapReduceKeysToIntTask
6286 <            (ConcurrentHashMapV8<K,V> m,
6464 <             ObjectToInt<? super K> transformer,
6465 <             int basis,
6466 <             IntByIntToInt reducer) {
6467 <            super(m);
6468 <            this.transformer = transformer;
6469 <            this.basis = basis; this.reducer = reducer;
6470 <        }
6471 <        MapReduceKeysToIntTask
6472 <            (BulkTask<K,V,?> p, int b,
6286 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
6287               MapReduceKeysToIntTask<K,V> nextRight,
6288               ObjectToInt<? super K> transformer,
6289               int basis,
6290               IntByIntToInt reducer) {
6291 <            super(p, b); this.nextRight = nextRight;
6291 >            super(m, p, b); this.nextRight = nextRight;
6292              this.transformer = transformer;
6293              this.basis = basis; this.reducer = reducer;
6294          }
# Line 6489 | Line 6303 | public class ConcurrentHashMapV8<K, V>
6303                  for (int c, b = batch(); b > 1 && baseIndex != baseLimit;) {
6304                      do {} while (!casPending(c = pending, c+1));
6305                      (rights = new MapReduceKeysToIntTask<K,V>
6306 <                     (this, b >>>= 1, rights, transformer, id, reducer)).fork();
6306 >                     (map, this, b >>>= 1, rights, transformer, id, reducer)).fork();
6307                  }
6308                  int r = id;
6309                  while (advance() != null)
# Line 6527 | Line 6341 | public class ConcurrentHashMapV8<K, V>
6341          int result;
6342          MapReduceValuesToIntTask<K,V> rights, nextRight;
6343          MapReduceValuesToIntTask
6344 <            (ConcurrentHashMapV8<K,V> m,
6531 <             ObjectToInt<? super V> transformer,
6532 <             int basis,
6533 <             IntByIntToInt reducer) {
6534 <            super(m);
6535 <            this.transformer = transformer;
6536 <            this.basis = basis; this.reducer = reducer;
6537 <        }
6538 <        MapReduceValuesToIntTask
6539 <            (BulkTask<K,V,?> p, int b,
6344 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
6345               MapReduceValuesToIntTask<K,V> nextRight,
6346               ObjectToInt<? super V> transformer,
6347               int basis,
6348               IntByIntToInt reducer) {
6349 <            super(p, b); this.nextRight = nextRight;
6349 >            super(m, p, b); this.nextRight = nextRight;
6350              this.transformer = transformer;
6351              this.basis = basis; this.reducer = reducer;
6352          }
# Line 6556 | Line 6361 | public class ConcurrentHashMapV8<K, V>
6361                  for (int c, b = batch(); b > 1 && baseIndex != baseLimit;) {
6362                      do {} while (!casPending(c = pending, c+1));
6363                      (rights = new MapReduceValuesToIntTask<K,V>
6364 <                     (this, b >>>= 1, rights, transformer, id, reducer)).fork();
6364 >                     (map, this, b >>>= 1, rights, transformer, id, reducer)).fork();
6365                  }
6366                  int r = id;
6367                  Object v;
# Line 6595 | Line 6400 | public class ConcurrentHashMapV8<K, V>
6400          int result;
6401          MapReduceEntriesToIntTask<K,V> rights, nextRight;
6402          MapReduceEntriesToIntTask
6403 <            (ConcurrentHashMapV8<K,V> m,
6599 <             ObjectToInt<Map.Entry<K,V>> transformer,
6600 <             int basis,
6601 <             IntByIntToInt reducer) {
6602 <            super(m);
6603 <            this.transformer = transformer;
6604 <            this.basis = basis; this.reducer = reducer;
6605 <        }
6606 <        MapReduceEntriesToIntTask
6607 <            (BulkTask<K,V,?> p, int b,
6403 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
6404               MapReduceEntriesToIntTask<K,V> nextRight,
6405               ObjectToInt<Map.Entry<K,V>> transformer,
6406               int basis,
6407               IntByIntToInt reducer) {
6408 <            super(p, b); this.nextRight = nextRight;
6408 >            super(m, p, b); this.nextRight = nextRight;
6409              this.transformer = transformer;
6410              this.basis = basis; this.reducer = reducer;
6411          }
# Line 6624 | Line 6420 | public class ConcurrentHashMapV8<K, V>
6420                  for (int c, b = batch(); b > 1 && baseIndex != baseLimit;) {
6421                      do {} while (!casPending(c = pending, c+1));
6422                      (rights = new MapReduceEntriesToIntTask<K,V>
6423 <                     (this, b >>>= 1, rights, transformer, id, reducer)).fork();
6423 >                     (map, this, b >>>= 1, rights, transformer, id, reducer)).fork();
6424                  }
6425                  int r = id;
6426                  Object v;
# Line 6663 | Line 6459 | public class ConcurrentHashMapV8<K, V>
6459          int result;
6460          MapReduceMappingsToIntTask<K,V> rights, nextRight;
6461          MapReduceMappingsToIntTask
6462 <            (ConcurrentHashMapV8<K,V> m,
6463 <             ObjectByObjectToInt<? super K, ? super V> transformer,
6668 <             int basis,
6669 <             IntByIntToInt reducer) {
6670 <            super(m);
6671 <            this.transformer = transformer;
6672 <            this.basis = basis; this.reducer = reducer;
6673 <        }
6674 <        MapReduceMappingsToIntTask
6675 <            (BulkTask<K,V,?> p, int b,
6676 <             MapReduceMappingsToIntTask<K,V> nextRight,
6462 >            (ConcurrentHashMapV8<K,V> m, BulkTask<K,V,?> p, int b,
6463 >             MapReduceMappingsToIntTask<K,V> rights,
6464               ObjectByObjectToInt<? super K, ? super V> transformer,
6465               int basis,
6466               IntByIntToInt reducer) {
6467 <            super(p, b); this.nextRight = nextRight;
6467 >            super(m, p, b); this.nextRight = nextRight;
6468              this.transformer = transformer;
6469              this.basis = basis; this.reducer = reducer;
6470          }
# Line 6692 | Line 6479 | public class ConcurrentHashMapV8<K, V>
6479                  for (int c, b = batch(); b > 1 && baseIndex != baseLimit;) {
6480                      do {} while (!casPending(c = pending, c+1));
6481                      (rights = new MapReduceMappingsToIntTask<K,V>
6482 <                     (this, b >>>= 1, rights, transformer, id, reducer)).fork();
6482 >                     (map, this, b >>>= 1, rights, transformer, id, reducer)).fork();
6483                  }
6484                  int r = id;
6485                  Object v;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines