Commit Graph

80268 Commits

Author SHA1 Message Date
Dmitriy Novozhilov f82c7c4678 [FIR] Cleanup session creation utils 2021-03-11 13:10:04 +03:00
Dmitriy Novozhilov f1edca8ca8 Move default gradle run configurations to separate folders 2021-03-11 13:10:03 +03:00
Dmitriy Novozhilov 8995fe36f3 Add .idea/csv-plugin.xml to .gitignore 2021-03-11 13:10:03 +03:00
Vladimir Dolzhenko fbe18164b4 Filter KtAnnotated on-the-fly diagnostic elements
Relates to #KTIJ-1760
Relates to #KT-45254
2021-03-11 08:43:36 +00:00
Dmitriy Novozhilov cba63f2c12 Regenerate tests 2021-03-11 00:58:26 +03:00
Dmitriy Novozhilov 74118930b4 [FE] Don't fail with exception if ESVisitor tries to visit ESLambda
#KT-45243 Fixed
2021-03-11 00:58:24 +03:00
Mikhail Glukhikh f3135baba9 FIR: eliminate replaceSource usages in transformTypeToArrayType 2021-03-10 22:23:21 +03:00
Dmitry Petrov 0cca07fa19 Bump d8 used in box tests to 2.1.75 2021-03-10 21:04:12 +03:00
Dmitry Petrov 737fbe271f JVM_IR Do not generate generic signatures for lifted lambda methods 2021-03-10 21:04:11 +03:00
Dmitry Petrov 00a335129b JVM_IR indy-SAM: use '-Xsam-conversions=indy' if JVM 1.8+, LV 1.5+ 2021-03-10 21:04:08 +03:00
Alexander Udalov bf844aa8e4 JVM IR: prevent behavior change with operator dot calls on literals
#KT-42321 Fixed
2021-03-10 18:46:30 +01:00
Alexander Udalov c7498dd74d Remove one layer of nested exceptions in JVM backend 2021-03-10 18:44:11 +01:00
Igor Chevdar 6608ca5795 [K/N][IR] Fixed bug with parents setting
Fixes IR_VALIDATION warning as a side effect
2021-03-10 21:29:11 +05:00
Andrey Zinovyev d941d41776 [KAPT] Fix broken incremental test 2021-03-10 17:30:10 +03:00
Alexander Udalov a3a745e7a5 Fix ParallelBuildTest for Windows
Enclose file paths in raw strings. Otherwise in the string
"C:\Users\...", "\U" was detected as an illegal escape which led to an
error.
2021-03-10 14:25:06 +01:00
Roman Golyshev 5d0760c685 KT-44756 Ignore annotations on value parameters if metadata says so
There is a `gradle-api-impldep.jar` created by Gradle which contains
our nullability annotations, but relocated in the
`org.gradle.internal.impldep` package

In the deserialization process we use a `HAS_ANNOTATIONS` flag, and
if it is present on the declaration, we do not try to build annotations
for it, even when they are actually present and even when they are
relocated
(see usages of Flags.HAS_ANNOTATIONS in org.jetbrains.kotlin.serialization.deserialization.MemberDeserializer)

In the stubs builder we also use this HAS_ANNOTATIONS flag, but we did
not use it for the value parameters. This commit fixes that - now, if
the `org.jetbrains.annotations` packages are relocated, it should not
cause `Stub Mismatch Error` for the value parameters

Lets consider two possible cases:

1. If the value parameter has a user-defined annotation,
it will be marked as having annotations (HAS_ANNOTATIONS == true), and
both stubs and deserialized descriptors will have to
use all available annotations (even a relocated ones)

2. If, for example, the value parameter is of non-nullable type, it will
have a `@NotNull` annotation on it, but will be marked as having
no annotations at all (HAS_ANNOTATIONS == false), since `NotNull` is
considered as auxiliary by the compiler. Because of the flag, both stubs
and descriptors will ignore all present annotations (even if they were
relocated)

In the both cases, the stubs and the descriptors will completely match

^KT-44756 Fixed

See IDEA-262971 about fixing the Gradle jar and the details

N.B. This does not fixes the cases when `kotlin.Metadata` and similar
annotations are relocated (e.g. KT-25709)
2021-03-10 11:53:33 +00:00
Elena Lepilkina f7099d34d4 [K/N] Fixed build of performance server project 2021-03-10 11:49:39 +00:00
Dmitriy Dolovov cd2f55ea2f [Commonizer] Minor. Remove unused utility functions 2021-03-10 13:50:00 +03:00
Dmitriy Dolovov c1848a26c3 [Commonizer] Use more compact interner based on THashSet 2021-03-10 13:49:54 +03:00
Dmitriy Dolovov 7a11c722c6 [Commonizer] Introduce CirProvided.ExportedForwardDeclarationClass
To represent classifiers that are actually exported forward declarations
2021-03-10 13:49:48 +03:00
Dmitriy Dolovov 76d93b6dca [Commonizer] Read exported forward declarations for every C-interop module 2021-03-10 13:49:41 +03:00
Ilya Gorbunov a7fda66fa1 Suggest duration static factories instead of number extension properties
Introduce Duration companion functions to convert numbers to Duration.
Deprecate number extension properties and propose to use these
new functions instead.
2021-03-10 13:23:32 +03:00
Ilya Gorbunov ca99fc4fed Make more lambda-taking functions in kotlin-test inline-only
So that the lambda can contain non-local control flow, such as suspend
calls. Inline-only helps preserving line numbers in the failed assertion
stack traces.

KT-44717
2021-03-10 12:15:45 +03:00
Mikhael Bogdanov 66a29c70bf Use compatibility accessors only in compatibility stubs 2021-03-10 09:09:10 +00:00
Mikhael Bogdanov efceb89b98 Don't generate private members in compatibility mode in DefaultImpls 2021-03-10 09:09:09 +00:00
Mikhael Bogdanov f648d86d2b Generate stubs for private function with default arguments as public in interfaces 2021-03-10 09:09:08 +00:00
Andrey Zinovyev 7edbf79b4b [KAPT] Don't fail on empty InsnList
Fix failing on empty methods inline methods (after light generation)

#KT-45032 Fixed
2021-03-10 10:58:35 +03:00
Dmitry Petrov 02b5b931d4 Revert "JVM_IR indy-SAM: use '-Xsam-conversions=indy' if JVM 1.8+, LV 1.5+"
This reverts commit 679756ad
2021-03-10 07:39:29 +03:00
Vasily Levchenko ba3f27b5ce [performance] performace includes kotlinx.cli compositelly 2021-03-09 20:21:25 +00:00
Vasily Levchenko 8f97ba97f2 [kotlinx.cli] dually depends on kotlin artifacts
- in kotlin build this is project dependency
- in performace build this is artifact dependency
2021-03-09 20:21:25 +00:00
Vasily Levchenko f159a424f5 [build][plugin] kotlin native benchmarking plugin adds dependency kotlinx.cli as project dependency 2021-03-09 20:21:24 +00:00
Vasily Levchenko 0858a92b12 [build-tools] util to substitute dependency notation as artifact or project dependency 2021-03-09 20:21:23 +00:00
Vasily Levchenko 3935c290a9 [performance] prerequisite checks added 2021-03-09 20:21:23 +00:00
Vasily Levchenko 72bb1f5b30 [kotlin-native][performance][plugin] clean up 2021-03-09 20:21:22 +00:00
Sergey Bogolepov eb54689801 Update coverage sample documentation.
We need to invoke `llvm-profdata` tool from
the same toolchain as Clang (on macOS we use the one from Xcode).

(cherry picked from commit 91665b36af68b7fb3a56c0e7ed7ebb7d819adfb2)
2021-03-09 20:19:37 +00:00
Alexander Shabalin e53c8ba6ca Add FinalizerQueue to ObjectFactory (#4725)
(cherry picked from commit af70866594c31c81dfcc41b2e8b33c7a0cdc38f5)
2021-03-09 20:19:36 +00:00
Sergey Bogolepov f840b45ae1 Add hack for kotlinx-datetime:0.1.1 linkage
Provide a `std::system_category` wrapper with
the same mangling as in GCC 4.8.5

(cherry picked from commit ec5828a1f375a74a09aa49182571201e1f67b4fa)
2021-03-09 20:19:35 +00:00
LepilkinaElena fcbb921194 [LEGACY MM] Escape making extra increments and decrements during coping to the same array (#4731)
(cherry picked from commit 8b601d8e2c6bc772386ebd88d303a032a6f54237)
2021-03-09 20:19:34 +00:00
Igor Chevdar f9f948fea6 [IR] Fixed problems with nested inline classes
Fixes https://youtrack.jetbrains.com/issue/KT-45139 as well

(cherry picked from commit 44916e39bfa69325a9ab73cb4533bd2612fb4e56)
2021-03-09 20:19:34 +00:00
Sergey Bogolepov f5f7e976f6 Fix #KT-45094
Rebuild linux toolchains with an older OS.

(cherry picked from commit 1d249ad7b592573dc4478f0f6cefe2766c323e12)
2021-03-09 20:19:33 +00:00
Sergey Bogolepov 357f2be14e [Toolchain] Archive versioning
Allow toolchain builder to add a suffix to toolchain name.
It is useful for rebuilding the same toolchain in different environment.

(cherry picked from commit 83148fc5bb4e8bcc5afcf119df53ec1bc854be17)
2021-03-09 20:19:32 +00:00
Florian Kistner bd614aba0b Retain typed generics in ObjC export stubs (#4727)
* Add ObjC export test with disabled generics
* Retain typed generics in ObjC export stubs
* Introduce ObjC variance enum to decouple stubs from Kotlin variance

(cherry picked from commit 4d7c78b952a467ca3318c8c49d36b768fdc1ef9c)
2021-03-09 20:19:31 +00:00
LepilkinaElena 6641b4f029 [LEGACY MM] Fixed types in messages for tracing GC (#4729)
(cherry picked from commit 2f34b0f98e77226f02809a685a96ebb683a69e9d)
2021-03-09 20:19:30 +00:00
Dmitry Petrov 679756ad07 JVM_IR indy-SAM: use '-Xsam-conversions=indy' if JVM 1.8+, LV 1.5+ 2021-03-09 23:16:11 +03:00
Alexander Udalov 8294aed40c IR: add descriptor to "unbound symbols not allowed" message
This will help in diagnosing problems such as KT-45236.
2021-03-09 21:07:53 +01:00
Alexander Udalov e3dc112c5f Add original KotlinType to rendered IrErrorType
Also improve an error message in `IrType.erasedUpperBound`, which seems
like a frequent first place where the JVM IR backend crashes in case an
error type has made it past psi2ir.

This will help in diagnosing problems such as KT-45016.
2021-03-09 21:07:53 +01:00
Alexander Udalov cd9463ae8d Minor, add toString for GeneratedFile 2021-03-09 21:07:53 +01:00
Alexander Udalov bdaeaca5ae Psi2ir: do not generate default accessor body for expect properties
Because generateDefaultGetterBody/generateDefaultSetterBody reference
the property's backing field, which in case of extension properties
leads to an error "Unbound symbols not allowed" because extension
property cannot have a backing field.

In some way, this check is similar to the `isExpect` check in
`generatePrimaryConstructor`.
2021-03-09 20:51:02 +01:00
Alexander Udalov 5fc9f3bc17 Minor, add box test for unreachable uninitialized property
#KT-44496
2021-03-09 20:50:39 +01:00
Alexander Udalov 247efb220c Do not require backing fields for extension properties
This has no effect on correct code because extension properties cannot
have a backing field anyway and that is checked separately. But this
function is used in psi2ir to determine whether or not to create a
backing field for a property, and in case the code where the property is
declared is unreachable like in KT-44496 and has no explicit getter or
setter, it would previously return true for extension properties, which
on JVM would result in an actual field in the class file, which made no
sense.

After this change, the compiler will actually crash with an exception in
the IR validaton step because the symbol for the field is unbound. That
is a bit better than proceeding to generate potentially invalid
bytecode, but of course a proper fix would be to report an error in the
frontend.

 #KT-44496
2021-03-09 20:50:39 +01:00