[Klib] Split up IR header tables onto three parts

There was one monolith protobuf at irHeader.knd, it was
split up onto 4 parts due to performance issues:
  - a small irHeader with some basic info about a module
  - symbols table
  - types table
  - strings table
These 3 tables are then mmapped and accessed by index.
This commit is contained in:
Igor Chevdar
2019-06-05 19:56:31 +03:00
parent 5faccaa49e
commit 3e8f3e6f00
14 changed files with 315 additions and 519 deletions
@@ -36,6 +36,15 @@ class JsIrLinker(
override val ModuleDescriptor.irHeader: ByteArray?
get() = this.kotlinLibrary.irHeader
override fun readSymbol(moduleDescriptor: ModuleDescriptor, symbolIndex: Int) =
moduleDescriptor.kotlinLibrary.symbol(symbolIndex)
override fun readType(moduleDescriptor: ModuleDescriptor, typeIndex: Int) =
moduleDescriptor.kotlinLibrary.type(typeIndex)
override fun readString(moduleDescriptor: ModuleDescriptor, stringIndex: Int) =
moduleDescriptor.kotlinLibrary.string(stringIndex)
override fun declareForwardDeclarations() {
// since for `knownBuiltIns` such as FunctionN it is possible to have unbound symbols after deserialization
// reference them through out lazy symbol table
@@ -48,5 +57,4 @@ class JsIrLinker(
ArrayList(unboundTypeParameters).forEach { lazyWrapper.referenceTypeParameter(it.descriptor) }
}
}
}
}