Permalink
Browse files

removing remnants from the GenJVM era

  • Loading branch information...
1 parent 449da43 commit af0184d366cc7c72e8140bc018afd710abd95beb @magarciaEPFL magarciaEPFL committed Mar 24, 2013
@@ -379,7 +379,6 @@ abstract class GenASM extends SubComponent with BytecodeWriters with GenJVMASM {
private val classfileVersion: Int = settings.target.value match {
case "jvm-1.5" => asm.Opcodes.V1_5
- case "jvm-1.5-asm" => asm.Opcodes.V1_5
case "jvm-1.6" => asm.Opcodes.V1_6
case "jvm-1.7" => asm.Opcodes.V1_7
}
@@ -124,22 +124,19 @@ trait AnnotationInfos extends api.Annotations { self: SymbolTable =>
*/
case class ScalaSigBytes(bytes: Array[Byte]) extends ClassfileAnnotArg {
override def toString = (bytes map { byte => (byte & 0xff).toHexString }).mkString("[ ", " ", " ]")
- lazy val encodedBytes = ByteCodecs.encode(bytes) // TODO remove after migration to ASM-based GenJVM complete
- def isLong: Boolean = (encodedBytes.length > 65535) // TODO remove after migration to ASM-based GenJVM complete
lazy val sevenBitsMayBeZero: Array[Byte] = {
mapToNextModSevenBits(scala.reflect.internal.pickling.ByteCodecs.encode8to7(bytes))
}
def fitsInOneString: Boolean = {
val numZeros = (sevenBitsMayBeZero count { b => b == 0 })
- val res = (sevenBitsMayBeZero.length + numZeros) <= 65535
- assert(this.isLong == !res, "As things stand, can't just swap in `fitsInOneString()` for `isLong()`")
- res
+
+ (sevenBitsMayBeZero.length + numZeros) <= 65535
}
def sigAnnot: Type =
- if (this.isLong)
- definitions.ScalaLongSignatureAnnotation.tpe
- else
+ if (fitsInOneString)
definitions.ScalaSignatureAnnotation.tpe
+ else
+ definitions.ScalaLongSignatureAnnotation.tpe
private def mapToNextModSevenBits(src: Array[Byte]): Array[Byte] = {
var i = 0

0 comments on commit af0184d

Please sign in to comment.