diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2010-08-23 08:52:09 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2010-08-23 08:52:09 +0000 |
commit | f6843150fb52faca82761988be67ee07f412531f (patch) | |
tree | 1bf80e0b4b21f0e957c7dcab89f886d5e1e67e80 /src/compiler/scala/tools/nsc/backend/opt/Inliners.scala | |
parent | e176011b88ea92a0fa3142cd4fd7200c571b9117 (diff) | |
download | scala-f6843150fb52faca82761988be67ee07f412531f.tar.gz scala-f6843150fb52faca82761988be67ee07f412531f.tar.bz2 scala-f6843150fb52faca82761988be67ee07f412531f.zip |
Small cleanups
Diffstat (limited to 'src/compiler/scala/tools/nsc/backend/opt/Inliners.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/backend/opt/Inliners.scala | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/opt/Inliners.scala b/src/compiler/scala/tools/nsc/backend/opt/Inliners.scala index a2b24fe0cb..4fb8067840 100644 --- a/src/compiler/scala/tools/nsc/backend/opt/Inliners.scala +++ b/src/compiler/scala/tools/nsc/backend/opt/Inliners.scala @@ -223,9 +223,9 @@ abstract class Inliners extends SubComponent { while (retry && count < MAX_INLINE_RETRY) m.normalize - } + } - private def isMonadicMethod(sym: Symbol) = sym.name match { + private def isMonadicMethod(sym: Symbol) = sym.name match { case nme.foreach | nme.filter | nme.map | nme.flatMap => true case _ => false } @@ -234,17 +234,17 @@ abstract class Inliners extends SubComponent { /** Should method 'sym' being called in 'receiver' be loaded from disk? */ def shouldLoadImplFor(sym: Symbol, receiver: Symbol): Boolean = { - if (settings.debug.value) - log("shouldLoadImplFor: " + receiver + "." + sym) - def alwaysLoad = (receiver.enclosingPackage == RuntimePackage) || (receiver == PredefModule.moduleClass) def loadCondition = sym.isEffectivelyFinal && isMonadicMethod(sym) && isHigherOrderMethod(sym) - hasInline(sym) || alwaysLoad || loadCondition + val res = hasInline(sym) || alwaysLoad || loadCondition + if (settings.debug.value) + log("shouldLoadImplFor: " + receiver + "." + sym + ": " + res) + res } - /** Look up implementation of method 'sym in 'clazz'. - */ + /** Look up implementation of method 'sym in 'clazz'. + */ def lookupImplFor(sym: Symbol, clazz: Symbol): Symbol = { // TODO: verify that clazz.superClass is equivalent here to clazz.tpe.parents(0).typeSymbol (.tpe vs .info) def needsLookup = (clazz != NoSymbol) && (clazz != sym.owner) && !sym.isEffectivelyFinal && clazz.isFinal |