Ivan Kylchik
095c7c5930
Remove all secondary constructors from FunctionInlining
2023-03-14 20:47:41 +00:00
Ivan Kylchik
71487e534b
Reuse some available variables in JVM backend
2023-03-14 20:47:40 +00:00
Ivan Kylchik
c034edd58d
Disable tail call optimizations for inlined from IR functions
2023-03-14 20:47:40 +00:00
Ivan Kylchik
b31114fa52
Extract new smap creation logic into separate class LineNumberMapper
2023-03-14 20:47:39 +00:00
Ivan Kylchik
32a7633c06
Support smap creation for functions inlined with IR inliner
2023-03-14 20:47:38 +00:00
Ivan Kylchik
d451bc94a2
Separate creation and usage of synthetic accessors
...
This change allow us to inline private declarations
and only after that create synthetic accessors for them.
2023-03-14 20:47:38 +00:00
Ivan Kylchik
6e690f709e
Avoid irGet with Unit value if it is last it IrReturnableBlock
...
This is needed to pass `MethodVerifier` check on JVM backend
2023-03-14 20:47:38 +00:00
Ivan Kylchik
707c5f03b8
Add new "invent name" phase to generate names for regenerated classes
2023-03-14 20:47:37 +00:00
Ivan Kylchik
e159f7f682
Move some file level lowerings to module level
...
This is needed to fix "kt42408" test with enabled
IR inliner.
2023-03-14 20:47:37 +00:00
Ivan Kylchik
795d4bb739
Make regenerated inlined classes public by default
2023-03-14 20:47:37 +00:00
Ivan Kylchik
d9382b2b66
Properly remove duplicated inlined classes using capturedConstructors
2023-03-14 20:47:36 +00:00
Ivan Kylchik
969b0216d4
Support inlining of property reference with non-nullable field
2023-03-14 20:47:36 +00:00
Ivan Kylchik
4baf970d5b
Collect classes for JVM that must be regenerated after IR inline
2023-03-14 20:47:35 +00:00
Ivan Kylchik
41b56e5f16
Add some new utils to work with IrInlinedFunctionBlock
2023-03-14 20:47:35 +00:00
Ivan Kylchik
60702f0f02
Add new filed attributeOwnerIdBeforeInline to IrAttributeContainer
...
This field is null by default, and it is set to current
`attributeOwnerId` when declaration was inlined and must be
generated with new name. In its turn `attributeOwnerId` must be set to
`this` to show that this is actually a new declaration, not a copy.
2023-03-14 20:47:35 +00:00
Ivan Kylchik
163ed20de5
Set original type for expression inlined as arguments
...
This is mainly needed to fix cases like in "kt44429".
2023-03-14 20:47:34 +00:00
Ivan Kylchik
ce6084302f
Add FunctionInlining lowering to JvmLower
2023-03-14 20:47:34 +00:00
Ivan Kylchik
ef78196cbc
Replace all usages of inlineFunctionSymbol with inlineFunction
2023-03-14 20:47:34 +00:00
Ivan Kylchik
1d30a68285
Separate inlined by IR inliner arguments into two categories
...
First category of arguments is those that present at call site, and
second category is for those that are default.
2023-03-14 20:47:33 +00:00
Ivan Kylchik
ebf6e69ef3
Add new IR node IrInlinedFunctionBlock
...
This node will represent inlined in IR function.
2023-03-14 20:47:33 +00:00
Ivan Kylchik
59522a6130
Improve IR inliner to be able to inline property references
2023-03-14 20:47:33 +00:00
Ivan Kylchik
a09a48492b
Set names for tmp vars in FunctionInlining without special symbols
...
This way we drop excess symbols like `<` and `>`. This is need on
JVM to get rid of "dexing error".
2023-03-14 20:47:32 +00:00
Ivan Kylchik
c2fc745d66
Create special copy function in FunctionInlining
...
Semantically this is the same code, but it is easier to read
2023-03-14 20:47:32 +00:00
vladislav.grechko
35dfcb61bb
Fix specialization of equality comparison calls for inline classes
...
Receiver of equals() call should be checked instead of argument
^KT-57261: Fixed
2023-03-13 23:39:35 +00:00
vladislav.grechko
8039e30bbd
Fix condition of generating equals-impl0 call
...
This methods should not be called when instances of different inline
classes are being compared
^KT-57242: Fixed
2023-03-13 23:39:34 +00:00
Evgeniy.Zhelenskiy
948714e7e5
[IR] Fix delegating MFVC constructors
...
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com >
#KT-1179
2023-03-13 19:49:10 +01:00
Svyatoslav Kuzmich
a99ea1d3ce
[Wasm] Support enumValues and enumValueOf functions
...
^KT-57276 Fixed
Merge-request: KT-MR-9169
Merged-by: Svyatoslav Kuzmich <svyatoslav.kuzmich@jetbrains.com >
2023-03-13 14:13:31 +00:00
mcpiroman
d87468ef39
Simplify and optimize JvmLateinitLowering
2023-03-13 14:58:28 +01:00
Evgeniy.Zhelenskiy
3b5ad0681f
[IR] Fix compiler bugs with MFVC to let KorGE run
...
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com >
#KT-1179
2023-03-13 13:09:56 +00:00
Evgeniy.Zhelenskiy
19424702e0
[IR] Fix mutable shared reference of MFVC type
...
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com >
#KT-1179
2023-03-13 13:09:55 +00:00
Alexander Udalov
4f380e876c
Deprecate ClassBuilderInterceptorExtension
...
ClassGeneratorExtension is supposed to be used instead.
2023-03-13 13:54:06 +01:00
Alexander Udalov
f4b4922a13
Use new ClassGeneratorExtension EP in jvm-abi-gen
2023-03-13 13:53:07 +01:00
Alexander Udalov
fba5b96bef
JVM IR: introduce ClassGeneratorExtension
...
This is a low-level extension point for Kotlin/JVM, which is supposed to
be used instead of ClassBuilderInterceptorExtension.
#KT-54758 Fixed
#KT-56814 Fixed
2023-03-13 13:51:52 +01:00
Alexander Udalov
b1ca9a0f05
JVM IR: extract JvmIrDeclarationOrigin
2023-03-13 13:51:52 +01:00
Alexander Udalov
b1d109e7a3
JVM IR: do not use JvmDeclarationOrigin in duplicate signatures
...
Apparently the client code which reports errors only meaningfully uses
the `descriptor` field of `JvmDeclarationOrigin` in case of JVM IR.
2023-03-13 13:51:52 +01:00
Denis.Zharkov
eb09a25239
TypeSystemContext: Rework raw types processing
...
All the current usages are about checking if the type is raw,
also in K2 it is simply incorrect to assume that only flexible types
might be raw
2023-03-10 18:35:00 +00:00
Alexander Udalov
d96112b944
Remove dependency of fir2ir/fir.entrypoint on psi2ir
2023-03-10 17:49:35 +00:00
Artem Kobzar
ab7b429298
[K/JS] Add ability to use is checks on external objects
2023-03-10 11:33:30 +00:00
Igor Chevdar
ea7c851748
[K/N][IR][codegen] Fixed a number of thread safety problems
2023-03-10 11:05:55 +00:00
Alexander Korepanov
2cad26f4cc
[JS IR] Use cacheable ZIP file system accessor in JS IR BE
...
Related to KT-51712
2023-03-10 09:38:52 +00:00
Artem Kobzar
484e5afb59
[K/JS] Remove unused Unit_getInstance import into generated code
2023-03-09 16:51:07 +00:00
Svyatoslav Kuzmich
d5b958f744
[Wasm] Support default parameter values in functions with js(code)
2023-03-09 12:50:14 +00:00
Alexander Korepanov
f82d3e63a2
[JS IR] Use a backing field initializer for js() code folding
...
During a translation of the code from js() call to statement list,
the compiler folds the code string. For that it uses property bodies.
However the bodies can not be loaded in an incremental rebuild.
The patch uses the backing field initializers of constant properties.
The initializers are always loaded.
^KT-57002 Fixed
2023-03-08 16:56:05 +00:00
Alexander Udalov
f91e1fa7fd
Psi2Ir: make most declarations internal, remove unused
...
The main motivation is to avoid pollution in autocompletion in IDE, and
avoid clashes for some common names.
A lot of stuff was declared public seemingly by accident. It is only
used, and can only be meaningfully used, from within the psi2ir module.
2023-03-08 14:38:39 +00:00
Alexander Korepanov
bd3eb81aee
[JS FIR] Use FIR in JS IR invalidation tests
...
Related to KT-56740
2023-03-08 13:18:15 +00:00
Evgeniy.Zhelenskiy
88f293d4a9
[IR] Support reflection for MFVC
...
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com >
#KT-1179
2023-03-07 21:44:43 +00:00
Evgeniy.Zhelenskiy
1ff4906880
[IR] Fix NVargs Function lowering when working with MFVC
...
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com >
#KT-1179
2023-03-07 21:44:42 +00:00
Evgeniy.Zhelenskiy
5b868becf4
[IR] Hide regular class constructor with MFVC parameters
...
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com >
#KT-1179
2023-03-07 21:44:41 +00:00
Pavel Mikhailovskii
9db5ea66a6
KT-57103 Don't inline references to generic synthetic Java properties in K1
2023-03-07 17:35:04 +00:00
Alexander Udalov
47c48efa33
JVM IR: do not generate extension receiver parameter as ACC_MANDATED
...
Otherwise Java reflection is not able to load its type as a
parameterized type.
#KT-40857 Fixed
2023-03-06 20:57:52 +00:00