8000 Bump the Scala 3 version used for source compat of `ir/` to 3.6.3. · scala-js/scala-js@795d3e0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 795d3e0

Browse files
committed
Bump the Scala 3 version used for source compat of ir/ to 3.6.3.
`private[this]` is deprecated in favor of `private`. This should not have a real impact on post-JIT performance. `var x = _` is deprecated in favor `= scala.compiletime.unitialized`. The latter does not exist in Scala 2, so we use `= null`. We only used that during the construction of a `Deserializer` instance. It could theoretically affect performance, but not in any measurable way compared to everything else that happens in a `Deserializer`.
1 parent 7979531 commit 795d3e0

File tree

4 files changed

+31
-31
lines changed

4 files changed

+31
-31
lines changed

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ def otherScalaVersions = [
575575
"2.12.15"
576576
]
577577

578-
def scala3Version = "3.3.4"
578+
def scala3Version = "3.6.3"
579579

580580
def allESVersions = [
581581
"ES5_1",

ir/shared/src/main/scala/org/scalajs/ir/Hashers.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,9 @@ object Hashers {
136136
}
137137

138138
private final class TreeHasher {
139-
private[this] val digestBuilder = new SHA1.DigestBuilder
139+
private val digestBuilder = new SHA1.DigestBuilder
140140

141-
private[this] val digestStream = {
141+
private val digestStream = {
142142
new DataOutputStream(new OutputStream {
143143
def write(b: Int): Unit =
144144
digestBuilder.update(b.toByte)

ir/shared/src/main/scala/org/scalajs/ir/Serializers.scala

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -121,24 +121,24 @@ object Serializers {
121121
}
122122

123123
private final class Serializer {
124-
private[this] val bufferUnderlying = new JumpBackByteArrayOutputStream
125-
private[this] val buffer = new DataOutputStream(bufferUnderlying)
124+
private val bufferUnderlying = new JumpBackByteArrayOutputStream
125+
private val buffer = new DataOutputStream(bufferUnderlying)
126126

127-
private[this] val files = mutable.ListBuffer.empty[URI]
128-
private[this] val fileIndexMap = mutable.Map.empty[URI, Int]
127+
private val files = mutable.ListBuffer.empty[URI]
128+
private val fileIndexMap = mutable.Map.empty[URI, Int]
129129
private def fileToIndex(file: URI): Int =
130130
fileIndexMap.getOrElseUpdate(file, (files += file).size - 1)
131131

132-
private[this] val encodedNames = mutable.ListBuffer.empty[UTF8String]
133-
private[this] val encodedNameIndexMap = mutable.Map.empty[EncodedNameKey, Int]
132+
private val encodedNames = mutable.ListBuffer.empty[UTF8String]
133+
private val encodedNameIndexMap = mutable.Map.empty[EncodedNameKey, Int]
134134
private def encodedNameToIndex(encoded: UTF8String): Int = {
135135
val byteString = new EncodedNameKey(encoded)
136136
encodedNameIndexMap.getOrElseUpdate(byteString,
137137
(encodedNames += encoded).size - 1)
138138
}
139139

140-
private[this] val methodNames = mutable.ListBuffer.empty[MethodName]
141-
private[this] val methodNameIndexMap = mutable.Map.empty[MethodName, Int]
140+
private val methodNames = mutable.ListBuffer.empty[MethodName]
141+
private val methodNameIndexMap = mutable.Map.empty[MethodName, Int]
142142
private def methodNameToIndex(methodName: MethodName): Int = {
143143
methodNameIndexMap.getOrElseUpdate(methodName, {
144144
// need to reserve the internal simple names
@@ -159,12 +159,12 @@ object Serializers {
159159
})
160160
}
161161

162-
private[this] val strings = mutable.ListBuffer.empty[String]
163-
private[this] val stringIndexMap = mutable.Map.empty[String, Int]
162+
private val strings = mutable.ListBuffer.empty[String]
163+
private val stringIndexMap = mutable.Map.empty[String, Int]
164164
private def stringToIndex(str: String): Int =
165165
stringIndexMap.getOrElseUpdate(str, (strings += str).size - 1)
166166

167-
private[this] var lastPosition: Position = Position.NoPosition
167+
private var lastPosition: Position = Position.NoPosition
168168

169169
def serialize(stream: OutputStream, classDef: ClassDef): Unit = {
170170
// Write tree to buffer and record files, names and strings
@@ -988,16 +988,16 @@ object Serializers {
988988
private final class Deserializer(buf: ByteBuffer) {
989989
require(buf.order() == ByteOrder.BIG_ENDIAN)
990990

991-
private[this] var hacks: Hacks = _
992-
private[this] var files: Array[URI] = _
993-
private[this] var encodedNames: Array[UTF8String] = _
994-
private[this] var localNames: Array[LocalName] = _
995-
private[this] var labelNames: Array[LabelName] = _
996-
private[this] var simpleFieldNames: Array[SimpleFieldName] = _
997-
private[this] var simpleMethodNames: Array[SimpleMethodName] = _
998-
private[this] var classNames: Array[ClassName] = _
999-
private[this] var methodNames: Array[MethodName] = _
1000-
private[this] var strings: Array[String] = _
991+
private var hacks: Hacks = null
992+
private var files: Array[URI] = null
993+
private var encodedNames: Array[UTF8String] = null
994+
private var localNames: Array[LocalName] = null
995+
private var labelNames: Array[LabelName] = null
996+
private var simpleFieldNames: Array[SimpleFieldName] = null
997+
private var simpleMethodNames: Array[SimpleMethodName] = null
998+
private var classNames: Array[ClassName] = null
999+
private var methodNames: Array[MethodName] = null
1000+
private var strings: Array[String] = null
10011001

10021002
/** Uniqueness cache for FieldName's.
10031003
*
@@ -1008,13 +1008,13 @@ object Serializers {
10081008
* to make them all `eq`, consuming less memory and speeding up equality
10091009
* tests.
10101010
*/
1011-
private[this] val uniqueFieldNames = mutable.AnyRefMap.empty[FieldName, FieldName]
1011+
private val uniqueFieldNames = mutable.AnyRefMap.empty[FieldName, FieldName]
10121012

1013-
private[this] var lastPosition: Position = Position.NoPosition
1013+
private var lastPosition: Position = Position.NoPosition
10141014

1015-
private[this] var enclosingClassName: ClassName = _
1016-
private[this] var thisTypeForHack: Option[Type] = None
1017-
private[this] var patchDynamicImportThunkSuperCtorCall: Boolean = false
1015+
private var enclosingClassName: ClassName = null
1016+
private var thisTypeForHack: Option[Type] = None
1017+
private var patchDynamicImportThunkSuperCtorCall: Boolean = false
10181018

10191019
def deserializeEntryPointsInfo(): EntryPointsInfo = {
10201020
hacks = new Hacks(sourceVersion = readHeader())
@@ -2535,7 +2535,7 @@ object Serializers {
25352535
}
25362536

25372537
private class OptionBuilder[T] {
2538-
private[this] var value: Option[T] = None
2538+
private var value: Option[T] = None
25392539

25402540
def +=(x: T): Unit = {
25412541
require(value.isEmpty)

project/Build.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,7 @@ object Build {
10611061
*/
10621062
scalacOptions ++= {
10631063
if (scalaVersion.value.startsWith("3."))
1064-
List("-Ysafe-init")
1064+
List("-Wsafe-init")
10651065
else
10661066
Nil
10671067
},

0 commit comments

Comments
 (0)
0