63c24c56ec
Instead of multiple .kjsm files for different classes and .kotlin_string_table, .kotlin_file_table, .kotlin_classes files for each package, serialize the contents of each package to a single foo/bar/baz/baz.kjsm file. The short name of the file is the last segment in the FQ name of the package, or "root-package" if the package is root. There are two main reasons for this change: 1) Such structure takes less space, is more IO-friendly and will not cause multiple exceptions as the old one, where we sometimes tried to read non-existing files 2) This is exactly the same format that is used to serialize built-in declarations (.kotlin_builtins) at the moment, which will allow us to reuse some code Also write a separate Header protobuf message to the beginning of the .kjsm file. This will be used as arguments of the kotlin.Metadata annotation are used in the JVM-specific parts of the compiler: to be able to provide some general information about the binary file without parsing the whole protobuf data. This commit breaks decompiled text & stub builder consistency tests. This is OK because they're removed in a future commit. Fixes EA-79605, EA-81947, EA-84277 and maybe EA-86787 #KT-10894 Fixed #KT-14124 Fixed #KT-15755 Fixed