Skip to content

Commit

Permalink
Merge pull request #11293 from dotty-staging/asm-9
Browse files Browse the repository at this point in the history
Upgrade to ASM 9.0
  • Loading branch information
smarter committed Feb 3, 2021
2 parents 7ded834 + 9fed887 commit 03d104d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions compiler/src/dotty/tools/backend/jvm/BCodeIdiomatic.scala
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ trait BCodeIdiomatic {
case (None, None) => "8" // least supported version by default


// Keep synchronized with `minTargetVersion` and `maxTargetVersion` in ScalaSettings
lazy val classfileVersion: Int = target match {
case "8" => asm.Opcodes.V1_8
case "9" => asm.Opcodes.V9
Expand All @@ -48,6 +49,7 @@ trait BCodeIdiomatic {
case "13" => asm.Opcodes.V13
case "14" => asm.Opcodes.V14
case "15" => asm.Opcodes.V15
case "16" => asm.Opcodes.V16
}

lazy val majorVersion: Int = (classfileVersion & 0xFF)
Expand Down
3 changes: 2 additions & 1 deletion compiler/src/dotty/tools/dotc/config/ScalaSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ trait CommonScalaSettings { self: Settings.SettingGroup =>
}

class ScalaSettings extends Settings.SettingGroup with CommonScalaSettings {
// Keep synchronized with `classfileVersion` in `BCodeIdiomatic`
private val minTargetVersion = 8
private val maxTargetVersion = 15
private val maxTargetVersion = 16

private def supportedTargetVersions: List[String] =
(minTargetVersion to maxTargetVersion).toList.map(_.toString)
Expand Down
2 changes: 1 addition & 1 deletion project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ object Build {

// get libraries onboard
libraryDependencies ++= Seq(
"org.scala-lang.modules" % "scala-asm" % "7.3.1-scala-1", // used by the backend
"org.scala-lang.modules" % "scala-asm" % "9.0.0-scala-1", // used by the backend
Dependencies.oldCompilerInterface, // we stick to the old version to avoid deprecation warnings
"org.jline" % "jline-reader" % "3.15.0", // used by the REPL
"org.jline" % "jline-terminal" % "3.15.0",
Expand Down

0 comments on commit 03d104d

Please sign in to comment.