Commit Graph

104141 Commits

Author SHA1 Message Date
Alexander Udalov 5aa0000b3e Tests: remove IGNORE_BACKEND_K2_LIGHT_TREE directive
This is a partial revert of f47040696e. This directive is not used
anymore.

 #KT-56757 Fixed
2023-08-30 09:50:36 +00:00
vladislav.grechko e9ccc0329c Fix isKotlinFunctionWithBigArity function
fixup! Fix `isKotlinFunctionWithBigArity` function

Fix `isKotlinFunctionWithBigArity` function

Previous implementation could return false positive results, e.g. for
class named `abacaba.kotlin.Function42`

^KT-61548: Fixed


Merge-request: KT-MR-11928
Merged-by: Vladislav Grechko <Vladislav.Grechko@jetbrains.com>
2023-08-30 09:15:00 +00:00
Dmitriy Novozhilov 84d863aaf4 [Doc] Add documentation for FIR checkers 2023-08-30 08:51:56 +00:00
Yan Zhulanow ebd0ac8933 [LL API] Minor, move the call conflict resolver to the right package 2023-08-30 06:38:44 +00:00
Yan Zhulanow 8ad9718310 [LL API] Check the class file is in a conventional place
Although 'VirtualFile's are typically inside the containing package
directory, e.g. 'foo/bar/Baz.class' for 'foo.bar.Baz', there might
be classes with files in unexpected places. Sources of such classes
may include broken stubs, or just classes from misbehaving IDE plugins.

As we are yet to identity such cases, here we treat them as 'other'
candidates.
2023-08-30 06:38:44 +00:00
Yan Zhulanow faaba52ed5 [LL API] Minor, clean up 'LLLibraryScopeAwareConeCallConflictResolver' 2023-08-30 06:38:44 +00:00
Yan Zhulanow 4c3d414067 [LL API] Minor, fix documentation for 'globalLanguageVersionSettings' 2023-08-30 06:38:44 +00:00
Yan Zhulanow b96c1a644f [LL API] Fix code fragment compilation in library sources (KT-61383)
In complex projects, there might be several library copies (with the
same or different versions). As there is no way to build a reliable
dependency graph between libraries, a project library depends on all
other libraries. As a result, there might be several declarations in the
classpath with the same name and signature.

Normally, K2 issues a 'resolution ambiguity' error on calls to such
libraries. It is acceptable for resolution, as resolution errors are
never shown in the library code. However, the backend, to which
'evaluate expression' needs to pass FIR afterwards, is not designed for
compiling ambiguous (and non-completed) calls.
2023-08-30 06:38:44 +00:00
Yan Zhulanow 4b80c2197f [Analysis API] Run code fragment compilation tests against libraries 2023-08-30 06:38:44 +00:00
Yan Zhulanow dbb7e788b2 [LL API] Provide customizable default language version settings 2023-08-30 06:38:44 +00:00
Yan Zhulanow 705a97e9d4 [Analysis API] Fix test data for context receivers
Currently, the test files are only analyzed as source code, and present
errors do not affect code fragment analysis. In the following commits,
however, the test files will be compiled to test code fragment
analysis against library sources.
2023-08-30 06:38:43 +00:00
Alexander Kuznetsov 58350b83a8 KtFe10CompilerFacility: analyze inline delegated property accessors
One of the compiler lowerings, namely `PropertyReferenceLowering`,
optimizes usages of property references in some cases,
and if a containing delegated property accessor is inline,
it might need this accessor's bytecode.

If an accessor function is defined in a different module,
IDE tries to acquire its bytecode via the index, however,
the index doesn't cover classfiles from compiler output,
and that leads to errors like KTIJ-26706 and IDEA-320283.

One of the ways to ensure that the bytecode exists is to include files
that contain inline accessors in the compilation process. For example,
if file f1.kt from the analysis result contains property `val p by D()`,
and `D.getValue` is an inline function defined in file f2.kt,
then f2.kt must be present in the analysis result.
If f2.kt contains another property `val q by E()`,
and `E.getValue` is an inline function defined in f3.kt,
then f3.kt must be present in the analysis result. And so on.

Fixes KTIJ-26706, IDEA-320283


Merge-request: KT-MR-11793
Merged-by: Alexander Kuznetsov <Aleksander.Kuznetsov@jetbrains.com>
2023-08-29 23:55:31 +00:00
Vladislav Grechko f11c96cba2 Use handwritten tokenizer for SMAP parsing
SMAP parsing is a hot spot. Handwritten tokenization significantly boosts the performance.

See ^KT-61527
2023-08-29 21:28:50 +00:00
Aleksei.Glushko 4eac193463 [K/N] Generalize GC-assistance pause logic
Merge-request: KT-MR-11790
Merged-by: Alexey Glushko <aleksei.glushko@jetbrains.com>
2023-08-29 19:31:02 +00:00
Aleksei.Glushko a99db60117 [K/N] Reenable mark&sweep statistics match assertion 2023-08-29 19:03:34 +00:00
Aleksei.Glushko 1437a9bb69 [K/N] Make GCStatistics handles movable 2023-08-29 19:03:34 +00:00
Brian Norman e48ab4deb4 [FIR] Fix stackoverflow when checking for type cast erasure
#KT-59478 Fixed
2023-08-29 18:54:19 +00:00
vladislav.grechko 593b326c80 Don't do full type parameters erasure in resultIsActuallyAny
The only case when erasure required is when type is a type parameter.
2023-08-29 18:46:53 +00:00
vladislav.grechko 8f2825506a Don't do full type parameters erasure in PromisedValue::materializeAt
The only case when erasure matters in a context of materialization of
`PromisedValue` is when the type is a type parameter which upper bound
is an inline class. Since `PromisedValue::materializeAt` is a hot spot
and `eraseTypeParameters` is an expensive operation, we should not do
type erasure in other cases.
2023-08-29 18:46:53 +00:00
Bogdan Mukvich 5456ef3ad8 [Gradle] Remove ':kotlin-project-model' from artifacts-tests test data
^KT-61463 Verification Pending
2023-08-29 16:45:12 +00:00
Sebastian Sellmair 223714478a [Gradle] Update verification-metadata.xml
KT-61463
2023-08-29 16:45:12 +00:00
Sebastian Sellmair eb0e7fa55b [Gradle] Remove kpm Gradle integration tests
KT-61463
2023-08-29 16:45:12 +00:00
Sebastian Sellmair 02c2c76ffe [Gradle] Remove ':kotlin-project-model' and ':kotlin-project-model-tests-generator'
KT-61463
2023-08-29 16:45:12 +00:00
Sebastian Sellmair 6d38a314cc [Gradle] Remove kpm native variant codegen
KT-61463
2023-08-29 16:45:12 +00:00
Sebastian Sellmair c889c2f217 [Gradle] Dissolve plugin.mpp.pm20 package
KT-61463
2023-08-29 16:45:12 +00:00
Sebastian Sellmair 282d2f4454 [Gradle] Remove Gradle KPM implementation
KT-61463
2023-08-29 16:45:12 +00:00
Sebastian Sellmair 34abc008ec [Gradle] Update api dump after removing KPM import code
KT-61463
2023-08-29 16:45:12 +00:00
Sebastian Sellmair ea3c275961 [Gradle] Dissolve .kotlin.gradle.kpm package
KT-61463
2023-08-29 16:45:12 +00:00
Sebastian Sellmair 0a8cca9be4 [Gradle] Remove KPM IDE Gradle Sync support
KT-61463
2023-08-29 16:45:12 +00:00
Sebastian Sellmair e800885c03 [Gradle] Remove ':kotlin-gradle-plugin-kpm-android' module
KT-61463
2023-08-29 16:45:12 +00:00
Vladislav Grechko d97e8ae456 Use Enum.entries instead of deprecated Enum.values() 2023-08-29 16:30:57 +00:00
Ilya Gorbunov 7d3f080c81 Generate JS Long using builtin generators (step 2) 2023-08-29 16:27:55 +00:00
Ilya Gorbunov 814515964d Move JS Long to generated Primitives.kt file (step 1) 2023-08-29 16:27:55 +00:00
Igor Chevdar 2e02ee4ec8 [K/N] Fixed a corner case in escape analysis
#KT-61409 Fixed
2023-08-29 16:05:13 +00:00
Yahor Berdnikau e80988d98c [Gradle] Don't collect module-info on using new IC/JVM approach
Collecting 'moduleInfo' is required for the old history-file-based
incremental compilation approach. And the way how it is being collected
violates Gradle project-isolation feature as it accesses all Kotlin
compile tasks from other Gradle subprojects.

When the new IC based on classpath snapshot is enabled, the plugin will
not collect 'moduleInfo' making it compatible with project isolation.

^KT-59826 Fixed
2023-08-29 15:21:57 +00:00
Yahor Berdnikau 40928d50a2 [Gradle] Access build stats internal properties in project-isolation compatible way
^KT-59826 In Progress
2023-08-29 15:21:57 +00:00
Yahor Berdnikau d6becee2ce [Gradle] Read 'local.properties' in project isolation compatible way
^KT-59826 In Progress
2023-08-29 15:21:56 +00:00
Yahor Berdnikau b1965e746f [Gradle] Move project isolation test to separate test suite
^KT-59826 In Progress
2023-08-29 15:21:56 +00:00
Svyatoslav Scherbina b8e1349b72 Native: fix filecheck_constants_merge test after 4774912f
4774912f updated the patterns for the filecheck_constants_merge test,
because the commit slightly changed the code generated for TypeInfo.
But the test update was made with a copy-paste-related mistake.

As a result, the test didn't work with `-Ptest_with_cache_kind=static`.
This commit fixes this, buy reverting the unintended changes in
the filecheck patterns.
2023-08-29 13:48:30 +00:00
Alexander.Likhachev 9ec0ab2f5c [Gradle] Disable failed K2 JS IC test
Enable it back when KT-61153 is resolved
#KT-60588 In Progress
2023-08-29 13:37:26 +00:00
Alexander.Likhachev 9e31904f0f [Gradle] Run CompilerPluginsIncrementalIT only with K1
Should be reconsidered in KT-61171
#KT-60588 In Progress
2023-08-29 13:37:26 +00:00
Alexander.Likhachev 52303a1b23 [Gradle] Fix test plugins application 2023-08-29 13:37:25 +00:00
Alexander.Likhachev 4f820230fd [Gradle] Disable K2 precise java tracking IC tests
Enable them back when KT-57147 is resolved
#KT-60588 In Progress
2023-08-29 13:37:25 +00:00
Alexander.Likhachev a89aa1fb8d [Gradle] Disable failed daemon test with K2
Enable it back when KT-58894 is resolved
#KT-60588 In Progress
2023-08-29 13:37:25 +00:00
Alexander.Likhachev 82df028bc5 [Gradle] Disable failed K2 scripting tests
Enable them back when KT-61137 is resolved
#KT-60588 In Progress
2023-08-29 13:37:25 +00:00
Alexander.Likhachev bdf87c2713 [Gradle] Limit language version for tests providing Gradle plugins
#KT-60588 In Progress
2023-08-29 13:37:25 +00:00
Alexander.Likhachev c6b1d37476 [Gradle] Add expected K2 Kapt fallback warning
#KT-60588 In Progress
2023-08-29 13:37:25 +00:00
Alexander.Likhachev 3177df9ad8 [Gradle] Disable LightTree for K2 scripting tests
#KT-60588 In Progress
2023-08-29 13:37:25 +00:00
Alexander.Likhachev 196fb3e5f1 [Gradle] Split K1/K2 integration tests
#KT-60588 In Progress
2023-08-29 13:37:25 +00:00
Johan Bay 0a612e4268 [klib] Add an option to write out header klibs
The header klib is supposed to only contain the public abi of the module
similar to jvm-abi-gen. It is intended to be used as a dependency for other
klib compilations instead of the full klib for compilation avoidance.

^KT-60807
2023-08-29 13:25:07 +00:00