Closed
Description
I noticed this when trying to upgrade the Dotty version used in scala/compiler-benchmark
I was upgrading to 0.8.0-RC1.
[error] Ident(SampleTime) (of class dotty.tools.dotc.ast.Trees$Ident)
scala.MatchError: Ident(SingleShotTime) (of class dotty.tools.dotc.ast.Trees$Ident)
at dotty.tools.backend.jvm.DottyBackendInterface.emitArgument(DottyBackendInterface.scala:246)
at dotty.tools.backend.jvm.DottyBackendInterface.emitArgument$$anonfun$3(DottyBackendInterface.scala:291)
at scala.compat.java8.JProcedure1.apply(JProcedure1.java:18)
at scala.compat.java8.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.immutable.List.foreach(List.scala:389)
at dotty.tools.backend.jvm.DottyBackendInterface.emitArgument(DottyBackendInterface.scala:292)
at dotty.tools.backend.jvm.DottyBackendInterface.emitAssocs$$anonfun$2(DottyBackendInterface.scala:328)
at scala.compat.java8.JProcedure1.apply(JProcedure1.java:18)
at scala.compat.java8.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.TraversableLike$WithFilter.$anonfun$foreach$1(TraversableLike.scala:789)
at scala.collection.immutable.List.foreach(List.scala:389)
at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:788)
at dotty.tools.backend.jvm.DottyBackendInterface.emitAssocs(DottyBackendInterface.scala:
A workaround is use Select
-s rather than Ident
-s in runtime-retained annotation arguments.
diff --git a/compilation/src/main/dotc/scala/tools/benchmark/BenchmarkDriver.scala b/compilation/src/main/dotc/scala/tools/benchmark/BenchmarkDriver.scala
index 632210d..2793d04 100644
--- a/compilation/src/main/dotc/scala/tools/benchmark/BenchmarkDriver.scala
+++ b/compilation/src/main/dotc/scala/tools/benchmark/BenchmarkDriver.scala
@@ -13,7 +13,7 @@ trait BenchmarkDriver extends BaseBenchmarkDriver {
depsClasspath.mkString(File.pathSeparator))
}
ctx.setSetting(ctx.settings.migration, false)
- ctx.setSetting(ctx.settings.d, tempDir.getAbsolutePath)
+ ctx.setSetting(ctx.settings.outputDir, tempDir.getAbsolutePath)
ctx.setSetting(ctx.settings.language, List("Scala2"))
val compiler = new dotty.tools.dotc.Compiler
val reporter = dotty.tools.dotc.Bench.doCompile(compiler, allArgs)
diff --git a/compilation/src/main/scala/scala/tools/nsc/HotSbtBenchmark.scala b/compilation/src/main/scala/scala/tools/nsc/HotSbtBenchmark.scala
index 102cafb..ba77ba1 100644
--- a/compilation/src/main/scala/scala/tools/nsc/HotSbtBenchmark.scala
+++ b/compilation/src/main/scala/scala/tools/nsc/HotSbtBenchmark.scala
@@ -4,11 +4,11 @@ import java.io._
import java.nio.file._
import java.util.concurrent.TimeUnit
-import org.openjdk.jmh.annotations.Mode.SampleTime
+import org.openjdk.jmh.annotations.Mode
import org.openjdk.jmh.annotations._
@State(Scope.Benchmark)
-@BenchmarkMode(Array(SampleTime))
+@BenchmarkMode(Array(org.openjdk.jmh.annotations.Mode.SampleTime))
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@Warmup(iterations = 10, time = 10, timeUnit = TimeUnit.SECONDS)
@Measurement(iterations = 10, time = 10, timeUnit = TimeUnit.SECONDS)
diff --git a/compilation/src/main/scala/scala/tools/nsc/ScalacBenchmark.scala b/compilation/src/main/scala/scala/tools/nsc/ScalacBenchmark.scala
index 3d1548f..d527f51 100644
--- a/compilation/src/main/scala/scala/tools/nsc/ScalacBenchmark.scala
+++ b/compilation/src/main/scala/scala/tools/nsc/ScalacBenchmark.scala
@@ -111,7 +111,7 @@ object ScalacBenchmarkStandalone {
}
@State(Scope.Benchmark)
-@BenchmarkMode(Array(SingleShotTime))
+@BenchmarkMode(Array(org.openjdk.jmh.annotations.Mode.SingleShotTime))
@OutputTimeUnit(TimeUnit.MILLISECONDS)
// TODO -Xbatch reduces fork-to-fork variance, but incurs 5s -> 30s slowdown
@Fork(value = 16, jvmArgs = Array("-XX:CICompilerCount=2", "-Xms2G", "-Xmx2G"))
@@ -120,7 +120,7 @@ class ColdScalacBenchmark extends ScalacBenchmark {
def compile(): Unit = compileImpl()
}
-@BenchmarkMode(Array(SampleTime))
+@BenchmarkMode(Array(org.openjdk.jmh.annotations.Mode.SampleTime))
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@Warmup(iterations = 0)
@Measurement(iterations = 1, time = 30, timeUnit = TimeUnit.SECONDS)
@@ -130,7 +130,7 @@ class WarmScalacBenchmark extends ScalacBenchmark {
def compile(): Unit = compileImpl()
}
-@BenchmarkMode(Array(SampleTime))
+@BenchmarkMode(Array(org.openjdk.jmh.annotations.Mode.SampleTime))
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@Warmup(iterations = 10, time = 10, timeUnit = TimeUnit.SECONDS)
@Measurement(iterations = 10, time = 10, timeUnit = TimeUnit.SECONDS)