"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "build-common/src/org/jetbrains/kotlin/incremental/IncrementalJvmCache.kt" between
kotlin-1.3.20.tar.gz and kotlin-1.3.21.tar.gz

About: Kotlin is a Java like statically typed programming language for the JVM, Android and the browser. Source code.

IncrementalJvmCache.kt  (kotlin-1.3.20):IncrementalJvmCache.kt  (kotlin-1.3.21)
skipping to change at line 353 skipping to change at line 353
override fun dumpValue(value: SerializedJavaClass): String = override fun dumpValue(value: SerializedJavaClass): String =
java.lang.Long.toHexString(value.proto.toByteArray().md5()) java.lang.Long.toHexString(value.proto.toByteArray().md5())
} }
// todo: reuse code with InlineFunctionsMap? // todo: reuse code with InlineFunctionsMap?
private inner class ConstantsMap(storageFile: File) : BasicStringMap<Map<Str ing, Any>>(storageFile, ConstantsMapExternalizer) { private inner class ConstantsMap(storageFile: File) : BasicStringMap<Map<Str ing, Any>>(storageFile, ConstantsMapExternalizer) {
private fun getConstantsMap(bytes: ByteArray): Map<String, Any> { private fun getConstantsMap(bytes: ByteArray): Map<String, Any> {
val result = HashMap<String, Any>() val result = HashMap<String, Any>()
ClassReader(bytes).accept(object : ClassVisitor(Opcodes.ASM5) { ClassReader(bytes).accept(object : ClassVisitor(Opcodes.API_VERSION) {
override fun visitField(access: Int, name: String, desc: String, signature: String?, value: Any?): FieldVisitor? { override fun visitField(access: Int, name: String, desc: String, signature: String?, value: Any?): FieldVisitor? {
val staticFinal = Opcodes.ACC_STATIC or Opcodes.ACC_FINAL or Opcodes.ACC_PRIVATE val staticFinal = Opcodes.ACC_STATIC or Opcodes.ACC_FINAL or Opcodes.ACC_PRIVATE
if (value != null && access and staticFinal == Opcodes.ACC_S TATIC or Opcodes.ACC_FINAL) { if (value != null && access and staticFinal == Opcodes.ACC_S TATIC or Opcodes.ACC_FINAL) {
result[name] = value result[name] = value
} }
return null return null
} }
}, ClassReader.SKIP_CODE or ClassReader.SKIP_DEBUG or ClassReader.SK IP_FRAMES) }, ClassReader.SKIP_CODE or ClassReader.SKIP_DEBUG or ClassReader.SK IP_FRAMES)
return result return result
skipping to change at line 473 skipping to change at line 473
} }
private inner class InlineFunctionsMap(storageFile: File) : private inner class InlineFunctionsMap(storageFile: File) :
BasicStringMap<Map<String, Long>>(storageFile, StringToLongMapExternaliz er) { BasicStringMap<Map<String, Long>>(storageFile, StringToLongMapExternaliz er) {
private fun getInlineFunctionsMap(header: KotlinClassHeader, bytes: Byte Array): Map<String, Long> { private fun getInlineFunctionsMap(header: KotlinClassHeader, bytes: Byte Array): Map<String, Long> {
val inlineFunctions = inlineFunctionsJvmNames(header) val inlineFunctions = inlineFunctionsJvmNames(header)
if (inlineFunctions.isEmpty()) return emptyMap() if (inlineFunctions.isEmpty()) return emptyMap()
val result = HashMap<String, Long>() val result = HashMap<String, Long>()
ClassReader(bytes).accept(object : ClassVisitor(Opcodes.ASM5) { ClassReader(bytes).accept(object : ClassVisitor(Opcodes.API_VERSION) {
override fun visitMethod( override fun visitMethod(
access: Int, access: Int,
name: String, name: String,
desc: String, desc: String,
signature: String?, signature: String?,
exceptions: Array<out String>? exceptions: Array<out String>?
): MethodVisitor? { ): MethodVisitor? {
val dummyClassWriter = ClassWriter(Opcodes.ASM5) val dummyClassWriter = ClassWriter(Opcodes.API_VERSION)
return object : MethodVisitor(Opcodes.ASM5, dummyClassWriter .visitMethod(0, name, desc, null, exceptions)) { return object : MethodVisitor(Opcodes.API_VERSION, dummyClas sWriter.visitMethod(0, name, desc, null, exceptions)) {
override fun visitEnd() { override fun visitEnd() {
val jvmName = name + desc val jvmName = name + desc
if (jvmName !in inlineFunctions) return if (jvmName !in inlineFunctions) return
val dummyBytes = dummyClassWriter.toByteArray()!! val dummyBytes = dummyClassWriter.toByteArray()!!
val hash = dummyBytes.md5() val hash = dummyBytes.md5()
result[jvmName] = hash result[jvmName] = hash
} }
} }
} }
 End of changes. 4 change blocks. 
4 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)