Skip to content

Commit 885035d

Browse files
committed
Move fields
1 parent 405104d commit 885035d

File tree

2 files changed

+7
-15
lines changed

2 files changed

+7
-15
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ package dotty.tools
22
package backend
33
package jvm
44

5+
import scala.annotation.threadUnsafe
56
import scala.tools.asm
67
import scala.tools.asm.AnnotationVisitor
78
import scala.tools.asm.ClassWriter
89
import scala.collection.mutable
9-
import dotty.tools.io.AbstractFile
1010

1111
import dotty.tools.dotc.CompilationUnit
1212
import dotty.tools.dotc.ast.tpd
@@ -25,6 +25,7 @@ import dotty.tools.dotc.core.Types
2525
import dotty.tools.dotc.core.Types._
2626
import dotty.tools.dotc.core.TypeErasure
2727
import dotty.tools.dotc.transform.GenericSignatures
28+
import dotty.tools.io.AbstractFile
2829

2930
/*
3031
* Traits encapsulating functionality to convert Scala AST Trees into ASM ClassNodes.
@@ -47,6 +48,11 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
4748
def ScalaATTRName: String = "Scala"
4849
def ScalaSignatureATTRName: String = "ScalaSig"
4950

51+
@threadUnsafe lazy val AnnotationRetentionAttr: ClassSymbol = ctx.requiredClass("java.lang.annotation.Retention")
52+
@threadUnsafe lazy val AnnotationRetentionSourceAttr: TermSymbol = ctx.requiredClass("java.lang.annotation.RetentionPolicy").linkedClass.requiredValue("SOURCE")
53+
@threadUnsafe lazy val AnnotationRetentionClassAttr: TermSymbol = ctx.requiredClass("java.lang.annotation.RetentionPolicy").linkedClass.requiredValue("CLASS")
54+
@threadUnsafe lazy val AnnotationRetentionRuntimeAttr: TermSymbol = ctx.requiredClass("java.lang.annotation.RetentionPolicy").linkedClass.requiredValue("RUNTIME")
55+
@threadUnsafe lazy val JavaAnnotationClass: ClassSymbol = ctx.requiredClass("java.lang.annotation.Annotation")
5056

5157
val bCodeAsmCommon: BCodeAsmCommon[int.type] = new BCodeAsmCommon(int)
5258
import bCodeAsmCommon._

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

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,9 @@ import Annotations.Annotation
3535
import Names.Name
3636

3737
class DottyBackendInterface(val outputDirectory: AbstractFile, val superCallsMap: Map[Symbol, Set[ClassSymbol]])(implicit val ctx: Context) {
38-
import Symbols.{toDenot, toClassDenot}
39-
// Dotty deviation: Need to (re-)import implicit decorators here because otherwise
40-
// they would be shadowed by the more deeply nested `symHelper` decorator.
41-
42-
43-
// require LambdaMetafactory: scalac uses getClassIfDefined, but we need those always.
44-
// @threadUnsafe lazy val LambdaMetaFactory: ClassSymbol = ctx.requiredClass("java.lang.invoke.LambdaMetafactory")
45-
@threadUnsafe lazy val MethodHandle: ClassSymbol = ctx.requiredClass("java.lang.invoke.MethodHandle")
4638

4739
val externalEquals: Symbol = defn.BoxesRunTimeModule.info.decl(nme.equals_).suchThat(toDenot(_).info.firstParamTypes.size == 2).symbol
4840

49-
@threadUnsafe lazy val AnnotationRetentionAttr: ClassSymbol = ctx.requiredClass("java.lang.annotation.Retention")
50-
@threadUnsafe lazy val AnnotationRetentionSourceAttr: TermSymbol = ctx.requiredClass("java.lang.annotation.RetentionPolicy").linkedClass.requiredValue("SOURCE")
51-
@threadUnsafe lazy val AnnotationRetentionClassAttr: TermSymbol = ctx.requiredClass("java.lang.annotation.RetentionPolicy").linkedClass.requiredValue("CLASS")
52-
@threadUnsafe lazy val AnnotationRetentionRuntimeAttr: TermSymbol = ctx.requiredClass("java.lang.annotation.RetentionPolicy").linkedClass.requiredValue("RUNTIME")
53-
@threadUnsafe lazy val JavaAnnotationClass: ClassSymbol = ctx.requiredClass("java.lang.annotation.Annotation")
54-
5541
private def erasureString(clazz: Class[_]): String = {
5642
if (clazz.isArray) "Array[" + erasureString(clazz.getComponentType) + "]"
5743
else clazz.getName

0 commit comments

Comments
 (0)