diff options
author | Paul Phillips <paulp@improving.org> | 2010-12-22 03:42:20 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-12-22 03:42:20 +0000 |
commit | 1050387558c4d16dd7427916e59b4824c4f70063 (patch) | |
tree | 24fccbb1366552cbf91141f92c0f3d3a48d214d9 /src/compiler | |
parent | 5bc2fc576949f03980ddd092b303b4484ab3172c (diff) | |
download | scala-1050387558c4d16dd7427916e59b4824c4f70063.tar.gz scala-1050387558c4d16dd7427916e59b4824c4f70063.tar.bz2 scala-1050387558c4d16dd7427916e59b4824c4f70063.zip |
The undoLog is being cleared before a typer run...
The undoLog is being cleared before a typer run, but not afterward. This
meant a huge amount of unnecessary garbage persisted beyond typer. Now,
more clearing. Review by moors.
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Analyzer.scala | 7 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 4 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Analyzer.scala b/src/compiler/scala/tools/nsc/typechecker/Analyzer.scala index c0b4ab5ca5..56f1fd4c53 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Analyzer.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Analyzer.scala @@ -76,10 +76,17 @@ trait Analyzer extends AnyRef def newPhase(_prev: Phase): StdPhase = new StdPhase(_prev) { override def keepsTypeParams = false resetTyper() + // the log accumulates entries over time, even though it should not (Adriaan, Martin said so). + // Lacking a better fix, we clear it here (before the phase is created, meaning for each + // compiler run). This is good enough for the resident compiler, which was the most affected. + undoLog.clear() override def run { val start = startTimer(typerNanos) global.echoPhaseSummary(this) currentRun.units foreach applyPhase + undoLog.clear() + // need to clear it after as well or 10K+ accumulated entries are + // uncollectable the rest of the way. stopTimer(typerNanos, start) } def apply(unit: CompilationUnit) { diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 5592126c92..5523aba07e 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -46,10 +46,6 @@ trait Typers { self: Analyzer => resetImplicits() transformed.clear superDefs.clear - // the log accumulates entries over time, even though it should not (Adriaan, Martin said so). - // Lacking a better fix, we clear it here (before the phase is created, meaning for each - // compiler run). This is good enough for the resident compiler, which was the most affected. - undoLog.clear } object UnTyper extends Traverser { |