Skip to content

Commit e2a2cba

Browse files
authored
Merge pull request scala#5603 from szeiger/wip/modularize-parallel-collections
[ci:last-only] Remove parallel collections from scala-library
2 parents ef63cb9 + d205a63 commit e2a2cba

File tree

153 files changed

+215
-13016
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+215
-13016
lines changed

src/compiler/scala/tools/nsc/backend/jvm/AsmUtils.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ object AsmUtils {
9292
node
9393
}
9494

95-
def main(args: Array[String]): Unit = args.par.foreach { classFileName =>
95+
def main(args: Array[String]): Unit = args /*.par*/.foreach { classFileName =>
9696
val node = zapScalaClassAttrs(sortClassMembers(classFromBytes(classBytes(classFileName))))
9797

9898
val pw = new PrintWriter(classFileName + ".asm")

src/library/scala/collection/CustomParallelizable.scala

-18
This file was deleted.

src/library/scala/collection/GenMapLike.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ package collection
2222
* A map is a collection of bindings from keys to values, where there are
2323
* no duplicate keys.
2424
*/
25-
trait GenMapLike[K, +V, +Repr] extends GenIterableLike[(K, V), Repr] with Equals with Parallelizable[(K, V), parallel.ParMap[K, V]] {
25+
trait GenMapLike[K, +V, +Repr] extends GenIterableLike[(K, V), Repr] with Equals {
2626
def default(key: K): V
2727
def get(key: K): Option[V]
2828
def apply(key: K): V

src/library/scala/collection/GenSeqLike.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import generic._
3030
* Sequences are special cases of iterable collections of class `Iterable`.
3131
* Unlike iterables, sequences always have a defined order of elements.
3232
*/
33-
trait GenSeqLike[+A, +Repr] extends Any with GenIterableLike[A, Repr] with Equals with Parallelizable[A, parallel.ParSeq[A]] {
33+
trait GenSeqLike[+A, +Repr] extends Any with GenIterableLike[A, Repr] with Equals {
3434
def seq: Seq[A]
3535

3636
/** Selects an element by its index in the $coll.

src/library/scala/collection/GenSetLike.scala

+1-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ package collection
2525
trait GenSetLike[A, +Repr]
2626
extends GenIterableLike[A, Repr]
2727
with (A => Boolean)
28-
with Equals
29-
with Parallelizable[A, parallel.ParSet[A]] {
28+
with Equals {
3029

3130
def iterator: Iterator[A]
3231
def contains(elem: A): Boolean

src/library/scala/collection/GenTraversableLike.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ import scala.annotation.migration
5454
* @author Aleksandar Prokopec
5555
* @since 2.9
5656
*/
57-
trait GenTraversableLike[+A, +Repr] extends Any with GenTraversableOnce[A] with Parallelizable[A, parallel.ParIterable[A]] {
57+
trait GenTraversableLike[+A, +Repr] extends Any with GenTraversableOnce[A] {
5858

5959
def repr: Repr
6060

src/library/scala/collection/MapLike.scala

-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ package collection
1212
import generic._
1313
import mutable.{ Builder, MapBuilder }
1414
import scala.annotation.migration
15-
import parallel.ParMap
1615

1716
/** A template trait for maps, which associate keys with values.
1817
*
@@ -59,7 +58,6 @@ trait MapLike[K, +V, +This <: MapLike[K, V, This] with Map[K, V]]
5958
with IterableLike[(K, V), This]
6059
with GenMapLike[K, V, This]
6160
with Subtractable[K, This]
62-
with Parallelizable[(K, V), ParMap[K, V]]
6361
{
6462
self =>
6563

@@ -344,8 +342,6 @@ self =>
344342
result
345343
}
346344

347-
protected[this] override def parCombiner = ParMap.newCombiner[K, V]
348-
349345
/** Appends all bindings of this map to a string builder using start, end, and separator strings.
350346
* The written text begins with the string `start` and ends with the string
351347
* `end`. Inside, the string representations of all bindings of this map

src/library/scala/collection/Parallelizable.scala

-53
This file was deleted.

src/library/scala/collection/SeqLike.scala

+1-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ package collection
1111

1212
import immutable.{ List, Range }
1313
import generic._
14-
import parallel.ParSeq
1514
import scala.math.Ordering
1615

1716
/** A template trait for sequences of type `Seq[A]`
@@ -58,7 +57,7 @@ import scala.math.Ordering
5857
* @define orderDependent
5958
* @define orderDependentFold
6059
*/
61-
trait SeqLike[+A, +Repr] extends Any with IterableLike[A, Repr] with GenSeqLike[A, Repr] with Parallelizable[A, ParSeq[A]] { self =>
60+
trait SeqLike[+A, +Repr] extends Any with IterableLike[A, Repr] with GenSeqLike[A, Repr] { self =>
6261

6362
override protected[this] def thisCollection: Seq[A] = this.asInstanceOf[Seq[A]]
6463
override protected[this] def toCollection(repr: Repr): Seq[A] = repr.asInstanceOf[Seq[A]]
@@ -67,8 +66,6 @@ trait SeqLike[+A, +Repr] extends Any with IterableLike[A, Repr] with GenSeqLike[
6766

6867
def apply(idx: Int): A
6968

70-
protected[this] override def parCombiner = ParSeq.newCombiner[A]
71-
7269
/** Compares the length of this $coll to a test value.
7370
*
7471
* @param len the test value that gets compared with the length.

src/library/scala/collection/SetLike.scala

-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ package collection
1212
import generic._
1313
import mutable.{ Builder, SetBuilder }
1414
import scala.annotation.migration
15-
import parallel.ParSet
1615

1716
/** A template trait for sets.
1817
*
@@ -59,7 +58,6 @@ trait SetLike[A, +This <: SetLike[A, This] with Set[A]]
5958
extends IterableLike[A, This]
6059
with GenSetLike[A, This]
6160
with Subtractable[A, This]
62-
with Parallelizable[A, ParSet[A]]
6361
{
6462
self =>
6563

@@ -75,8 +73,6 @@ self =>
7573
*/
7674
override protected[this] def newBuilder: Builder[A, This] = new SetBuilder[A, This](empty)
7775

78-
protected[this] override def parCombiner = ParSet.newCombiner[A]
79-
8076
// Default collection type appropriate for immutable collections; mutable collections override this
8177
override def toSeq: Seq[A] = {
8278
if (isEmpty) Vector.empty[A]

src/library/scala/collection/TraversableLike.scala

-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import generic._
1313
import mutable.{ Builder }
1414
import scala.annotation.migration
1515
import scala.annotation.unchecked.{ uncheckedVariance => uV }
16-
import parallel.ParIterable
1716
import scala.language.higherKinds
1817

1918
/** A template trait for traversable collections of type `Traversable[A]`.
@@ -71,7 +70,6 @@ trait TraversableLike[+A, +Repr] extends Any
7170
with FilterMonadic[A, Repr]
7271
with TraversableOnce[A]
7372
with GenTraversableLike[A, Repr]
74-
with Parallelizable[A, ParIterable[A]]
7573
{
7674
self =>
7775

@@ -103,8 +101,6 @@ trait TraversableLike[+A, +Repr] extends Any
103101
*/
104102
protected[this] def newBuilder: Builder[A, Repr]
105103

106-
protected[this] def parCombiner = ParIterable.newCombiner[A]
107-
108104
/** Applies a function `f` to all elements of this $coll.
109105
*
110106
* @param f the function that is applied for its side-effect to every element.

src/library/scala/collection/concurrent/TrieMap.scala

-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ package collection
1111
package concurrent
1212

1313
import java.util.concurrent.atomic._
14-
import scala.collection.parallel.mutable.ParTrieMap
1514
import scala.util.hashing.Hashing
1615
import scala.util.control.ControlThrowable
1716
import generic._
@@ -631,7 +630,6 @@ private[concurrent] case class RDCSS_Descriptor[K, V](old: INode[K, V], expected
631630
final class TrieMap[K, V] private (r: AnyRef, rtupd: AtomicReferenceFieldUpdater[TrieMap[K, V], AnyRef], hashf: Hashing[K], ef: Equiv[K])
632631
extends scala.collection.concurrent.Map[K, V]
633632
with scala.collection.mutable.MapLike[K, V, TrieMap[K, V]]
634-
with CustomParallelizable[(K, V), ParTrieMap[K, V]]
635633
with Serializable
636634
{
637635
private var hashingobj = if (hashf.isInstanceOf[Hashing.Default[_]]) new TrieMap.MangledHashing[K] else hashf
@@ -777,8 +775,6 @@ extends scala.collection.concurrent.Map[K, V]
777775

778776
override def seq = this
779777

780-
override def par = new ParTrieMap(this)
781-
782778
override def empty: TrieMap[K, V] = new TrieMap[K, V]
783779

784780
def isReadOnly = rootupdater eq null

src/library/scala/collection/generic/CanCombineFrom.scala

-27
This file was deleted.

src/library/scala/collection/generic/GenericParCompanion.scala

-38
This file was deleted.

src/library/scala/collection/generic/GenericParTemplate.scala

-64
This file was deleted.

src/library/scala/collection/generic/HasNewCombiner.scala

-21
This file was deleted.

0 commit comments

Comments
 (0)