diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2016-09-27 08:37:46 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-27 08:37:46 +1000 |
commit | 31e25275f7894f1d2f19e5ff85bebc5a2318b7ab (patch) | |
tree | 493e0350edb70ee375d7f39909ac76acfb1c9d9b | |
parent | 6df14e57a4980897d5517f002c04584b82e05b15 (diff) | |
parent | 87b3d2cc41b175742da9301210299c3b1524a287 (diff) | |
download | scala-31e25275f7894f1d2f19e5ff85bebc5a2318b7ab.tar.gz scala-31e25275f7894f1d2f19e5ff85bebc5a2318b7ab.tar.bz2 scala-31e25275f7894f1d2f19e5ff85bebc5a2318b7ab.zip |
Merge pull request #5418 from retronym/opt/java-binary-name
Optimize javaBinaryName callers
3 files changed, 5 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/BTypesFromSymbols.scala b/src/compiler/scala/tools/nsc/backend/jvm/BTypesFromSymbols.scala index 09e82de89b..edb75514e8 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/BTypesFromSymbols.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/BTypesFromSymbols.scala @@ -114,7 +114,7 @@ class BTypesFromSymbols[G <: Global](val global: G) extends BTypes { if (classSym == NothingClass) srNothingRef else if (classSym == NullClass) srNullRef else { - val internalName = classSym.javaBinaryName.toString + val internalName = classSym.javaBinaryNameString classBTypeFromInternalName.getOrElse(internalName, { // The new ClassBType is added to the map in its constructor, before we set its info. This // allows initializing cyclic dependencies, see the comment on variable ClassBType._info. @@ -625,7 +625,7 @@ class BTypesFromSymbols[G <: Global](val global: G) extends BTypes { */ def mirrorClassClassBType(moduleClassSym: Symbol): ClassBType = { assert(isTopLevelModuleClass(moduleClassSym), s"not a top-level module class: $moduleClassSym") - val internalName = moduleClassSym.javaBinaryName.dropModule.toString + val internalName = moduleClassSym.javaBinaryNameString.stripSuffix(nme.MODULE_SUFFIX_STRING) classBTypeFromInternalName.getOrElse(internalName, { val c = ClassBType(internalName) // class info consistent with BCodeHelpers.genMirrorClass @@ -642,7 +642,7 @@ class BTypesFromSymbols[G <: Global](val global: G) extends BTypes { } def beanInfoClassClassBType(mainClass: Symbol): ClassBType = { - val internalName = mainClass.javaBinaryName.toString + "BeanInfo" + val internalName = mainClass.javaBinaryNameString + "BeanInfo" classBTypeFromInternalName.getOrElse(internalName, { val c = ClassBType(internalName) c.info = Right(ClassInfo( diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenBCode.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenBCode.scala index 0a54767f76..6593d4b725 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/GenBCode.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/GenBCode.scala @@ -337,7 +337,7 @@ abstract class GenBCode extends BCodeSyncAndTry { bTypes.initializeCoreBTypes() bTypes.javaDefinedClasses.clear() bTypes.javaDefinedClasses ++= currentRun.symSource collect { - case (sym, _) if sym.isJavaDefined => sym.javaBinaryName.toString + case (sym, _) if sym.isJavaDefined => sym.javaBinaryNameString } Statistics.stopTimer(BackendStats.bcodeInitTimer, initStart) diff --git a/src/compiler/scala/tools/nsc/transform/Erasure.scala b/src/compiler/scala/tools/nsc/transform/Erasure.scala index 69240b07a1..cc234eb623 100644 --- a/src/compiler/scala/tools/nsc/transform/Erasure.scala +++ b/src/compiler/scala/tools/nsc/transform/Erasure.scala @@ -258,7 +258,7 @@ abstract class Erasure extends InfoTransform // Anything which could conceivably be a module (i.e. isn't known to be // a type parameter or similar) must go through here or the signature is // likely to end up with Foo<T>.Empty where it needs Foo<T>.Empty$. - def fullNameInSig(sym: Symbol) = "L" + enteringJVM(sym.javaBinaryName) + def fullNameInSig(sym: Symbol) = "L" + enteringJVM(sym.javaBinaryNameString) def jsig(tp0: Type, existentiallyBound: List[Symbol] = Nil, toplevel: Boolean = false, primitiveOK: Boolean = true): String = { val tp = tp0.dealias |