summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBurak Emir <emir@epfl.ch>2007-07-08 12:13:47 +0000
committerBurak Emir <emir@epfl.ch>2007-07-08 12:13:47 +0000
commit2ad1a3c21860cf0feb1068da25d003aa56198d84 (patch)
tree737b7e9aab2a809c6e207485d9556c49f257be3b
parenta9f599f975af8dc5b0a979f1a20faf31f1f0d76e (diff)
downloadscala-2ad1a3c21860cf0feb1068da25d003aa56198d84.tar.gz
scala-2ad1a3c21860cf0feb1068da25d003aa56198d84.tar.bz2
scala-2ad1a3c21860cf0feb1068da25d003aa56198d84.zip
fixed undetermined problem causing very slow co...
fixed undetermined problem causing very slow compilation
-rw-r--r--src/compiler/scala/tools/nsc/matching/ParallelMatching.scala41
1 files changed, 20 insertions, 21 deletions
diff --git a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala
index 7599c2af8c..8fdb3deb9c 100644
--- a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala
+++ b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala
@@ -78,29 +78,30 @@ trait ParallelMatching {
}
}
//def containsUnapply = column exists { _.isInstanceOf[UnApply] }
+ /*
if(settings_debug) {
Console.println("/// MixtureRule("+scrutinee.name+":"+scrutinee.tpe+","+column+", rep = ")
Console.println(rest)
Console.println(")///")
}
+ */
if(isSimpleIntSwitch) {
- if(settings_debug) { Console.println("MixLiteral") }
+ //if(settings_debug) { Console.println("MixLiteral") }
return new MixLiterals(scrutinee, column, rest)
}
- if(false && (column.length > 1) && isFlatCases(column)) {
- if(settings_debug) {
- Console.println("flat cases!"+column)
- Console.println(scrutinee.tpe.symbol.children)
- Console.println(scrutinee.tpe.member(nme.tag))
- Console.println(column.map { x => x.tpe.symbol.tag })
- }
- return new MixCases(scrutinee, column, rest)
- /*if(scrutinee.tpe.symbol.hasFlag(symtab.Flags.SEALED))
- new MixCasesSealed(scrutinee, column, rest)
- else
- new MixCases(scrutinee, column, rest) */
-
+ /*
+ if((column.length > 1) && isFlatCases(column)) {
+ if(settings_debug) {
+ Console.println("flat cases!"+column)
+ Console.println(scrutinee.tpe.symbol.children)
+ Console.println(scrutinee.tpe.member(nme.tag))
+ Console.println(column.map { x => x.tpe.symbol.tag })
+ }
+ return new MixCases(scrutinee, column, rest)
+ // if(scrutinee.tpe.symbol.hasFlag(symtab.Flags.SEALED)) new MixCasesSealed(scrutinee, column, rest)
+ // else new MixCases(scrutinee, column, rest)
}
+ */
//Console.println("isUnapplyHead")
if(isUnapplyHead) {
if(settings_debug) { Console.println("MixUnapply") }
@@ -136,8 +137,9 @@ trait ParallelMatching {
var tagIndexPairs: TagIndexPair = null
- protected def grabTemps: List[Symbol]
- protected def grabRow(index:Int): (List[Tree], List[(Symbol,Symbol)], Tree, Tree)
+ protected def grabTemps: List[Symbol] = rest.temp
+ protected def grabRow(index:Int): (List[Tree], List[(Symbol,Symbol)], Tree, Tree) = rest.row(tagIndexPairs.index)
+
/** inserts row indices using in to list of tagindexpairs*/
protected def tagIndicesToReps = {
@@ -214,8 +216,8 @@ trait ParallelMatching {
}
}
- def grabTemps = scrutinee::rest.temp
- def grabRow(index:Int) = rest.row(tagIndexPairs.index) match {
+ override def grabTemps = scrutinee::rest.temp
+ override def grabRow(index:Int) = rest.row(tagIndexPairs.index) match {
case (pats,s,g,b) => (column(tagIndexPairs.index)::pats,s,g,b)
}
@@ -267,9 +269,6 @@ trait ParallelMatching {
}
}
- def grabTemps = rest.temp
- def grabRow(index:Int) = rest.row(tagIndexPairs.index)
-
}
/**