diff options
author | Martin Odersky <odersky@gmail.com> | 2014-01-26 10:13:11 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-01-26 18:52:33 +0100 |
commit | 8b1cc2270c67157f60111a853680fd4f20418d59 (patch) | |
tree | 8527e023059546f2a8dc80e14237e3fab0555d64 /src/dotty/tools/dotc/core/Types.scala | |
parent | b2dd6a8a67a70783e68da1f33c33f18c6641e5bb (diff) | |
download | dotty-8b1cc2270c67157f60111a853680fd4f20418d59.tar.gz dotty-8b1cc2270c67157f60111a853680fd4f20418d59.tar.bz2 dotty-8b1cc2270c67157f60111a853680fd4f20418d59.zip |
Some more statistic sampling
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Types.scala | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index 0627608cd..197c1ec97 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -16,7 +16,7 @@ import Decorators._ import Denotations._ import Periods._ import util.Positions.Position -import util.Stats.track +import util.Stats._ import util.SimpleMap import ast.tpd._, printing.Texts._ import ast.untpd @@ -956,8 +956,14 @@ object Types { trait CachedType extends Type def unique[T <: Type](tp: T)(implicit ctx: Context): T = { - if (tp.hash == NotCached) tp - else ctx.uniques.findEntryOrUpdate(tp).asInstanceOf[T] + if (tp.hash == NotCached) { + record("uncached-types") + tp + } + else { + record("cached-types") + ctx.uniques.findEntryOrUpdate(tp).asInstanceOf[T] + } } /* !!! DEBUG ensuring ( result => tp.toString == result.toString || { |