summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/ConstantFolder.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2009-11-09 22:03:12 +0000
committerPaul Phillips <paulp@improving.org>2009-11-09 22:03:12 +0000
commita0159da70da18f65863947aa4d016ca52fd7bb4f (patch)
tree916acfd275d3c0bf3c59aa9d599fed37162c2c9a /src/compiler/scala/tools/nsc/typechecker/ConstantFolder.scala
parent26a13165f4a00ce8c0336058fbde937ddb59e718 (diff)
downloadscala-a0159da70da18f65863947aa4d016ca52fd7bb4f.tar.gz
scala-a0159da70da18f65863947aa4d016ca52fd7bb4f.tar.bz2
scala-a0159da70da18f65863947aa4d016ca52fd7bb4f.zip
Breaks down the hash function in BoxesRunTime b...
Breaks down the hash function in BoxesRunTime by type so we can do as much as possible at compile time. Documents various trouble points I've identified with trying to get the hashCodes aligned. Test case exercises the hashCode functions. Deleted all the code associated with previous equality adventures. Don't worry, I can put anything back if it turns out we have to change course again, but for now it's noise. Also, gives return types to the box and unbox methods which are added to the primitive companions, so e.g. Int.box(5) now returns a j.l.Integer instead of an Object.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/ConstantFolder.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/ConstantFolder.scala6
1 files changed, 0 insertions, 6 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/ConstantFolder.scala b/src/compiler/scala/tools/nsc/typechecker/ConstantFolder.scala
index e8bb4581f1..ba328b9f48 100644
--- a/src/compiler/scala/tools/nsc/typechecker/ConstantFolder.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/ConstantFolder.scala
@@ -152,12 +152,6 @@ abstract class ConstantFolder {
}
private def foldBinop(op: Name, x: Constant, y: Constant): Constant = {
- // temporarily logging folded ==/!= so the log doesn't have unexplained absences
- // Careful, these four lines added 3 minutes to the time to compile this file under -optimise
- // if ((op == nme.EQ || op == nme.NE) && x.tag != y.tag && settings.logEqEq.value) {
- // val opstr = if (op == nme.EQ) "==" else "!="
- // scala.runtime.Equality.log("Folding constant expression (%s %s %s)".format(x.value, opstr, y.value))
- // }
val optag =
if (x.tag == y.tag) x.tag
else if (isNumeric(x.tag) && isNumeric(y.tag)) Math.max(x.tag, y.tag)