Commit Graph

532 Commits

Author SHA1 Message Date
Dmitry Petrov d23f13e3dc IR serialization: IrSimpleFunction.isFakeOverride 2019-11-01 14:55:09 +03:00
Ilya Matveev 955300dd34 Deserializer: Fix initialization of private top-levels
Consider a file with only private top-level properties compiled into
a klib. If this klib is deserialized with deserializationStrategy.ALL
(e.g. if this library if passed using the -Xinclude flag),
initializers of these properties will not be generated  in a final
binary.

This patch fixes this error by unconditionally adding IrFiles into
deserialization queue if deserializationStrategy.ALL is specified.

Issue #KT-34722 fixed
2019-11-01 12:02:59 +03:00
Ilya Matveev 7c4033f0bf Deserializer: Fix initialization order
Top-level initializers must be deserialized in the same order they
where in the original source file. Before this patch this rule might
be violated. Consider the following case:

// lib1.kt
val a = 5
val b = a * 5

// lib2.kt
fun foo() = println(b)

Compile both files into libraries and then link an application
against them. During deserialization of lib2 'b' will be added
to the deserialization queue of lib1. After that we will add 'a'
to this queue too. Thus 'b' and 'a' will be in a wrong order
in this queue resulting in a wrong order of corresponding
top-level initializers in a final executable.

This patch fixes this issue by adding all top-level initializers
to a deserialization queue before all other declarations.
2019-10-31 14:51:56 +03:00
Alexander Gorshenev 597e760fab Broght back a condition lost during a refactoring 2019-10-21 17:41:56 +03:00
Roman Artemev 2cde7f2402 [KLIB] Fix explicitlyExported mode
- Refactor deserialization pipeline
 - Fix K/N test
2019-10-21 17:41:56 +03:00
Roman Artemev 43e855150c [KLIB] Correctly restore top level property order during deserialization - Add test - Fix KT-34273 2019-10-21 17:41:56 +03:00
Dmitry Petrov 69a9559eac IR serialization: isExpect in proto and ser/deser 2019-10-21 13:04:59 +03:00
Dmitry Petrov 922b1e576d IR serialization: isExpect (TODO actual value in proto) 2019-10-21 13:04:59 +03:00
Alexander Udalov 65c09a5e57 Minor, use experimental unsigned types in CityHash
This fixes 233 experimental usage API warnings
2019-10-16 15:00:31 +02:00
Anton Bannykh 82e8bcfca9 Proto: update the workaround which reduces memory allocations 2019-10-11 13:58:22 +03:00
Vitaliy.Tikhonov 62885ba497 [JS SCRIPTING] create compilers for scripting 2019-10-10 12:52:06 +03:00
Roman Artemev d5176cbf5d [IR SERIALIZATION] Get rid of UniqId proto message
- encode locality flag in major bit of uniqid (1 - global, 0 - local)
2019-10-09 13:23:18 +03:00
Roman Artemev fcae5873d0 [IR SERIALIZATION] Get rid of Annotations message 2019-10-09 13:23:18 +03:00
Roman Artemev aeafaf78f1 [IR SERIALIZATION] Replace DescriptorReference boolean fields with single flag in proto 2019-10-09 13:23:13 +03:00
Roman Artemev 105fc4b0ca [IR SERIALIZATION] Get rid of FqName 2019-10-09 13:06:01 +03:00
Roman Artemev 9fa89bf7e2 [IR SERIALIZATION] Get rid of IrDataIndex 2019-10-09 13:06:01 +03:00
Alexander Gorshenev e5dbec4523 Commonized FileRegistry with SourceFileMap for klib metadata 2019-10-08 16:56:29 +03:00
Alexander Gorshenev c227c13799 Commonizing klib metadata between native and js 2019-10-01 17:38:57 +03:00
Roman Artemev e5a1040dbd [KLIB] Fix references to private top-level typealias via type abbreviation 2019-09-10 19:59:01 +03:00
Alexander Udalov bf5ca2ed84 Cleanup compiler warnings in IR-related modules 2019-09-03 19:32:57 +02:00
Roman Artemev 6bea403338 [KLIB] Fix ir serializer output format 2019-09-03 14:21:32 +03:00
Roman Artemev 1e547dd1cd [IR SERIALIZATION] Add more informative error message 2019-09-03 14:21:31 +03:00
Roman Artemev 31f3e668d2 [IR SERIALIZATION] Cleanup mangler interface 2019-09-03 14:21:31 +03:00
Roman Artemev 2e0ab8ba3f [IR SERIALIZATION] Fix ONLY_DECLARATION_HEADERS mode 2019-09-03 14:21:31 +03:00
Roman Artemev 0c7454c918 [IR SERIALIZATION] Fix forward Declarations in deserializaer 2019-09-03 14:21:31 +03:00
Roman Artemev 2bd3d90fe0 [IR SERIALIZATION] Link depend modules lazily 2019-09-03 14:21:31 +03:00
Roman Artemev aa8b58e396 [IR SERIALIZATION] Get rid of UniqIdKey 2019-09-03 14:21:31 +03:00
Roman Artemev 55f06ecff5 [IR SERIALIZATION] Fix rebase 2019-09-03 14:21:30 +03:00
Roman Artemev 16be3b6d6e [IR SERIALIZATION] Add deserializaFullModule API 2019-09-03 14:21:30 +03:00
Roman Artemev d9affc5abb [IR SERIALIZATION] Raname IrIrSeriazlizedIrFile -> SerializedIrFile 2019-09-03 14:21:30 +03:00
Roman Artemev f6339bcf93 [IR SERIALIZATION] Handle UniqId clashes 2019-09-03 14:21:30 +03:00
Roman Artemev 5e14b94a88 [IR SERIALIZATION] Do not track non-metadata descriptors in descriptor table 2019-09-03 14:21:30 +03:00
Roman Artemev df5f6a2a12 [IR SERIALIZATION] Refactored uniqId allocation
- split DeclarationTable into local and global one
 - minimize usages of kotlin mangler
 - clean up interfaces
2019-09-03 14:21:30 +03:00
Roman Artemev 19b5d57f0e [IR PROTO] Delete unused proto.java files 2019-09-03 14:21:30 +03:00
Roman Artemev b7b951c8c8 [IR] Refactoring 2019-09-03 14:21:30 +03:00
Roman Artemev ea42eb6a5c [IR] Fix rebase 2019-09-03 14:21:29 +03:00
Roman Artemev d50eb5ce52 [IR SERIALIZATION] Make [de]serialization processes incremental
- Use local uniqID local indexation file-local
 - Rethink the way declaration is looked for
 - Store in public file index only publicly accessible symbols
 - refactor API
 - code clean up
2019-09-03 14:21:29 +03:00
Roman Artemev 96a2cc1f17 [JS IR] Clean up Declaration Table code 2019-09-03 14:21:29 +03:00
Roman Artemev a7714a5589 [JS IR BE] Split IrModule/IrFile serializers 2019-09-03 14:21:29 +03:00
Roman Artemev 15a49cf2aa [IR BE] Rename IrModuleSerializer -> IrFileSerializer 2019-09-03 14:21:29 +03:00
Roman Artemev 94a03c9cb4 [IC KLIB] Serialization infrastructure refactoring
- remove IrModule header
 - put IrDeclaration and its body into separate files
 - use only one type of IrData index
 - separate deserialization of declarations and its bodies
 - introduce FqName message
2019-09-03 14:21:29 +03:00
Roman Artemev 5a45960c04 [IR] Do not interact with file system during Ir Serialization
- make `IrModuleSerializer` produce ByteArrays with serialized data
 - isolate file system access on Klib writer
2019-09-03 14:21:28 +03:00
Ilya Matveev cafe2cdb12 IR: Fix fake-override resolution for fields
Earlier we used a result of a corresponding getter resolution to
obtain a fake overridden field. This approach is incorrect because
the getter resolved may not contain a backing field. This patch
fixes the issue by using the overriddenSymbols property of an
IrField directly.

Issue #KT-33034 fixed
2019-08-13 19:56:45 +07:00
Igor Chevdar 226013353d [IrSerializer] Removed hacks with functional interfaces 2019-08-12 17:07:43 +03:00
Igor Chevdar 00dc335559 [IrSerializer] Preparations for functional interfaces handling 2019-08-12 17:07:43 +03:00
Dmitry Petrov f590d4da9e IR: IrTypeAlias: serialize/deserialize new IR objects
Add uniqId for typealias declarations.
Implement WrappedTypeAliasDescriptor.
2019-08-06 12:42:43 +03:00
Dmitry Petrov 92984b2626 Serialize/deserialize IrFunctionExpression 2019-07-19 11:36:19 +03:00
Dmitry Petrov 28215186ca IR serialization: migrate to new generated Java classes structure 2019-07-17 12:00:34 +03:00
Dmitry Petrov 8baa7dfe22 Generated Java classes for Kotlin IR protobuf 2019-07-17 12:00:34 +03:00
Dmitry Petrov 2305bea2b5 Generate IR protobuf classes as multiple Java files
Otherwise KotlinIr.java becomes too big for IDEA to swallow in the
default configuration.
2019-07-17 12:00:34 +03:00