Commit Graph

438 Commits

Author SHA1 Message Date
Alexander Udalov 5dd1777624 IR: minor, deprecate nameForIrSerialization, use name instead 2022-12-15 12:31:11 +00:00
Sergej Jaskiewicz 1539d7ef1a [klib] Bring package names in sync with the directory layout
Basically, some package names were Native-specific, whilst the packages
themselves were not Native-specific at all. This was already reflected
in the directory layout, but not in the package names.
This is fixed here.

NFC, just an automatic rename of packages with fixes of imports.
2022-12-01 21:46:43 +00:00
Ilya Chernikov 0fbc099d32 FIR JS: Refactor Klib serialization for FIR support 2022-11-12 14:34:07 +01:00
Ilya Chernikov 8bf108dc17 FIR JS: Prepare JS/KLib infrastructure for FIR integration
rearrange declarations, abstract things that should be done differently
with FIR, etc.
2022-11-12 14:34:07 +01:00
Alexander Korepanov dbf31b206c [Common IR] Move local class from function to avoid a leak 2022-11-01 13:46:39 +00:00
Dmitriy Dolovov f7d2dfd729 [IR] Linker: Small improvements 2022-10-20 10:18:57 +02:00
Dmitriy Dolovov f846ecf7d7 [IR] Partial linkage: Avoid overriding of private callable members
^KT-53608
2022-10-20 10:18:55 +02:00
Dmitriy Dolovov 84b3e7bfbe [IR] Minor: Code cleanup 2022-10-20 10:18:55 +02:00
Dmitriy Dolovov 71d51801ce [IR] Partial linkage fix: Implement abstract fake overrides in non-abstract classes so that there are no call sites that still refer to abstract fake overrides
^KT-53663
2022-10-20 10:18:54 +02:00
Dmitriy Dolovov 859c465b9e [IR] Rename IrFakeOverride[Function|Property] to Ir[Function|Property]WithLateBinding
^KT-53663
2022-10-20 10:18:54 +02:00
Dmitriy Dolovov 12c6015d5e [IR] Partial linkage: report the exact IR element where unlinked symbols are used 2022-10-20 10:18:52 +02:00
Dmitriy Dolovov 2f9d6f6c44 [IR] Partial linkage: Rename UnlinkedDeclarationsSupport to PartialLinkageSupport 2022-10-19 13:46:22 +00:00
Dmitriy Dolovov 15635482aa [IR] Partial linkage: Enable it by just passing a boolean flag to IR linker constructor 2022-10-19 13:46:22 +00:00
Dmitriy Dolovov a0fdf08b56 [IR] Partial linkage: unify UnlinkedDeclarationsSupport for JS and Native backends 2022-10-19 13:46:21 +00:00
Pavel Kunyavskiy 95eaf3d234 [K/N] Add lowered suspend function mangling to avoid clashes 2022-09-30 08:48:59 +00:00
Dmitriy Dolovov e4556ecc0d [IR] User-friendly message about unexpected unlinked symbols
^KT-53649
2022-09-13 17:12:13 +00:00
Nikita Bobko 2a4f3f41aa 2/5 Replace source dependency on kotlin-reflect with binary dependency
Review: https://jetbrains.team/p/kt/reviews/6753

Meaningful semantic change was splitted into 5 commits to simplify the
change review. Sinle commit would be too big.

Why replace source to binary: to get rid of kotlin-reflect in Kotlin
plugin artifact KTIJ-22276

Note: Kotlin Maven artifacts (./gradlew publish) changed their
dependency on kotlin-reflect
2022-08-22 15:43:49 +02:00
Nikita Bobko 0874fb71c6 Replace all kotlin-reflect-api dependencies with kotlin-reflect
Review: https://jetbrains.team/p/kt/reviews/6753

Why: I'm going to replace source dependency on kotlin-reflect with
binary dependency. Normalize reflect dependency before global
processing.
2022-08-22 15:43:11 +02:00
Vsevolod Tolstopyatov 1b6a43ba69 Update IR serialization to reflect changes in IrSyntheticBodyKind for enum entries
#KT-48872
2022-08-12 09:35:19 +00:00
Igor Chevdar 7e79b2b500 [K/N][IR][codegen] Preliminary support of per-file caches 2022-08-06 17:40:23 +00:00
Dmitriy Dolovov 532b9e2c5f [Native][IR] Partial linkage support for cached inline functions
- Support partial linkage for declarations from inline functions that are lazily deserialized from a KLIB with static cache
- Linker API: Split IrModuleDeserializer.deserializeIrSymbol() into deserializeIrSymbolOrFail() and tryDeserializeIrSymbol()
- Linker API: Refactor KotlinIrLinker.handleSignatureIdNotFoundInModuleWithDependencies() to deserializeOrReturnUnboundIrSymbolIfPartialLinkageEnabled()

^KT-52478
2022-07-18 17:29:50 +02:00
Dmitriy Dolovov 6a227236f8 [IR] Fix location in logging warnings about unlinked symbols 2022-07-18 17:29:50 +02:00
Dmitriy Dolovov f9d7f54838 [IR] Fix unlinked type for variables 2022-07-18 17:29:50 +02:00
Dmitriy Dolovov 2cf5d26edc [IR] JsIrLinker: Drop excessive maybeWrapWithBuiltInAndInit() function
^KT-52478
2022-07-18 17:29:50 +02:00
Igor Chevdar 747bff4036 [K/N][caches] Fixed parents for deserialized on demand inline function
#KT-52974 Fixed
2022-07-10 17:56:37 +00:00
Dmitriy Novozhilov 83d0a3e7a3 [FIR] Extract FirPluginKey into :core:compiler.common and rename it to GeneratedDeclarationKey
This is needed to avoid dependency on :compiler:fir:fir2ir module in
  backend parts of compiler plugins. It will allow to publish those
  parts into jars for IDE, where they are needed for working of debugger
  and bytecode toolwindow
2022-06-07 14:12:25 +00:00
Georgy Bronnikov ad625a4631 Fir2Ir: deal with Java fields in FirIrProvider 2022-05-19 12:02:43 +02:00
Georgy Bronnikov 0ef474a8d3 Do not set parent for deserialized IR declarations 2022-05-19 12:02:42 +02:00
Georgy Bronnikov 0012ba79e1 Fir2Ir: rework FirIrProvider 2022-05-19 12:02:41 +02:00
Dmitriy Dolovov 8de4eb798c [IR] Fix removal-of-abstract-fun IR linkage case
^KT-50771
2022-05-18 18:05:09 +03:00
Igor Chevdar f62e4e7b97 [klibs] Refactored BasicIrModuleDeserializer 2022-04-28 19:11:14 +00:00
Igor Chevdar 31eedebec6 [klibs] Added deserialization strategy: on-demand
With on-demand strategy only file header is deserialized
2022-04-28 19:11:13 +00:00
Igor Chevdar 231fe42c0a [klibs] Fixed a bug in the signature-to-descriptor searcher
#KT-51927 Fixed
2022-04-14 07:33:56 +00:00
Pavel Kunyavskiy 7ba4d9e1f0 Rework nullability in IR 2022-03-30 06:27:59 +00:00
Evgeniy.Zhelenskiy 28bf83ceac [IR] Unite inline class and multi-field value class representation
#KT-1179
2022-03-24 11:38:43 +00:00
Victor Petukhov b5933c70e2 [FE 1.0] Refactor error utils: split error entities and introduce error type and error scope kinds 2022-03-23 21:13:33 +00:00
Sergey Bogolepov 2f46a45bfd [IR] Deserialize annotation classes as open
Compiler backend relies on the fact that all annotation classes have
OPEN modality. This is not the case for libraries that were compiled
before 1.6.20. 948dc4f3 fixes compatibility for Lazy IR, here we do the
same for IR deserializer.

^KT-51302 fixed
2022-02-17 11:12:57 +00:00
Roman Artemev 412194dd75 [KLIB] Fix DNN type key in serializer 2022-02-11 18:24:32 +00:00
Dmitry Petrov 1fd2b9c9d9 IR fix DNN type mangling 2022-02-11 18:24:32 +00:00
Alexander Udalov 6379fe4c4c JVM IR: link via descriptors instead of signatures by default
Doing so speeds up psi2ir ~2 times, and thus improves total compiler
performance by about 6-8%.

Unless JVM IR is in the mode where linking via signatures is the only
way (-Xserialize-ir, -Xklib), signatures are actually not needed at all,
SymbolTable can use the frontend representation (descriptors for FE1.0,
and hopefully FIR elements for K2) as hash table keys. The only catch is
that since other backends still need to work with signatures, all the
common IR utilities, such as irTypePredicates.kt, need to work correctly
for IR elements both with signatures and without.

Also, introduce a fallback compiler flag -Xlink-via-signatures, in case
something goes wrong, to be able to troubleshoot and workaround any
issues.

 #KT-48233
2022-02-03 02:48:05 +01:00
Igor Chevdar 949e222305 [IR] Fixed a problem with signature search
The function findDescriptorBySignature should return null if no such signature has been found
letting the caller to handle this correctly. Fixes https://youtrack.jetbrains.com/issue/KT-50976
2022-02-02 22:46:16 +05:00
Georgy Bronnikov d2418a1329 IR: never attach return type to signatures of fake overrides
Cases that necessitate the return type hack (see KT-46042) always
involve exactly two methods, exactly one of which is a fake override. It
is sufficient to mark one of them.
2022-01-27 01:02:25 +03:00
Georgy Bronnikov f0fb0cbefe IR: remove IdSignatureBuilder.isKotlinPackage() 2022-01-27 01:02:23 +03:00
Georgy Bronnikov 6a3a375372 IR: pass DescriptorByIdSignatureFinder as parameter to DeclarationStubGeneratorimpl
This breaks dependency between serialization.common and psi2ir modules.
2022-01-27 01:02:23 +03:00
Georgy Bronnikov 3f91674090 IR: inline and remove ...FromLinker methods from SymbolTable 2022-01-27 01:02:22 +03:00
Georgy Bronnikov eda913554d IR: compute correct IR-based mangles for Java fields 2022-01-27 01:02:17 +03:00
Georgy Bronnikov 4d2bcf7e66 IR: compute file local signatures from descriptors 2022-01-27 01:02:16 +03:00
Georgy Bronnikov b6ddd758ec IR: fix deserialization of publicly visible type parameters 2022-01-27 01:02:15 +03:00
Georgy Bronnikov 3cc883cf7b IR: use DescriptorBySignatureFinder in DeclarationStubGenerator
Duplicating code that was used for the same purpose in
DeclarationStubGenerator is removed.
2022-01-27 01:02:14 +03:00
Dmitriy Dolovov 24b011436c [IR] Improve partial linkage error messages
^KT-50775
2022-01-26 13:36:24 +03:00