Commit Graph

82722 Commits

Author SHA1 Message Date
Ilya Kirillov f361312e45 FIR: use FirCachesFactory in BuiltInsPackageFragment.tryGetSyntheticFunctionalInterface 2021-06-03 00:09:02 +03:00
Ilya Kirillov ba2315430b FIR: get rid of lateinit var in FirBuiltinSymbolProvider for thread safety 2021-06-03 00:09:01 +03:00
Ilya Kirillov 863156679d FIR: use FirCachesFactory in BuiltInsPackageFragment.getClassLikeSymbolByFqName 2021-06-03 00:09:00 +03:00
Dmitry Petrov 7a43c2de79 JVM remove dead code during constant condition elimination
This avoids an extra call to 'analyze', which is rather costly.

Update debugger testData: Constant condition
elimination now performs DCE more consistently.
2021-06-03 00:08:27 +03:00
Dmitry Petrov 1fd94d1bc2 JVM Minor: cleanup RedundantNullCheckMethodTransformer 2021-06-03 00:08:25 +03:00
Mads Ager 0b5ec5535c [JVM_IR] Add String.plus(Any) to intrinsics list.
This filters it out for use in SAM wrapper generation with
invoke-dynamic.

The intrinsic is not actually used for code generation so
it is added to the list of intrinsics that should have been
lowered away before codegen.

^KT-45779 Fixed
2021-06-03 00:04:47 +03:00
Alexander Udalov c1021623e8 Do not use ClassLoader.getResourceAsStream in reflection
Use ClassLoader.getResource + openStream instead, to workaround an issue
in URLClassLoader.

Also set useCaches to false because kotlin-reflect only reads builtins
metadata once per class loader, and doesn't need it to be cached. Using
caches here might also lead to the problem of closed input streams when
protobuf is read in parallel. The test doesn't check exactly this,
though (it seems to succeed even if cached connections are used).

Note that BuiltInsResourceLoader has a JDK 9+ specialization at
libraries/reflect/api/src/java9, but that implementation does not need
any changes because it uses Module.getResourceAsStream which is not
affected by this issue in URLClassLoader.

 #KT-18277 Fixed
2021-06-02 22:54:16 +02:00
Vasily Levchenko a0503aa2d7 [kotlin-native][test][debugger] exclude non constant part of stack trace from gold values
(cherry picked from commit ac072d3cc0aea0d311062f58fb5382cac6912deb)
2021-06-02 18:36:59 +00:00
Nikita Bobko ea24da117b Publish compiler testdata which is required for Kotlin plugin 2021-06-02 21:30:03 +03:00
Sergey Shanshin 71c9e62d64 Added support serialization of local classes in IR backend
Resolves Kotlin/kotlinx.serialization#1427
2021-06-02 16:43:31 +00:00
Pavel Punegov ac0dc94800 Since 1.5.30-dev-1466 a new archive naming schema was introduced
Support both names in NativeCompilerDownloader
2021-06-02 18:30:52 +03:00
Pavel Punegov 789799ac17 Revert simpleOsName in HostManager
Support old naming in simpleOsName.
Introduce new platformName method for the new archive naming.
2021-06-02 18:30:52 +03:00
Leonid Startsev 1f837134bb Support for @EncodeDefault annotation 2021-06-02 13:43:39 +00:00
Alexander Dudinsky e6e3c9b236 Use master name for tests with snapshot version Kotlin Gradle Plugin 2021-06-02 15:23:31 +03:00
Roman Artemev 5f65b46dfc [JS IR] Unmute fixed tests 2021-06-02 13:42:35 +03:00
Roman Artemev a36135baf1 [JS IR] Fix reflection generation 2021-06-02 13:42:35 +03:00
Roman Artemev 974779e91b [JS IR] Support function reference to array inline constructor 2021-06-02 13:42:34 +03:00
Tianyu Geng 84334b087c FIR checkers: report SMARTCAST_IMPOSSIBLE 2021-06-02 13:19:12 +03:00
Tianyu Geng 62f7e8f71f FIR DFA: store stability in RealVariable
As part of this change, we also extend the usage of RealVariable in more
places during DFA. Now mutable properties, property with custom getters,
delegated properties, etc are also treatd as a `RealVariable`. In
general this is needed in order to carry out smartcast computation in
order to report `SMARTCAST_IMPOSSIBLE`. It seems to also have side
effects that improves behavior of some test files.
2021-06-02 13:19:12 +03:00
Tianyu Geng 96bd2c54f0 FIR: add smartcast stability to FIR 2021-06-02 13:19:12 +03:00
Tianyu Geng 931a637bdd FIR: use isReal() and isSynthetic() helper consistently 2021-06-02 13:19:11 +03:00
Vladimir Ivanov 2165cc8f0d [Native] Fix test data for testObjCExportNoGeneric (#4424) 2021-06-02 11:13:07 +03:00
Vladimir Ivanov e06a60bda5 [Native] Clean up nested comment when exporting kdoc to objc header (#4410)
* [Native] Clean up nested comment when exporting kdoc to objc header

* [kdoc-export] Add test witg nested comment block

* Remove redundant assert

Co-authored-by: Vladimir Ivanov <vladimir.d.ivanov@jetbrains.com>
2021-06-02 10:18:32 +03:00
Alexander Udalov 61d5595790 Remove dependency of ir.serialization.common on frontend 2021-06-01 20:28:23 +02:00
Alexander Udalov dfea915f92 Remove dependency of frontend on compiler.common.jvm
Looks like it was added accidentally in 564d382b9d; common frontend
shouldn't depend on JVM-specific modules.

Since then, it has been accidentally used in two places in
ir.serialization.common to refer to JVM specifics, and that should be
abstracted away in the future.
2021-06-01 20:28:23 +02:00
Alexander Udalov 81ce1da352 Move PsiSourceElement to psi 2021-06-01 20:28:23 +02:00
Alexander Udalov bcf47ddc94 Move optional annotation utilities to module 'resolution'
To avoid depending on a heavy module 'frontend' in parts of the compiler
where checking for optional annotations is needed, such as in
'ir.serialization.common'.
2021-06-01 20:28:22 +02:00
Alexander Udalov e790fa8ac9 Remove dependency of serialization on frontend
Move ApplicationExtensionDescriptor and ProjectExtensionDescriptor to
:compiler:util.
2021-06-01 20:28:22 +02:00
Alexander Udalov 8b3769b88e Remove dependency of ir.serialization.common on ir.backend.common 2021-06-01 20:28:22 +02:00
Alexander Udalov a3ad03d1ad Slightly refactor module dependencies of backend.js/serialization.js
The comment in serialization.js/build.gradle.kts is not needed because
such dependency cannot be introduced accidentally, since Gradle does not
support cycles in module dependencies.
2021-06-01 20:28:22 +02:00
Leonid Startsev b43e5a5e7d fixup! Fix tests and review notes 2021-06-01 16:41:56 +00:00
Leonid Startsev 6a5cf00d7a Optimize serializer instantiation: use Companion.serializer() when possible
Add test for sealed hierarchy
2021-06-01 16:41:55 +00:00
Leonid Startsev b61277df97 Support annotations in constructor signatures of special serializers 2021-06-01 16:41:55 +00:00
Leonid Startsev 229085f3d1 Support default parameter values in @SerialInfo annotations
#KT-46739 Fixed
Fixes https://github.com/Kotlin/kotlinx.serialization/issues/1461
2021-06-01 16:41:54 +00:00
Mads Ager f846dd8ea2 [JVM_IR] Avoid using special names in static inline class replacements.
Fixes KT-46952
2021-06-01 16:22:14 +02:00
Aleksei.Cherepanov b1ab597616 Fix FIR tests after ee45aa6b 2021-06-01 15:59:17 +03:00
Pavel Punegov 3293a888ca [native] Archive naming: use $os-$arch convention 2021-06-01 10:20:05 +00:00
Pavel Punegov 48ef739525 [native] Rename Apple MacOS targets in simpleOsName
Use Arm64 suffix for Apple Arm arch and X64 for Intel X86_64
2021-06-01 10:20:04 +00:00
Alexander Shabalin 825b77cc82 Remove unused ostream 2021-06-01 07:01:11 +00:00
Mikhael Bogdanov b72aa76415 Support class type parameters annotation checking 2021-06-01 06:33:51 +02:00
Mikhael Bogdanov a8186d19d6 Support annotations on class type parameters
#KT-43714
2021-06-01 06:33:50 +02:00
Dmitry Petrov 9091ca7b51 JVM_IR KT-46864 handle "unused" LDC instructions properly 2021-05-31 21:12:35 +03:00
Andrey Uskov be097244d4 fixup synchronizations 2021-05-31 20:23:54 +03:00
Aleksei.Cherepanov b0d721c9d0 Fix synchronization in translation-result map
#KT-27660 Fixed
2021-05-31 20:23:53 +03:00
Aleksei.Cherepanov 290d424111 Fix synchronization in source-to-classes table 2021-05-31 20:23:52 +03:00
Aleksei.Cherepanov ee45aa6b08 Fixed closing of cache storage
#KTIJ-7680 Fixed
#KT-45843 Fixed
2021-05-31 20:23:51 +03:00
Mads Ager 886ce055f5 [JVM_IR] Do not use invoke-dynamic for targeting inline-only methods.
Fixes https://youtrack.jetbrains.com/issue/KT-46962
2021-05-31 18:11:50 +03:00
pyos 5c2753b5d1 JVM_IR: use substituted return type in function reference invoke
#KT-46982 Fixed
2021-05-31 16:01:22 +03:00
Vasily Levchenko 84c10079e4 [kotlin-native][tests] kt-42208 test added. 2021-05-31 11:45:32 +00:00
Vasily Levchenko 1ff6dc1275 [kotlin][tests][compiler/testData/debug/stepping] kt-42208 test added. 2021-05-31 11:45:31 +00:00