aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/backend
diff options
context:
space:
mode:
authorDmitry Petrashko <dmitry.petrashko@gmail.com>2015-06-19 18:04:02 +0200
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2015-07-05 17:14:02 +0200
commit8fba722d616618962455d5fe5167e0f6e34817c7 (patch)
tree75accb700c5420e1d0b841812ff27a2f1f0b8644 /src/dotty/tools/backend
parentd3819ce631310baab00c44a0d1845b267d60bcdd (diff)
downloaddotty-8fba722d616618962455d5fe5167e0f6e34817c7.tar.gz
dotty-8fba722d616618962455d5fe5167e0f6e34817c7.tar.bz2
dotty-8fba722d616618962455d5fe5167e0f6e34817c7.zip
Arrays.newRefArray has multiple symbols that coexist during bootstrap.
More magic is needed, as enumerating array symbols does not work in backend.
Diffstat (limited to 'src/dotty/tools/backend')
-rw-r--r--src/dotty/tools/backend/jvm/DottyBackendInterface.scala11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/dotty/tools/backend/jvm/DottyBackendInterface.scala b/src/dotty/tools/backend/jvm/DottyBackendInterface.scala
index 855147ac4..2ee419714 100644
--- a/src/dotty/tools/backend/jvm/DottyBackendInterface.scala
+++ b/src/dotty/tools/backend/jvm/DottyBackendInterface.scala
@@ -157,9 +157,16 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{
}.toMap
def unboxMethods: Map[Symbol, Symbol] = defn.ScalaValueClasses.map(x => (x, Erasure.Boxing.unboxMethod(x.asClass))).toMap
- private val mkArrayNames: Set[String] = Set("Byte", "Float", "Char", "Double", "Boolean", "Unit", "Long", "Int", "Short", "Ref")
+ private val mkArrayNames: Set[Name] = Set("Byte", "Float", "Char", "Double", "Boolean", "Unit", "Long", "Int", "Short", "Ref").map{ x=>
+ ("new" + x + "Array").toTermName
+ }
+
+ val dottyArraysModuleClass = toDenot(defn.DottyArraysModule).moduleClass.asClass
- override lazy val syntheticArrayConstructors: Set[Symbol] = mkArrayNames.map(nm => ctx.requiredMethod(toDenot(defn.DottyArraysModule).moduleClass.asClass, s"new${nm}Array"))
+
+ override def isSyntheticArrayConstructor(s: Symbol) = {
+ (toDenot(s).maybeOwner eq dottyArraysModuleClass) && mkArrayNames.contains(s.name)
+ }
def isBox(sym: Symbol): Boolean = Erasure.Boxing.isBox(sym)
def isUnbox(sym: Symbol): Boolean = Erasure.Boxing.isUnbox(sym)