diff options
author | Paul Phillips <paulp@improving.org> | 2012-03-01 15:45:42 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-03-01 15:47:37 -0800 |
commit | c5ac8005e23fc533e464d86e2c4ba5a4457844fe (patch) | |
tree | 7a0572ea6f712fe3cd1d50b99207e0a42e4277ef /src | |
parent | 84ab871a18c2a5b2d4dce8c2f42b47f1aada2a09 (diff) | |
download | scala-c5ac8005e23fc533e464d86e2c4ba5a4457844fe.tar.gz scala-c5ac8005e23fc533e464d86e2c4ba5a4457844fe.tar.bz2 scala-c5ac8005e23fc533e464d86e2c4ba5a4457844fe.zip |
Changes to appease the inliner.
It's unfortunate the things one must do to see @inline go through.
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/reflect/internal/SymbolTable.scala | 3 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/Global.scala | 21 |
2 files changed, 13 insertions, 11 deletions
diff --git a/src/compiler/scala/reflect/internal/SymbolTable.scala b/src/compiler/scala/reflect/internal/SymbolTable.scala index c8c1a51102..221fb46d12 100644 --- a/src/compiler/scala/reflect/internal/SymbolTable.scala +++ b/src/compiler/scala/reflect/internal/SymbolTable.scala @@ -79,7 +79,8 @@ abstract class SymbolTable extends api.Universe type RunId = Int final val NoRunId = 0 - private var phStack: List[Phase] = Nil + // sigh, this has to be public or atPhase doesn't inline. + var phStack: List[Phase] = Nil private var ph: Phase = NoPhase private var per = NoPeriod diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala index 1470a43491..1676efef5d 100644 --- a/src/compiler/scala/tools/nsc/Global.scala +++ b/src/compiler/scala/tools/nsc/Global.scala @@ -210,22 +210,23 @@ class Global(var currentSettings: Settings, var reporter: Reporter) extends Symb def logError(msg: String, t: Throwable): Unit = () - private def atPhaseStackMessage = atPhaseStack match { - case Nil => "" - case ps => ps.reverseMap("->" + _).mkString("(", " ", ")") - } - private def shouldLogAtThisPhase = ( - (settings.log.isSetByUser) - && ((settings.log containsPhase globalPhase) || (settings.log containsPhase phase)) - ) - def logAfterEveryPhase[T](msg: String)(op: => T) { log("Running operation '%s' after every phase.\n".format(msg) + describeAfterEveryPhase(op)) } // Over 200 closure objects are eliminated by inlining this. - @inline final def log(msg: => AnyRef): Unit = + @inline final def log(msg: => AnyRef): Unit = { + def shouldLogAtThisPhase = ( + (settings.log.isSetByUser) + && ((settings.log containsPhase globalPhase) || (settings.log containsPhase phase)) + ) + def atPhaseStackMessage = atPhaseStack match { + case Nil => "" + case ps => ps.reverseMap("->" + _).mkString("(", " ", ")") + } + if (shouldLogAtThisPhase) inform("[log %s%s] %s".format(globalPhase, atPhaseStackMessage, msg)) + } @inline final override def debuglog(msg: => String) { if (settings.debug.value) |