Georgy Bronnikov
4caa71538d
JVM_IR: introduce modes for IR serialization
...
Instead of a Boolean flag -Xserialize-ir, use modes: none,inline,all.
In "inline" mode, only information needed to deserialize bodies of inline
functions is serialized.
In the "all" mode, all declarations are serialized completely.
2021-10-11 11:53:29 +03:00
Roman Artemev
e6de812788
[IR] Implement checker for friendship of modules in fake override builder
...
- pass corresponding information to FO builder
- implement check
- fix KT-47192 and KT-48673
2021-10-07 16:00:49 +03:00
Roman Artemev
ba759fb61b
[IR] Fix compatibility mode
...
- pass corresponding flag to mangler
- properly handle local declarations in field initializers
- fix KT-48912
2021-10-06 03:47:20 +03:00
Alexander Udalov
6e93006a94
JVM IR: slightly optimize keepTrackOfOverridesForPossiblyClashingFakeOverride
...
Collecting all outer classes into a hash set and looking up classifiers
in that set for each type of each fake override is noticeably slow.
Instead, check that function types reference any type parameter whose
container is a class; if the function is not local, it means such type
parameter belongs to one of the outer classes.
#KT-42020
2021-10-05 12:16:24 +02:00
Georgy Bronnikov
8a459821d0
JVM_IR: avoid double encoding of byte strings
...
IrLibraryFile, ingerited from Klib code, needed types, bodies, strings,
signatures encoded as byte strings.
When we store this data as class annotations, it is better to store it
as protobuf structs, to avoid re-encoding byte streams twice.
2021-10-01 00:58:06 +03:00
Vyacheslav Gerasimov
ab146bd6d4
Build: Fix deprecated Gradle configurations usages
...
for migration to Gradle 7+ #KTI-559
2021-09-26 18:28:44 +03:00
Roman Artemev
78cd45f937
[KLIB] Resolve deserialization on for each file separately
...
Needs for IC
2021-09-07 20:41:28 +03:00
Roman Artemev
5a7298808e
[JVM KLIB] Fix Type Parameter resolve
2021-08-06 20:49:19 +03:00
Roman Artemev
b1251c1716
[JS IC] Drop special IdSignatureSerializer for IC
2021-08-06 20:49:04 +03:00
Roman Artemev
0310f7cb0b
[JS IC] Lot of fixes after rebase
2021-07-22 21:56:57 +03:00
Ilya Chernikov
dee0487185
IR: Refactor IrBuiltIns to abstract it from descriptors
2021-07-16 02:24:18 +03:00
Georgy Bronnikov
8c3386b607
IR: set file in declarationTable when serializing IR
2021-07-14 21:20:46 +03:00
Georgy Bronnikov
da946e464f
Fix compilation after rebase: add debugInfo to JvmIr.proto
2021-07-14 21:20:43 +03:00
Georgy Bronnikov
f4d358069c
Fixes after rebase, not related to IrLibraryFile
2021-07-14 21:20:42 +03:00
Georgy Bronnikov
08b950fc2a
JVM_IR: Supply fake file name to signatures of file local declarations
2021-07-14 21:20:41 +03:00
Georgy Bronnikov
fa4efd3303
JVM_IR: fix deserialization of Java static field symbols
2021-07-14 21:20:35 +03:00
Georgy Bronnikov
7bbc04b6a2
JVM_IR: reconstruct fake overrides after IR deserialization.
...
We need to keep track of local signatures for deserialized symbols.
2021-07-14 21:20:29 +03:00
Georgy Bronnikov
a63cc95a2a
JVM_IR: untangle backend.jvm and serialization.jvm (again)
2021-07-14 21:20:28 +03:00
Georgy Bronnikov
96ce124268
JVM_IR: serialize fake overrides in IR
2021-07-14 21:20:21 +03:00
Georgy Bronnikov
6b80c00cc6
JVM_IR: deserialize lazy declarations
2021-07-14 21:20:14 +03:00
Georgy Bronnikov
ab3d6490ed
JVM_IR: save auxTables as byte strings
2021-07-14 21:20:09 +03:00
Georgy Bronnikov
b2617199bc
JVM_IR: call serialization for IR.
...
Serializer for IR is called when -Xserialize-ir flag is set.
2021-07-14 21:20:04 +03:00
Georgy Bronnikov
9efd0d7589
JVM_IR: JvmIrSerializer
2021-07-14 21:20:02 +03:00
Alexander Udalov
173e194dac
Remove dependency on JVM specifics in serialization.common
...
Move handling of EnhancedNullability to JVM subclasses in
serialization.jvm. Looks like this was possible because of accidental
dependency of frontend on compiler.common.jvm introduced in 564d382b9d .
Also fix a minor typo in the file name typeEnhancementUtils.kt.
2021-07-13 01:54:41 +02:00
Alexander Udalov
7a42f603f2
JVM IR: rename mangler implementation classes
2021-07-13 01:54:41 +02:00
Alexander Udalov
2834c22a85
IR: add BackendContext.typeSystem and JvmIrTypeSystemContext
...
To be able to override JVM-specific behavior of IrTypeSystemContext in
JVM IR, for things like JVM flexible types.
2021-07-01 19:35:44 +02:00
Roman Artemev
b5c28c1912
[KLIB] Introduce compatible mode for klibs.
...
Based on library ABI version linker could decide which signature mode
to be used to guarantee backward compatibility.
2021-07-01 17:40:36 +03:00
Roman Artemev
6cdac22a23
[IR] Introduce new IdSignatures
...
FileSignature, CompositeSignature, LocalSignature
They are needed to make possible reference any non-local declaration via
signature, including private signature, type parameters and so on.
- Support those new signatures in proto and klibs
- Rename `isPublic` -> `isPubliclyVisible` due to changed semantic
- Fix FIR
- clean up code
2021-07-01 17:40:31 +03:00
Anton Bannykh
600099585d
IR: refactor IdSignatureSerializer
...
Use a separate instance for each file.
2021-06-27 22:56:33 +03:00
Alexander Udalov
8b3769b88e
Remove dependency of ir.serialization.common on ir.backend.common
2021-06-01 20:28:22 +02:00
Dmitry Petrov
7e03f8ea80
JVM_IR KT-45853 include return type into Java method IdSignature
...
This is a hack required to accept [potentially] incorrect input
provided by the front-end; see KT-46042.
2021-04-12 22:52:08 +03:00
Alexander Udalov
7e149a3a44
IR: remove unneeded dependencies on psi2ir
2021-02-24 19:07:38 +01:00
Anton Bannykh
bc9a791809
Refactor klib serializer/deserializer
2021-02-18 18:03:41 +03:00
Georgy Bronnikov
db18ffc764
IR: only worry about threads in JvmIrSignatureDescriptor
...
General IdSignatureDescriptor is used from other backends, which have no
multi-threaded backend for now and do not need to carry the associated
runtime costs.
So IdSignatureDescriptor keeps the thread-unsafe caching of signature
builder.
2021-02-17 11:05:22 +03:00
Roman Artemev
bf67308cc2
[KLIB] Use IrMessageLogger in klib linker to report errors
2021-02-02 12:05:35 +03:00
Dmitry Petrov
b0f6461fa9
JVM_IR KT-42020 special IdSignature for some fake override members
2020-12-15 12:56:45 +03:00
Alexander Gorshenev
cb288d47ea
Don't serialize fake overrides anymore
2020-11-09 16:02:14 +03:00
Alexander Gorshenev
5de7a10df0
Eliminated -Xdeserialize-fake-overrides
2020-11-09 16:02:14 +03:00
Alexander Gorshenev
891a4c4621
Dropped outdated klib version compatibility mechanisms
2020-11-06 16:19:43 +03:00
Alexander Udalov
08b8939b80
IR: make IrSymbol.isPublicApi an extension
2020-10-23 20:56:08 +02:00
Alexander Gorshenev
223d1dd5e6
[Private fake overrides] Private fake override construction
2020-10-22 13:23:28 +03:00
Dmitriy Novozhilov
07a3009d43
Introduce new modules for common parts of deserialization
2020-09-11 10:08:37 +03:00
Roman Artemev
a095909d5c
[Plugin API] Provide special context in EP for link-time resolve
...
- requires to customize declarations from synthetic declarations
2020-08-24 15:37:39 +03:00
Alexander Gorshenev
e61960f333
Fake override construction fallback mode
2020-06-29 21:58:31 +03:00
Mikhail Glukhikh
ab5cb13dae
Rename: DescriptorBasedIr -> ObsoleteDescriptorBasedAPI
2020-06-16 19:17:14 +03:00
Mikhail Glukhikh
63394858ac
Minor typo fix
2020-06-16 19:17:08 +03:00
Mikhail Glukhikh
e787dbf374
[IR.serialization.jvm] Use Descriptor-based IR in JvmIrLinker only
2020-06-16 19:17:06 +03:00
Mikhail Glukhikh
7a0f986823
[IR] Introduce & use DescriptorBasedIr OptIn
2020-06-16 19:17:03 +03:00
Alexander Gorshenev
46e3649bd0
Moved all things related to fake overrides to a single directory
2020-05-31 06:00:32 +03:00
Alexander Gorshenev
024385cbbd
Construct fake overrides after IR deserialization
2020-05-31 06:00:32 +03:00