[JS IR] IC: support per-module in K2JsIrCompiler

This commit is contained in:
Anton Bannykh
2021-12-17 16:35:58 +03:00
parent ca60caa7e9
commit 4c33cb8016
5 changed files with 22 additions and 23 deletions
@@ -200,7 +200,8 @@ class PersistentCacheProviderImpl(private val cachePath: String) : PersistentCac
}
override fun moduleName(): String {
TODO("Not yet implemented")
val infoFile = File(File(cachePath), "info")
return infoFile.readLines()[3]
}
}
@@ -214,8 +215,7 @@ interface PersistentCacheConsumer {
fun commitSourceMap(path: String, mapData: ByteArray)
fun invalidateForFile(path: String)
fun commitLibraryPath(libraryPath: String, flatHash: ULong, transHash: ULong)
fun commitModuleName(moduleName: String)
fun commitLibraryInfo(libraryPath: String, flatHash: ULong, transHash: ULong, moduleName: String)
companion object {
val EMPTY = object : PersistentCacheConsumer {
@@ -246,7 +246,7 @@ interface PersistentCacheConsumer {
}
override fun commitLibraryPath(libraryPath: String, flatHash: ULong, transHash: ULong) {
override fun commitLibraryInfo(libraryPath: String, flatHash: ULong, transHash: ULong, moduleName: String) {
}
@@ -257,9 +257,6 @@ interface PersistentCacheConsumer {
override fun commitSourceMap(path: String, mapData: ByteArray) {
}
override fun commitModuleName(moduleName: String) {
}
}
}
}
@@ -348,7 +345,7 @@ class PersistentCacheConsumerImpl(private val cachePath: String) : PersistentCac
commitByteArrayToCacheFile(path, fileSourceMap, mapData)
}
override fun commitLibraryPath(libraryPath: String, flatHash: ULong, transHash: ULong) {
override fun commitLibraryInfo(libraryPath: String, flatHash: ULong, transHash: ULong, moduleName: String) {
val infoFile = File(File(cachePath), "info")
if (infoFile.exists()) {
infoFile.delete()
@@ -359,10 +356,7 @@ class PersistentCacheConsumerImpl(private val cachePath: String) : PersistentCac
it.println(libraryPath)
it.println(flatHash.toString(16))
it.println(transHash.toString(16))
it.println(moduleName)
}
}
override fun commitModuleName(moduleName: String) {
TODO("Not yet implemented")
}
}