[JS IR] IC invalidation performance improvements

- Cache signature readers and deserializers
 - Cache inline function hashes
 - IC refactoring
 - [gradle] Use hash of module path for cache dir; Fix KT-51238

^KT-51238 Fixed
This commit is contained in:
Alexander Korepanov
2022-02-10 12:23:24 +03:00
committed by Space
parent 290a06676d
commit 43a0876c26
22 changed files with 315 additions and 257 deletions
@@ -202,6 +202,7 @@ interface PersistentCacheConsumer {
fun commitBinaryDts(path: String, dstData: ByteArray)
fun commitSourceMap(path: String, mapData: ByteArray)
fun invalidateForFile(path: String)
fun invalidate()
fun commitLibraryInfo(libraryPath: String, moduleName: String, flatHash: ULong, transHash: ULong, configHash: ULong)
@@ -227,6 +228,9 @@ interface PersistentCacheConsumer {
override fun invalidateForFile(path: String) {
}
override fun invalidate() {
}
override fun commitBinaryAst(path: String, astData: ByteArray) {
}
@@ -303,6 +307,10 @@ class PersistentCacheConsumerImpl(private val cachePath: String) : PersistentCac
//fileDir.deleteRecursively()
}
override fun invalidate() {
File(cachePath).deleteRecursively()
}
private fun commitByteArrayToCacheFile(fileName: String, cacheName: String, data: ByteArray) {
val fileId = createFileCacheId(fileName)
val cacheDir = File(File(cachePath), fileId)