Commit Graph

32 Commits

Author SHA1 Message Date
Iaroslav Postovalov 059046a2b1 [JVM] Micro-optimize method signature mapping
This commit optimizes functions related to method signature mapping on
the JVM backend. The most significant change is avoiding re-allocations
in StringBuilder when building internal names. The commit also includes
minor optimizations, such as removing redundant allocations of strings
and other objects.
2023-09-01 20:26:17 +00:00
Evgeniy.Zhelenskiy 6ede1bcf85 [IR] Reduce unnecessary allocations 2023-08-31 10:43:30 +00:00
Bogdan Mukvich 7b00323b89 [Build] Update guava
Fix some reports from "Show Vulnerable Dependencies"

^KTI-1342
2023-08-25 14:10:37 +00:00
Alexander Udalov 874d1c514a JVM: support enumEntries intrinsic for Kotlin enums
Implementation is very similar to the `enumValues` intrinsic.

Java enums and old (pre-1.9) Kotlin enums will be supported in a
subsequent commit.

 #KT-59710
2023-07-25 09:55:43 +00:00
Pavel Mikhailovskii 164cbc9968 KTIJ-24768 Fix IllegalArgumentException in KtType.isPrimitiveBacked 2023-03-10 11:03:45 +00:00
Mads Sig Ager 7c3cc1d5c1 [JVM_IR] Limit inner class attributes to types in class file (#5081)
* [JVM_IR] Limit inner class attributes to types in class file

Inner class attributes should only be recorded for types that
are materialized in the result class file. In particular, we
should not emit inner classes attributes for types that appear
only in fake overrides. We do map these types to track the
fake overrides for JVM signature clashes but they are not
materialized in the class file.

^KT-56104 Fixed

* [JVM_IR] Consistently pass around materialized boolean in mapType.
2023-01-30 14:11:07 +01:00
Jinseong Jeon b088e742ae Introduce a util to copy TypeMappingMode for UAST 2023-01-17 13:56:42 +01:00
Jinseong Jeon e89a387cd4 Optimal type mapping modes for UAST
As shown in (DEFALUT | GENERIC_ARGUMENT)_UAST, UAST's PsiType mapping
needs an automatic expansion of type alias. This commit makes utils that
generate optimal type mapping modes for return / parameter to consider
if this is used for UAST. In that case, utils will set `mapTypeAliases`
true so that typealias (even inside type arguments) can be expanded
properly.
2023-01-17 13:56:41 +01:00
Dmitriy Novozhilov d5a76a1b3b [AA LC] Keep original qualifier while translating error cone types to Psi types 2023-01-12 17:45:08 +00:00
Aleksandr Kutashov a74f289844 KT-48822: Fixes ConcurrentModificationException in AsmTypes
AsmTypes#getType() could be called from multiple threads, which causes CME sometimes.
Should guard TYPES_MAP modification.
2022-08-20 00:56:52 +02:00
Dmitry Gridin 4f18e7091b [light classes] analysis-api-fir: migrate from :compiler:backend to :compiler:backend.common.jvm
^KT-53097
2022-08-01 13:56:35 +00:00
Dmitry Gridin 71018d8a6d [light classes] replace light class dependency from analysis.symbol-light-classes to light-classes-base
^KT-53097
2022-07-19 15:42:04 +00:00
Mikhael Bogdanov 162ca4ac2b KAPT+IR: support IR error types
#KT-49682
2022-06-20 11:42:53 +00:00
Nikolay Egorov 149402cf00 Make TypeMapper use signatureWriter for scripts expression evaluation;
Support nullability detection for IrScriptSymbol;

tests in IJ commit: "[scripting] Introduce tests for KT-51755"
2022-06-09 14:08:28 +00:00
Alexander Udalov 6d664bcd10 JVM IR: fix operand type for CompareTo intrinsic
It's incorrect to take the first parameter type from the expression
itself because it can be nullable if smart casts are used. And if it's
nullable, it's mapped to the wrapper type and calling
`comparisonOperandType` for it makes no sense. Instead, take the type
from the callee function, as it's guaranteed to be mapped to a JVM
primitive type.

E.g. in `test1` function in the added test, the problem was that the
dispatch receiver type of the call expression is `Double?`, which is
mapped to `java/lang/Double`, whereas we clearly wanted to obtain the
primitive `D` (double) type.

 #KT-52163 Fixed
2022-05-05 23:06:21 +02:00
Ilmir Usmanov 2fedb97d16 Correctly map nullable generic underlying value of inline class
if upper bound is primitive type.
 #KT-32162
2022-02-15 08:11:17 +01:00
Ilmir Usmanov a7e2f7a6b6 Map nullable type parameter with nullable inline class upper bound
which, in turn, has primitive or nullable underlying type to inline
class.
 #KT-32162
2022-02-15 08:11:15 +01:00
Dmitry Petrov 54299e83e8 JVM reorganize AbstractTypeMapper.mapType 2022-02-11 18:24:33 +00:00
Dmitry Petrov 4326e26907 JVM_IR Support IrDefinitelyNotNullType 2022-02-11 18:24:31 +00:00
Mikhail Glukhikh ad0d0ca47f Drop redundant Suppress("RemoveExplicitTypeArguments") 2022-01-26 12:19:55 +00:00
Vyacheslav Gerasimov f7a9065b75 Build: Use intellij maven repo instead of downloaded IDEA
#KTI-82
2021-12-16 21:48:23 +03:00
Ilya Kirillov 0c7728f64a Analysis API: fix PsiType creation for type parameter type with flexible upper bound 2021-11-10 18:49:43 +01:00
Jinseong Jeon 2dc2a90755 Introduce an API to convert TypeConstructorMarker to TypeParameterMarker 2021-10-28 12:54:45 +03:00
Jinseong Jeon 4ec745abd7 FIR: relax simple type requirement in AbstractTypeMapper
The counterparts in old FE don't have such restriction, so it can
map a type that has a flexible type as a type argument to JVM type,
e.g., Stream<String..String?>
2021-06-21 13:49:40 +03:00
Alexander Udalov 276ffd5a4b JVM IR: fix ::class reference and type mapping for scripts
#KT-46284 Fixed
2021-04-29 00:33:34 +03:00
Ilya Gorbunov e450a6494a Migrate deprecations in core, compiler, idea, tests
Replacing deprecated Char.toInt() with Char.code and
Number.toChar() with Number.toInt().toChar(), where Number is not Int.

KT-23451
2021-04-07 18:30:20 +03:00
Vyacheslav Gerasimov f2a892a972 Cleanup 201 and as41 bunch files 2021-03-30 14:23:43 +03:00
Ilya Chernikov 32d0c99289 Implement metadata handling for IR scripts 2021-03-11 15:49:45 +01:00
Mikhael Bogdanov c13f38f6df Support proper frame maps for enumValues 2021-02-02 14:32:50 +01:00
Denis.Zharkov 5e5b236ef8 Extract record related parts into smaller bunch files for 201 2020-12-22 14:58:05 +03:00
Alexander Udalov 6d13fe8213 Minor, add explicit type argument to workaround KT-42175 2020-09-24 19:38:26 +02:00
Dmitriy Novozhilov 0d954f1190 Change module :core:compiler.backend.common.jvm to :compiler:backend.common.jvm 2020-09-24 16:51:06 +03:00