diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/ic/fileUtil.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/ic/fileUtil.kt index 52515bddd35..dd2c317bc7c 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/ic/fileUtil.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/ic/fileUtil.kt @@ -25,7 +25,7 @@ data class CacheInfo(val path: String, val libPath: String, var flatHash: ULong, if (!info.exists()) return null - val (libPath, flatHash, transHash, configHash) = info.readLines() + val (libPath, _, flatHash, transHash, configHash) = info.readLines() // safe cast for the backward compatibility with the cache from the previous compiler versions val configHashULong = configHash.toULongOrNull(16) ?: 0UL diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/ic/invalidation.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/ic/invalidation.kt index cd48645d79f..a1519693e4d 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/ic/invalidation.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/ic/invalidation.kt @@ -218,10 +218,10 @@ private fun buildCacheForModule( cacheConsumer.commitLibraryInfo( libraryInfo.libPath.toCanonicalPath(), + irModule.name.asString(), libraryInfo.flatHash, libraryInfo.transHash, - libraryInfo.configHash, - irModule.name.asString() + libraryInfo.configHash ) } @@ -616,7 +616,7 @@ fun rebuildCacheForDirtyFiles( val currentIrModule = irModules.find { it.second == library }?.first!! - cacheConsumer.commitLibraryInfo(library.libraryFile.path.toCanonicalPath(), 0UL, 0UL, 0UL, currentIrModule.name.asString()) + cacheConsumer.commitLibraryInfo(library.libraryFile.path.toCanonicalPath(), currentIrModule.name.asString(), 0UL, 0UL, 0UL) buildCacheForModuleFiles( currentIrModule, diff --git a/compiler/ir/serialization.js/src/org/jetbrains/kotlin/ir/backend/js/ic/CacheAccessors.kt b/compiler/ir/serialization.js/src/org/jetbrains/kotlin/ir/backend/js/ic/CacheAccessors.kt index 43a144df69c..e0bdc4af6c0 100644 --- a/compiler/ir/serialization.js/src/org/jetbrains/kotlin/ir/backend/js/ic/CacheAccessors.kt +++ b/compiler/ir/serialization.js/src/org/jetbrains/kotlin/ir/backend/js/ic/CacheAccessors.kt @@ -190,7 +190,7 @@ class PersistentCacheProviderImpl(private val cachePath: String) : PersistentCac override fun moduleName(): String { val infoFile = File(File(cachePath), "info") - return infoFile.readLines()[3] + return infoFile.readLines()[1] } } @@ -203,7 +203,7 @@ interface PersistentCacheConsumer { fun commitSourceMap(path: String, mapData: ByteArray) fun invalidateForFile(path: String) - fun commitLibraryInfo(libraryPath: String, flatHash: ULong, transHash: ULong, configHash: ULong, moduleName: String) + fun commitLibraryInfo(libraryPath: String, moduleName: String, flatHash: ULong, transHash: ULong, configHash: ULong) companion object { val EMPTY = object : PersistentCacheConsumer { @@ -231,7 +231,7 @@ interface PersistentCacheConsumer { } - override fun commitLibraryInfo(libraryPath: String, flatHash: ULong, transHash: ULong, configHash: ULong, moduleName: String) { + override fun commitLibraryInfo(libraryPath: String, moduleName: String, flatHash: ULong, transHash: ULong, configHash: ULong) { } @@ -324,7 +324,7 @@ class PersistentCacheConsumerImpl(private val cachePath: String) : PersistentCac commitByteArrayToCacheFile(path, fileSourceMap, mapData) } - override fun commitLibraryInfo(libraryPath: String, flatHash: ULong, transHash: ULong, configHash: ULong, moduleName: String) { + override fun commitLibraryInfo(libraryPath: String, moduleName: String, flatHash: ULong, transHash: ULong, configHash: ULong) { val infoFile = File(File(cachePath), "info") if (infoFile.exists()) { infoFile.delete() @@ -333,10 +333,10 @@ class PersistentCacheConsumerImpl(private val cachePath: String) : PersistentCac PrintWriter(infoFile).use { it.println(libraryPath) + it.println(moduleName) it.println(flatHash.toString(16)) it.println(transHash.toString(16)) it.println(configHash.toString(16)) - it.println(moduleName) } } } diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/utils/JsIrIncrementalDataProvider.kt b/js/js.tests/test/org/jetbrains/kotlin/js/test/utils/JsIrIncrementalDataProvider.kt index e7f3aaba2ac..cfea5c6ca88 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/utils/JsIrIncrementalDataProvider.kt +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/utils/JsIrIncrementalDataProvider.kt @@ -112,7 +112,7 @@ class TestModuleCache(val files: MutableMap) { files.remove(path) } - override fun commitLibraryInfo(libraryPath: String, flatHash: ULong, transHash: ULong, configHash: ULong, moduleName: String) { + override fun commitLibraryInfo(libraryPath: String, moduleName: String, flatHash: ULong, transHash: ULong, configHash: ULong) { storedModuleName = moduleName } }