Commit Graph

83920 Commits

Author SHA1 Message Date
Dmitry Petrov 804db3ce91 JVM KT-47613 custom control flow analyzer for CFG builder 2021-07-11 20:16:09 +03:00
Dmitry Petrov fe71435104 JVM KT-47613 traverse nodes backwards in backward analysis 2021-07-11 20:16:09 +03:00
Viacheslav Kormushkin 8c021af646 M1 support for cocoapods
#KT-47078
2021-07-10 19:23:51 +00:00
Ilya Gorbunov 455fee29e4 Find correct next match after matchAt and matchEntire KT-47676 2021-07-10 21:31:20 +03:00
Ilya Gorbunov 28a0698463 Regex.matchAt/matchesAt #KT-34021 2021-07-10 21:31:19 +03:00
Dmitry Petrov d99d25e51e JVM use SPBs in fix stack analyzer 2021-07-10 19:25:25 +03:00
Dmitry Petrov 38f45d2969 JVM update licence for InstructionLivenessAnalyzer.kt 2021-07-10 19:25:24 +03:00
Dmitry Petrov 68560c60f3 JVM use FastMethodAnalyzer when possible 2021-07-10 19:25:22 +03:00
Dmitry Petrov c54e680021 JVM FastMethodAnalyzer: prune some exception edges 2021-07-10 19:25:21 +03:00
Dmitry Petrov 07b89c6b4b JVM FastMethodAnalyzer 2021-07-10 19:25:20 +03:00
Alexander Udalov 6f72c681ed JVM IR: fix name and parent of JvmSymbols.kClassJava
In contrast to other top-level functions/properties declared in
JvmSymbols (unsafeCoerce, signatureString, etc), kClassJava refers to a
real symbol from the library. Since not all calls to it are intrinsified
(see KClassJavaProperty.kt:30), it makes sense to allow to reference it
when constructing IR. For that, it needs to have the correct file facade
as the parent, and the JvmName annotation so that its name is mapped
correctly in the codegen.

Co-authored-by: Leonid Startsev <leonid.startsev@jetbrains.com>
2021-07-10 15:33:25 +02:00
Alexander Udalov d33debdf7c IR: minor, cleanup Symbols 2021-07-10 15:33:25 +02:00
Yahor Berdnikau de22a467a1 Ensure default toolchain is also set to java only modules.
^KT-46972 Fixed
2021-07-09 19:36:27 +03:00
Victor Petukhov a8e28e4b69 Update compiler tests 2021-07-09 19:21:28 +03:00
Victor Petukhov 967304ffca Don't compute default type for a fixing type variable for self type if the corresponding feature is disabled 2021-07-09 19:21:27 +03:00
Victor Petukhov 584facc95f Fix fir-related problems and tests for inferring self types 2021-07-09 19:21:25 +03:00
Victor Petukhov 9e48ef85ea Add tests for inferring self types from Java 2021-07-09 19:21:22 +03:00
Victor Petukhov 3b16865152 Don't approximate captured types while substitute them in upper bound position 2021-07-09 19:21:17 +03:00
Victor Petukhov c2cf2f36cd Implement inferring materialized self types through a default type in ResultTypeResolver 2021-07-09 19:21:04 +03:00
Victor Petukhov 3787099a38 Put the type inference on calls with self types under the compiler flag 2021-07-09 19:20:56 +03:00
Victor Petukhov 51c5a54e31 Support type inference for self type materialization calls 2021-07-09 19:20:54 +03:00
Mikhail Zarechenskiy 44cf4be1e5 Inference for some kind of self types 2021-07-09 19:20:52 +03:00
Andrey Zinovyev db72fd1e93 [FIR] Fix inheritance check for substitution overrides
And delegates
2021-07-09 17:14:37 +03:00
Alexander Udalov d43ed1cf75 Minor, add test on typeOf with intersection type 2021-07-09 14:53:57 +02:00
Alexander Udalov a7e48c3af1 Improve toString of platform types created by typeOf
In the stdlib implementation, render "!" if the type is only
nullability-flexible. Otherwise, render "($lower..$upper)".

Note that full kotlin-reflect has a much more complicated logic (see
`DescriptorRendererImpl.renderFlexibleType`) that renders things like
`(Mutable)List` and so on. It is not a goal of the stdlib implementation
to replicate all of that, since it requires copying a large amount of
code, namely the entirety of `JavaToKotlinClassMap` to map Java class
names to Kotlin.
2021-07-09 14:53:56 +02:00
Alexander Udalov ddfa94e7e9 Support Nothing type in typeOf
The proper support will come in KT-15518, but that would be a breaking
change even for stable Kotlin without kotlin-reflect. Before that issue
is fixed, represent Nothing in types with the Void class, and use a flag
in the no-reflect implementation to remember that it's not actually the
Void class itself.

 #KT-39166 Fixed
2021-07-09 14:40:05 +02:00
Alexander Udalov 02774fae0c Report error on non-reified type parameter with recursive bound in typeOf
Instead of throwing an exception.

 #KT-40173
2021-07-09 14:31:52 +02:00
Alexander Udalov 438ce57183 Report error on typeOf<suspend ...>()
Otherwise an invalid type is constructed which causes kotlin-reflect to
crash, and stdlib implementation to render the type incorrectly. The
reason is that suspend functional types are not properly supported in
reflection. Once they are supported, this error can be removed.

 #KT-47562
2021-07-09 14:31:52 +02:00
Alexander Udalov 68432f0c20 Fix deprecation/unchecked warnings after update to 203 2021-07-09 14:24:07 +02:00
Dmitriy Novozhilov c6f754cf7a [Build] remove dependency on IDEA classes from :visualizer 2021-07-09 14:38:03 +03:00
Dmitriy Novozhilov aa3a73c6c2 [FIR] Move JavaTypeEnhancementState to session component 2021-07-09 14:38:02 +03:00
Simon Ogorodnik e102bdea20 [Build] Fix xerces usage in FIR modularized tests 2021-07-09 11:08:13 +00:00
Victor Petukhov c3a5a7754d Use proper applicability for constraint warnings
^KT-47316 Fixed
2021-07-09 14:07:01 +03:00
Victor Petukhov 1224d28deb Move java type enhancement stuff to :core:compiler.common.jvm 2021-07-09 13:22:02 +03:00
Nikita Bobko c112e768de Update ReadMe to point to up-to-date Kotlin IDEA plugin location 2021-07-09 10:14:41 +00:00
Pavel Kunyavskiy 31857f23a3 [K/N] Refactoring: remove copypaste 2021-07-09 08:53:08 +00:00
Pavel Kunyavskiy 594ff1474d [K/N] Make llvm Int1 boolean, not byte 2021-07-09 08:53:08 +00:00
Pavel Kunyavskiy eec8fdf16a [K/N] Implement isExperimentalMM intrinsic 2021-07-09 08:53:07 +00:00
Ilya Muradyan 55ec6729b0 [REPL] Fix completion after final expressions 2021-07-09 04:06:53 +03:00
Vyacheslav Gerasimov a915eddf22 Build: Upgrade Idea Ext plugin to 1.0.1 2021-07-08 23:24:09 +03:00
Dmitry Petrov 24fcadb869 JVM don't run CCE on methods without optimizable conditional jumps 2021-07-08 22:11:59 +03:00
Alexander Udalov 25f0beed12 Load async-profiler.jar if possible when using -Xprofile
Instead of requiring it to be on the compiler classpath.

This will make it much easier to profile the Kotlin compiler daemon in
Gradle, by just specifying a compiler argument instead of also manually
patching the compiler jar.
2021-07-08 20:44:45 +02:00
Ilya Muradyan 787ce6335c Change nestedClasses logic to accept classes with nested type aliases
#KT-47650 fixed
2021-07-08 21:04:53 +03:00
Simon Ogorodnik ca86b7ff7d [Build] Make getToolchainCompilerFor private and fix LibrariesCommon 2021-07-08 17:06:31 +00:00
Simon Ogorodnik c0e479eadb [Build] Allow to override JDK 10 with JDK 11 2021-07-08 17:06:31 +00:00
Simon Ogorodnik 18eccdbc1f [Build] Allow to override JDK 9 with JDK 11 2021-07-08 17:06:30 +00:00
Simon Ogorodnik a31bdc6454 [Build] Respect overrides in getToolchainLauncherFor 2021-07-08 17:06:29 +00:00
Simon Ogorodnik bf25ccfc0e [Build] Allow kotlin.build.isObsoleteJdkOverrideEnabled=true on CI 2021-07-08 17:06:28 +00:00
Ilya Kirillov eab1a78d48 FIR IDE: mute failing multimodule tests 2021-07-08 18:25:44 +03:00
Roman Golyshev dcc30cb672 FIR IDE: Mute test with java file in the dependency
The corresponding JavaSymbolProvider currently is unable to
see the `Foo` class, because under the hood it uses
`JvmDependenciesIndexImpl` which doesn't know about the corresponding
.java file because it is created for m2-module `project`

I wasn't able to fix it yet
2021-07-08 18:25:42 +03:00