diff options
author | Martin Odersky <odersky@gmail.com> | 2015-11-07 19:09:07 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-11-09 15:45:39 +0100 |
commit | 5398c5a723b0f8b0d35e6c3ad230c5046169e837 (patch) | |
tree | 832f93128ce25194d9418b682f4e248adba51dd4 /src/dotty/tools/backend/jvm | |
parent | 5db52d25256568cf7d8c2335ee733a38b059b5ad (diff) | |
download | dotty-5398c5a723b0f8b0d35e6c3ad230c5046169e837.tar.gz dotty-5398c5a723b0f8b0d35e6c3ad230c5046169e837.tar.bz2 dotty-5398c5a723b0f8b0d35e6c3ad230c5046169e837.zip |
Avoid overhead of generating symbol sets on each access
1) Have symbol sets cached per run
2) Use methods Denotation#isPrimitiveValueClass, Denotation#isNumericValueClass
instead of calling contains directly on symbol sets.
Diffstat (limited to 'src/dotty/tools/backend/jvm')
-rw-r--r-- | src/dotty/tools/backend/jvm/DottyBackendInterface.scala | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/dotty/tools/backend/jvm/DottyBackendInterface.scala b/src/dotty/tools/backend/jvm/DottyBackendInterface.scala index 09313b0a2..fb84377d7 100644 --- a/src/dotty/tools/backend/jvm/DottyBackendInterface.scala +++ b/src/dotty/tools/backend/jvm/DottyBackendInterface.scala @@ -148,11 +148,10 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{ lazy val AnnotationRetentionRuntimeAttr = ctx.requiredClass("java.lang.annotation.RetentionPolicy").linkedClass.requiredValue("RUNTIME") lazy val JavaAnnotationClass = ctx.requiredClass("java.lang.annotation.Annotation") - - def boxMethods: Map[Symbol, Symbol] = defn.ScalaValueClasses.map{x => + def boxMethods: Map[Symbol, Symbol] = defn.ScalaValueClasses().map{x => // @darkdimius Are you sure this should be a def? (x, Erasure.Boxing.boxMethod(x.asClass)) }.toMap - def unboxMethods: Map[Symbol, Symbol] = defn.ScalaValueClasses.map(x => (x, Erasure.Boxing.unboxMethod(x.asClass))).toMap + def unboxMethods: Map[Symbol, Symbol] = defn.ScalaValueClasses().map(x => (x, Erasure.Boxing.unboxMethod(x.asClass))).toMap private val mkArrayNames: Set[Name] = Set("Byte", "Float", "Char", "Double", "Boolean", "Unit", "Long", "Int", "Short", "Ref").map{ x=> ("new" + x + "Array").toTermName |