Skip to content

Commit f8dbf7c

Browse files
committed
Remove aliases
1 parent 2e8f5c5 commit f8dbf7c

File tree

2 files changed

+6
-34
lines changed

2 files changed

+6
-34
lines changed

compiler/src/dotty/tools/backend/jvm/BCodeBodyBuilder.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,7 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
10611061
// Optimization for expressions of the form "" + x. We can avoid the StringBuilder.
10621062
case List(Literal(Constant("")), arg) =>
10631063
genLoad(arg, ObjectReference)
1064-
genCallMethod(String_valueOf, InvokeStyle.Static)
1064+
genCallMethod(defn.String_valueOf_Object, InvokeStyle.Static)
10651065

10661066
case concatenations =>
10671067
bc.genStartConcat
@@ -1152,7 +1152,7 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
11521152
/* Generate the scala ## method. */
11531153
def genScalaHash(tree: Tree): BType = {
11541154
genLoad(tree, ObjectReference)
1155-
genCallMethod(hashMethodSym, InvokeStyle.Static)
1155+
genCallMethod(NoSymbol, InvokeStyle.Static) // used to dispatch ## on primitives to ScalaRuntime.hash. Should be implemented by a miniphase
11561156
}
11571157

11581158
/*
@@ -1325,9 +1325,9 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
13251325
if (mustUseAnyComparator) {
13261326
val equalsMethod: Symbol = {
13271327
if (l.tpe <:< symHelper(defn.BoxedNumberClass).tpe) {
1328-
if (r.tpe <:< symHelper(defn.BoxedNumberClass).tpe) externalEqualsNumNum
1329-
else if (r.tpe <:< symHelper(defn.BoxedCharClass).tpe) externalEqualsNumChar
1330-
else externalEqualsNumObject
1328+
if (r.tpe <:< symHelper(defn.BoxedNumberClass).tpe) defn.BoxesRunTimeModule.requiredMethod(nme.equalsNumNum)
1329+
else if (r.tpe <:< symHelper(defn.BoxedCharClass).tpe) NoSymbol // ctx.requiredMethod(BoxesRunTimeTypeRef, nme.equalsNumChar) // this method is private
1330+
else defn.BoxesRunTimeModule.requiredMethod(nme.equalsNumObject)
13311331
} else externalEquals
13321332
}
13331333

compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -86,18 +86,7 @@ class DottyBackendInterface(outputDirectory: AbstractFile, val superCallsMap: Ma
8686
case _ => false
8787
}
8888

89-
val hashMethodSym: Symbol = NoSymbol // used to dispatch ## on primitives to ScalaRuntime.hash. Should be implemented by a miniphase
90-
val externalEqualsNumNum: Symbol = defn.BoxesRunTimeModule.requiredMethod(nme.equalsNumNum)
91-
val externalEqualsNumChar: Symbol = NoSymbol // ctx.requiredMethod(BoxesRunTimeTypeRef, nme.equalsNumChar) // this method is private
92-
val externalEqualsNumObject: Symbol = defn.BoxesRunTimeModule.requiredMethod(nme.equalsNumObject)
9389
val externalEquals: Symbol = defn.BoxesRunTimeModule.info.decl(nme.equals_).suchThat(toDenot(_).info.firstParamTypes.size == 2).symbol
94-
val MaxFunctionArity: Int = Definitions.MaxImplementedFunctionArity
95-
val FunctionClass: Array[Symbol] = defn.FunctionClassPerRun()
96-
val AbstractFunctionClass: Array[Symbol] = defn.AbstractFunctionClassPerRun()
97-
val PartialFunctionClass: Symbol = defn.PartialFunctionClass
98-
val AbstractPartialFunctionClass: Symbol = defn.AbstractPartialFunctionClass
99-
val String_valueOf: Symbol = defn.String_valueOf_Object
100-
@threadUnsafe lazy val Predef_classOf: Symbol = defn.ScalaPredefModule.requiredMethod(nme.classOf)
10190

10291
@threadUnsafe lazy val AnnotationRetentionAttr: ClassSymbol = ctx.requiredClass("java.lang.annotation.Retention")
10392
@threadUnsafe lazy val AnnotationRetentionSourceAttr: TermSymbol = ctx.requiredClass("java.lang.annotation.RetentionPolicy").linkedClass.requiredValue("SOURCE")
@@ -174,7 +163,7 @@ class DottyBackendInterface(outputDirectory: AbstractFile, val superCallsMap: Ma
174163
val evalue = const.symbolValue.name.mangledString // value the actual enumeration value.
175164
av.visitEnum(name, edesc, evalue)
176165
}
177-
case t: TypeApply if (t.fun.symbol == Predef_classOf) =>
166+
case t: TypeApply if (t.fun.symbol == defn.Predef_classOf) =>
178167
av.visit(name, t.args.head.tpe.classSymbol.denot.info.toTypeKind(bcodeStore)(innerClasesStore).toASMType)
179168
case Ident(nme.WILDCARD) =>
180169
// An underscore argument indicates that we want to use the default value for this parameter, so do not emit anything
@@ -951,23 +940,6 @@ class DottyBackendInterface(outputDirectory: AbstractFile, val superCallsMap: Ma
951940
}
952941

953942

954-
abstract class ConstantHelper {
955-
def tag: ConstantTag
956-
def longValue: Long
957-
def doubleValue: Double
958-
def charValue: Char
959-
def stringValue: String
960-
def byteValue: Byte
961-
def booleanValue: Boolean
962-
def shortValue: Short
963-
def intValue: Int
964-
def value: Any
965-
def floatValue: Float
966-
def typeValue: Type
967-
def symbolValue: Symbol
968-
}
969-
970-
971943
abstract class SymbolHelper {
972944
def exists: Boolean
973945

0 commit comments

Comments
 (0)