Commit Graph

7352 Commits

Author SHA1 Message Date
Sergej Jaskiewicz 2096d22e18 [IR] Mark IrBlockBodyImpl with an opt-in annotation
KT-59318
2023-12-19 16:20:02 +00:00
Sergej Jaskiewicz f482b6a458 [IR] Mark IrValueParameterImpl with an opt-in annotation
KT-59318
2023-12-19 16:20:02 +00:00
Sergej Jaskiewicz b56a04e796 [IR] Mark IrTypeParameterImpl with an opt-in annotation
KT-59318
2023-12-19 16:20:02 +00:00
Sergej Jaskiewicz 8f2201b7a8 [IR] Mark IrTypeAliasImpl with an opt-in annotation
KT-59318
2023-12-19 16:20:02 +00:00
Sergej Jaskiewicz 9845ca801e [IR] Mark IrPropertyWithLateBindingImpl with an opt-in annotation
KT-59318
2023-12-19 16:20:02 +00:00
Sergej Jaskiewicz c393736473 [IR] Mark IrPropertyImpl with an opt-in annotation
KT-59318
2023-12-19 16:20:02 +00:00
Sergej Jaskiewicz 2953d9ec90 [IR] Mark IrLocalDelegatedPropertyImpl with an opt-in annotation
KT-59318
2023-12-19 16:20:02 +00:00
Sergej Jaskiewicz d493d76dc7 [IR] Mark IrFunctionWithLateBindingImpl with an opt-in annotation
KT-59318
2023-12-19 16:20:02 +00:00
Sergej Jaskiewicz 41197392f9 [IR] Mark IrFunctionImpl with an opt-in annotation
KT-59318
2023-12-19 16:20:01 +00:00
Sergej Jaskiewicz e1d03f6540 [IR] Mark IrFieldImpl with an opt-in annotation
KT-59318
2023-12-19 16:20:01 +00:00
Sergej Jaskiewicz cd014c57a5 [IR] Mark IrErrorDeclarationImpl with an opt-in annotation
KT-59318
2023-12-19 16:20:01 +00:00
Sergej Jaskiewicz 28a0d0c6aa [IR] Mark IrEnumEntryImpl with an opt-in annotation
KT-59318
2023-12-19 16:20:01 +00:00
Sergej Jaskiewicz 444dcae93d [IR] Mark IrConstructorImpl with an opt-in annotation
KT-59318
2023-12-19 16:20:01 +00:00
Sergej Jaskiewicz 2fab853700 [IR] Mark IrClassImpl with an opt-in annotation
KT-59318
2023-12-19 16:20:01 +00:00
Sergej Jaskiewicz 8aacb59aec [IR] Mark IrAnonymousInitializerImpl with an opt-in annotation
KT-59318
2023-12-19 16:20:01 +00:00
Sergej Jaskiewicz a1970d3d57 [K/N] Move KonanIrModuleSerializer to serialization.native
KT-64392
2023-12-19 15:20:01 +00:00
Sergej Jaskiewicz 199d9d4880 [K/N] Move KonanDeclarationTable to the serialization.native module
KT-64392
2023-12-19 15:20:01 +00:00
Sergej Jaskiewicz 3f9de91bec [K/N] Move KonanIrFileSerializer to the serialization.native module
KT-64392
2023-12-19 15:20:01 +00:00
Sergej Jaskiewicz a032db500c [K/N] Move KonanFakeOverrideClassFilter to serialization.native
KT-64392
2023-12-19 15:20:01 +00:00
Sergej Jaskiewicz ff1b618dfd [K/N] Move KonanIdSignaturer to the serialization.native module
KT-64392
2023-12-19 15:20:01 +00:00
Sergej Jaskiewicz 7e3b909394 [K/N] Move some utils to the serialization.native module
KT-64392
2023-12-19 15:20:01 +00:00
Dmitriy Dolovov 194efac68c [Manglers] Uniform handling of the error type in signature mangled names in all manglers
^KT-63723
2023-12-18 18:08:56 +00:00
Artem Kobzar 2530cba82a [K/JS] Compile Kotlin coroutines as JS generator ^KT-63038 Fixed 2023-12-18 17:13:07 +00:00
Dmitriy Dolovov 46081f968d [KLIB Resolver] Report KLIB resolver issues as compiler messages
The reason of this change is to make messages (especially warnings)
that are reported by the KLIB resolver become visible to the end user.
This can be achieved to forwarding such messages to the appropriate
compiler's components such as
`org.jetbrains.kotlin.cli.common.messages.MessageCollector` and
`org.jetbrains.kotlin.ir.util.IrMessageLogger`.

Also: The default `DummyLogger` should be used as minimal as possible.
Because it just forwards messages to the standard output (console)
where they can remain unattended. When the compiler is executed
from the Gradle plugin such messages appear only in DEBUG Gradle's log.

^KT-63573
2023-12-18 13:03:40 +00:00
Igor Chevdar 69459b056e [IR] Correct handling of loops in liveness analysis
#KT-64139 Fixed
2023-12-18 12:55:51 +00:00
Pavel Kunyavskiy f50fab65cc [IrActualizer] Update doc on how the actualization process works. 2023-12-15 15:38:10 +00:00
Pavel Kunyavskiy dcd3f3b155 [FIR2IR] Replace fake override symbols with normal ones
Fir2Ir introduces temporary symbols to avoid creating
fake overrides themselves. Further pipeline is not ready to
these symbols. That's why we have introduced separate pass,
that replaces all this symbols with real fake override
symbols, after they are created.

^KT-63645
2023-12-15 15:38:10 +00:00
Pavel Kunyavskiy c485382e80 [FIR2IR] Rework actualization pipeline
There are a lot of restrictions between different parts of the pipeline.

1. Fake overrides can't be built before classes are actualized
2. Constants can't be evaluated before callables are actualized
3. Callables can't be actulaized before fake overrides are built
4. Checkers can't run before constants are evaluated

This commit reorders things to make all these restrictions happy.

^KT-63644
2023-12-15 15:38:10 +00:00
Dmitriy Novozhilov 9609ac6908 [FIR2IR] Generate fake-override symbols for properties
^KT-63644 Fixed
2023-12-15 15:38:10 +00:00
Dmitriy Novozhilov 1d2601ccae [FIR2IR] Generate fake-override symbols for functions
^KT-63644
2023-12-15 15:38:10 +00:00
Nikita Bobko 599998039e [IR] Use resolveFakeOverrideMaybeAbstract instead of resolveFakeOverride in hasStableParameterNames
Well, the resolved fake-override can be ABSTRACT

^KT-64045 Fixed
2023-12-14 11:23:51 +00:00
Dmitriy Novozhilov da531bc261 [FIR2IR] Don't access symbol.owner in DataClassMembersGenerator 2023-12-14 08:32:58 +00:00
Svyatoslav Kuzmich 76e132e758 [Wasm] Fix overloading virtual methods by vararg and array element type
Context:
- Kotlin allows functions overloaded with different array element types.
- Varargs are lowered to Array parameters.
- Before this commit, K/Wasm erased an array element type
  from the signature, similar to type argument erasure in other cases.

Fix:
Stop erasing type arguments in arrays when computing v-table signatures.

^KT-58852 Fixed
2023-12-13 13:30:50 +00:00
Svyatoslav Kuzmich b5def88ff4 [Wasm] NFC refactor: eraseGenerics -> toWasmSignatureType
Use a more concrete name, make it private,
and split out:

 IrSimpleType.toWasmSignatureSimpleType

This does not change the behavior,
but helps to set the stage for the following bugfix
 (KT-58852)
2023-12-13 13:30:50 +00:00
Sergej Jaskiewicz f844a86057 [utils] Introduce the bind function and use it throughout 2023-12-13 10:04:45 +00:00
Yair Morgenstern 88e35fafd9 [Wasm] Use final Wasm structs for types without subtypes
A version of PR https://github.com/JetBrains/kotlin/pull/5175
 contributed by Yair Morgenstern, modified by Slava Kuzmich

^KT-60505 Fixed
2023-12-12 19:05:57 +00:00
Sergej Jaskiewicz 1bed6a063f [SIR] Add SirTransformerVoid class
This is convenient for cases when the transformer has no context to pass
to each method
2023-12-12 14:27:57 +00:00
Sergej Jaskiewicz 80c9eae409 [tree generators] Factor out common transformer printing logic 2023-12-12 14:27:57 +00:00
Alexander Korepanov 41ebe498f2 [JS IR] Explicitly cast to a string all types except specific ones
^KT-62763 Fixed
2023-12-12 09:53:19 +00:00
Wojciech Litewka ef53bd9548 [IR generator] Add missing isChild = false
Those fields were effectively marked as child elements after refactor.
However, because of the current (to possibly be changed) configuration,
the generator did not write accept methods for them.
2023-12-11 10:48:43 +00:00
Ivan Kylchik c902e5f565 [JVM_IR] Allow to use irPluginContext when compiling for android
This problem is extensively described in
`cadbc87dfd1ce3e63481ab90874ca8858878c55f` commit message.
TLDR: compiler is also called from Android LiveEdit plugin where
we want to be able to use compiler plugins. For that reason, we have two
different flags in the compiler. One is only for "evaluate expression"
(`doNotLoadDependencyModuleHeaders`) and the other for both LiveEdit
plugin and "evaluate expression" (`shouldStubAndNotLinkUnboundSymbols)`.
We want to forbid using compiler extensions for "evaluate expression"
and allow for LiveEdit plugin.

#KT-63695
2023-12-08 18:34:36 +00:00
Dmitriy Novozhilov 7d685522ce [IR] Fix calculation of receiver type for properies in expect/actual context
^KT-62926 Fixed
2023-12-08 13:28:27 +00:00
Artem Kobzar 2eb1e65bbf [K/Wasm] Allow to export unsigned numbers 2023-12-08 09:06:19 +00:00
Dmitriy Dolovov c9f4a1a841 IR: Avoid overwriting of property signature descriptions
^KT-64085
^KT-64082
2023-12-07 15:02:24 +00:00
Xin Wang 11749d7c89 [Codegen][JVM]: Mark line number before invoking intrinsics
Fixes #KT-61768
2023-12-07 11:54:12 +00:00
Ilmir Usmanov 32e43998a0 IR: Restore method used by Anvil annotation processor
But make it hidden, so, the new method will be used instead
 #KT-62281
2023-12-06 09:52:07 +00:00
Sergej Jaskiewicz 8d1907e2f5 [FIR/IR generator] Introduce the common entry point for tree generators
This reduces code duplication.
2023-12-05 20:30:22 +00:00
Sergej Jaskiewicz 19ff050eae [FIR/IR generator] Move usedTypes to AbstractElement, rename it 2023-12-05 20:30:22 +00:00
Sergej Jaskiewicz e4078d163b [IR generator] Move each visitor printer into its own file 2023-12-05 20:30:22 +00:00
Sergej Jaskiewicz 0c0f7f9899 [FIR/IR generator] Rename files with printers: use printer class's names 2023-12-05 20:30:22 +00:00