Skip to content

Commit b51eceb

Browse files
committed
Update asm to patched 9.7
[Cherry-picked 5915e51][modified]
1 parent 72bce19 commit b51eceb

File tree

3 files changed

+24
-20
lines changed

3 files changed

+24
-20
lines changed

Diff for: compiler/src/dotty/tools/backend/jvm/BackendUtils.scala

+22-18
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,7 @@ class BackendUtils(val postProcessor: PostProcessor) {
2020
import bTypes.*
2121
import coreBTypes.jliLambdaMetaFactoryAltMetafactoryHandle
2222

23-
// Keep synchronized with `minTargetVersion` and `maxTargetVersion` in ScalaSettings
24-
lazy val classfileVersion: Int = compilerSettings.target match {
25-
case "8" => asm.Opcodes.V1_8
26-
case "9" => asm.Opcodes.V9
27-
case "10" => asm.Opcodes.V10
28-
case "11" => asm.Opcodes.V11
29-
case "12" => asm.Opcodes.V12
30-
case "13" => asm.Opcodes.V13
31-
case "14" => asm.Opcodes.V14
32-
case "15" => asm.Opcodes.V15
33-
case "16" => asm.Opcodes.V16
34-
case "17" => asm.Opcodes.V17
35-
case "18" => asm.Opcodes.V18
36-
case "19" => asm.Opcodes.V19
37-
case "20" => asm.Opcodes.V20
38-
case "21" => asm.Opcodes.V21
39-
case "22" => asm.Opcodes.V22
40-
}
23+
lazy val classfileVersion: Int = BackendUtils.classfileVersionMap(compilerSettings.target.toInt)
4124

4225
lazy val extraProc: Int = {
4326
import GenBCodeOps.addFlagIf
@@ -184,3 +167,24 @@ class BackendUtils(val postProcessor: PostProcessor) {
184167
}
185168
}
186169
}
170+
171+
object BackendUtils {
172+
lazy val classfileVersionMap: Map[Int, Int] = Map(
173+
8 -> asm.Opcodes.V1_8,
174+
9 -> asm.Opcodes.V9,
175+
10 -> asm.Opcodes.V10,
176+
11 -> asm.Opcodes.V11,
177+
12 -> asm.Opcodes.V12,
178+
13 -> asm.Opcodes.V13,
179+
14 -> asm.Opcodes.V14,
180+
15 -> asm.Opcodes.V15,
181+
16 -> asm.Opcodes.V16,
182+
17 -> asm.Opcodes.V17,
183+
18 -> asm.Opcodes.V18,
184+
19 -> asm.Opcodes.V19,
185+
20 -> asm.Opcodes.V20,
186+
21 -> asm.Opcodes.V21,
187+
22 -> asm.Opcodes.V22,
188+
23 -> asm.Opcodes.V23
189+
)
190+
}

Diff for: project/Build.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ object Build {
580580

581581
// get libraries onboard
582582
libraryDependencies ++= Seq(
583-
"org.scala-lang.modules" % "scala-asm" % "9.6.0-scala-1", // used by the backend
583+
"org.scala-lang.modules" % "scala-asm" % "9.7.0-scala-2", // used by the backend
584584
Dependencies.compilerInterface,
585585
"org.jline" % "jline-reader" % "3.25.1", // used by the REPL
586586
"org.jline" % "jline-terminal" % "3.25.1",

Diff for: tests/pos-with-compiler-cc/dotc/config/ScalaSettings.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class ScalaSettings extends SettingGroup with AllScalaSettings
1717
object ScalaSettings:
1818
// Keep synchronized with `classfileVersion` in `BCodeIdiomatic`
1919
private val minTargetVersion = 8
20-
private val maxTargetVersion = 22
20+
private val maxTargetVersion = 23
2121

2222
def supportedTargetVersions: List[String] =
2323
(minTargetVersion to maxTargetVersion).toList.map(_.toString)

0 commit comments

Comments
 (0)