diff options
author | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-06-26 01:00:55 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-06-26 01:00:55 -0700 |
commit | 5a7bbfe035ecb64acd57fc66ea0d874ad02c31ff (patch) | |
tree | 8ddfa8e0f58974d27517d1e81a861b328ebd55c7 /src/compiler | |
parent | 5b506690356ffec3e83984f9098b269b1a02159d (diff) | |
parent | 1d67fe63b8c1e5537cccc60734cfbf3bc64d10ab (diff) | |
download | scala-5a7bbfe035ecb64acd57fc66ea0d874ad02c31ff.tar.gz scala-5a7bbfe035ecb64acd57fc66ea0d874ad02c31ff.tar.bz2 scala-5a7bbfe035ecb64acd57fc66ea0d874ad02c31ff.zip |
Merge pull request #770 from odersky/pullreq/statistics
Statistics improvements and bug fixes.
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Implicits.scala | 2 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 19 |
2 files changed, 11 insertions, 10 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala index f7e00109ae..68782379a6 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala @@ -1125,7 +1125,7 @@ trait Implicits { * such that some part of `tp` has C as one of its superclasses. */ private def implicitsOfExpectedType: Infoss = { - Statistics.incCounter(implicitCacheHits) + Statistics.incCounter(implicitCacheAccs) implicitsCache get pt match { case Some(implicitInfoss) => Statistics.incCounter(implicitCacheHits) diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 6bb980260f..acf1b3dc59 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -4025,7 +4025,7 @@ trait Typers extends Modes with Adaptations with Tags { } else { context.enclMethod.returnsSeen = true val expr1: Tree = typed(expr, EXPRmode | BYVALmode | RETmode, restpt.tpe) - + // Warn about returning a value if no value can be returned. if (restpt.tpe.typeSymbol == UnitClass) { // The typing in expr1 says expr is Unit (it has already been coerced if @@ -5131,7 +5131,7 @@ trait Typers extends Modes with Adaptations with Tags { indentTyping() var alreadyTyped = false - val startByType = Statistics.pushTimerClass(byTypeNanos, tree.getClass) + val startByType = Statistics.pushTimer(byTypeStack, byTypeNanos(tree.getClass)) Statistics.incCounter(visitsByType, tree.getClass) try { if (context.retyping && @@ -5187,7 +5187,7 @@ trait Typers extends Modes with Adaptations with Tags { } finally { deindentTyping() - Statistics.popTimerClass(byTypeNanos, startByType) + Statistics.popTimer(byTypeStack, startByType) } } @@ -5375,10 +5375,11 @@ object TypersStats { val compoundBaseTypeSeqCount = Statistics.newSubCounter(" of which for compound types", baseTypeSeqCount) val typerefBaseTypeSeqCount = Statistics.newSubCounter(" of which for typerefs", baseTypeSeqCount) val singletonBaseTypeSeqCount = Statistics.newSubCounter(" of which for singletons", baseTypeSeqCount) - val failedSilentNanos = Statistics.newSubTimer ("time spent in failed", typerNanos) - val failedApplyNanos = Statistics.newSubTimer (" failed apply", typerNanos) - val failedOpEqNanos = Statistics.newSubTimer (" failed op=", typerNanos) - val isReferencedNanos = Statistics.newSubTimer ("time spent ref scanning", typerNanos) - val visitsByType = Statistics.newByClass ("#visits by tree node", "typer")(Statistics.newCounter("")) - val byTypeNanos = Statistics.newByClassTimerStack("time spent by tree node", typerNanos) + val failedSilentNanos = Statistics.newSubTimer("time spent in failed", typerNanos) + val failedApplyNanos = Statistics.newSubTimer(" failed apply", typerNanos) + val failedOpEqNanos = Statistics.newSubTimer(" failed op=", typerNanos) + val isReferencedNanos = Statistics.newSubTimer("time spent ref scanning", typerNanos) + val visitsByType = Statistics.newByClass("#visits by tree node", "typer")(Statistics.newCounter("")) + val byTypeNanos = Statistics.newByClass("time spent by tree node", "typer")(Statistics.newStackableTimer("", typerNanos)) + val byTypeStack = Statistics.newTimerStack() } |