summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/reflect/internal/SymbolTable.scala2
-rw-r--r--src/compiler/scala/tools/nsc/Global.scala5
-rw-r--r--src/compiler/scala/tools/nsc/transform/Mixin.scala16
-rw-r--r--src/compiler/scala/tools/nsc/transform/UnCurry.scala3
4 files changed, 14 insertions, 12 deletions
diff --git a/src/compiler/scala/reflect/internal/SymbolTable.scala b/src/compiler/scala/reflect/internal/SymbolTable.scala
index 0687a50e2a..bb0824c5c1 100644
--- a/src/compiler/scala/reflect/internal/SymbolTable.scala
+++ b/src/compiler/scala/reflect/internal/SymbolTable.scala
@@ -27,7 +27,7 @@ abstract class SymbolTable extends /*reflect.generic.Universe
with Required
{
def rootLoader: LazyType
- def log(msg: => AnyRef)
+ def log(msg: => AnyRef): Unit
def abort(msg: String): Nothing = throw new Error(msg)
def abort(): Nothing = throw new Error()
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala
index 177bd8dbbd..d322ce8382 100644
--- a/src/compiler/scala/tools/nsc/Global.scala
+++ b/src/compiler/scala/tools/nsc/Global.scala
@@ -172,7 +172,10 @@ class Global(var currentSettings: Settings, var reporter: Reporter) extends Symb
def informTime(msg: String, start: Long) = informProgress(elapsedMessage(msg, start))
def logError(msg: String, t: Throwable): Unit = ()
- def log(msg: => AnyRef): Unit = if (opt.logPhase) inform("[log " + phase + "] " + msg)
+ // Over 200 closure objects are eliminated by inlining this.
+ @inline final def log(msg: => AnyRef): Unit =
+ if (settings.log containsPhase globalPhase)
+ inform("[log " + phase + "] " + msg)
def logThrowable(t: Throwable): Unit = globalError(throwableAsString(t))
def throwableAsString(t: Throwable): String =
diff --git a/src/compiler/scala/tools/nsc/transform/Mixin.scala b/src/compiler/scala/tools/nsc/transform/Mixin.scala
index ac4f19f69d..da92e80709 100644
--- a/src/compiler/scala/tools/nsc/transform/Mixin.scala
+++ b/src/compiler/scala/tools/nsc/transform/Mixin.scala
@@ -580,6 +580,14 @@ abstract class Mixin extends InfoTransform with ast.TreeDSL {
REF(sym.owner.sourceModule) DOT sym
}
+ @inline private def bitmapOperation[T](field: Symbol, transientCase: => T, privateCase: => T, rest: => T): T =
+ if (field.accessed.hasAnnotation(TransientAttr))
+ transientCase
+ else if (field.hasFlag(PRIVATE | notPRIVATE))
+ privateCase
+ else
+ rest
+
/** Add all new definitions to a non-trait class
* These fall into the following categories:
* - for a trait interface:
@@ -672,14 +680,6 @@ abstract class Mixin extends InfoTransform with ast.TreeDSL {
import lazyVals._
- def bitmapOperation[T](field: Symbol, transientCase: => T, privateCase: => T, rest: => T): T =
- if (field.accessed.hasAnnotation(TransientAttr))
- transientCase
- else if (field.hasFlag(PRIVATE) || field.hasFlag(notPRIVATE))
- privateCase
- else
- rest
-
/**
* Private or transient lazy vals use bitmaps that are private for the class context,
* unlike public or protected vals, which can use inherited bitmaps.
diff --git a/src/compiler/scala/tools/nsc/transform/UnCurry.scala b/src/compiler/scala/tools/nsc/transform/UnCurry.scala
index 04752c5fd7..b62b2aa2a8 100644
--- a/src/compiler/scala/tools/nsc/transform/UnCurry.scala
+++ b/src/compiler/scala/tools/nsc/transform/UnCurry.scala
@@ -468,8 +468,7 @@ abstract class UnCurry extends InfoTransform with TypingTransformers with ast.Tr
// ------ The tree transformers --------------------------------------------------------
def mainTransform(tree: Tree): Tree = {
-
- def withNeedLift(needLift: Boolean)(f: => Tree): Tree = {
+ @inline def withNeedLift(needLift: Boolean)(f: => Tree): Tree = {
val saved = needTryLift
needTryLift = needLift
try f