summaryrefslogtreecommitdiff
path: root/src/reflect/scala/reflect/internal/Importers.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2012-08-16 19:56:06 +0200
committerGrzegorz Kossakowski <grzegorz.kossakowski@gmail.com>2012-08-20 08:11:05 +0100
commit0cde930b192acc73d1e0b5951b3300c286ae4dd2 (patch)
tree48d0274392819371692ccdaea366f1fe2c62a25e /src/reflect/scala/reflect/internal/Importers.scala
parentae13d592dc8c6ce5ae70b0d07e7af4275356df9a (diff)
downloadscala-0cde930b192acc73d1e0b5951b3300c286ae4dd2.tar.gz
scala-0cde930b192acc73d1e0b5951b3300c286ae4dd2.tar.bz2
scala-0cde930b192acc73d1e0b5951b3300c286ae4dd2.zip
Made hashCode a method on Type to avoid megamorphic dispatch
profiling data shows that accessing the hashCode field has a cost of about 10% of fully hot running times. We speculate that it's megamorphic dispatch which is costing us this much. Rewrote code so that UniqueType is not an abstract base class with the hashCode field. Also removed fingerPrinting bloom filter on findMember because it caused complexity and did not gain us anything accdoring to the tests. Made TypeVar an abstract case class to avoid extractor calls in TypeMap.
Diffstat (limited to 'src/reflect/scala/reflect/internal/Importers.scala')
-rw-r--r--src/reflect/scala/reflect/internal/Importers.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/reflect/scala/reflect/internal/Importers.scala b/src/reflect/scala/reflect/internal/Importers.scala
index 25441f9812..d5baad8ab1 100644
--- a/src/reflect/scala/reflect/internal/Importers.scala
+++ b/src/reflect/scala/reflect/internal/Importers.scala
@@ -238,7 +238,7 @@ trait Importers { self: SymbolTable =>
case from.AntiPolyType(pre, targs) =>
AntiPolyType(importType(pre), targs map importType)
case x: from.TypeVar =>
- TypeVar(importType(x.origin), importTypeConstraint(x.constr0), x.typeArgs map importType, x.params map importSymbol)
+ TypeVar(importType(x.origin), importTypeConstraint(x.constr), x.typeArgs map importType, x.params map importSymbol)
case from.NotNullType(tpe) =>
NotNullType(importType(tpe))
case from.AnnotatedType(annots, tpe, selfsym) =>
@@ -448,4 +448,4 @@ trait Importers { self: SymbolTable =>
case _ => constant.value
})
}
-} \ No newline at end of file
+}