Commit Graph

90966 Commits

Author SHA1 Message Date
Pavel Kunyavskiy 85633771da [K/N] Replace escape analysis correctness check to RuntimeAssert to avoid checks in release mode 2022-02-03 08:08:21 +00:00
Ilya Matveev 23d606b053 [K/N][tests] Support setting GC scheduler in the new infra 2022-02-03 07:30:33 +00:00
Ilya Matveev 8668797afd [K/N][tests] Do not run backed.native tests with aggressive GC 2022-02-03 07:30:33 +00:00
Alexander Udalov 6379fe4c4c JVM IR: link via descriptors instead of signatures by default
Doing so speeds up psi2ir ~2 times, and thus improves total compiler
performance by about 6-8%.

Unless JVM IR is in the mode where linking via signatures is the only
way (-Xserialize-ir, -Xklib), signatures are actually not needed at all,
SymbolTable can use the frontend representation (descriptors for FE1.0,
and hopefully FIR elements for K2) as hash table keys. The only catch is
that since other backends still need to work with signatures, all the
common IR utilities, such as irTypePredicates.kt, need to work correctly
for IR elements both with signatures and without.

Also, introduce a fallback compiler flag -Xlink-via-signatures, in case
something goes wrong, to be able to troubleshoot and workaround any
issues.

 #KT-48233
2022-02-03 02:48:05 +01:00
Alexander Udalov 6e4131de8e IR: improve toString for symbols 2022-02-03 02:48:05 +01:00
Kristoffer Andersen cd118e4723 [EE-IR] Minor: Generate valid bytecode for Fragment Class in PSI2IR
Testing revealed buggy generation of classes: the prior code is
rejected by the JVM verifier due to missing call to `this()` or
`super()`.
2022-02-02 23:45:41 +01:00
Igor Chevdar c0715cfb0c [K/N][IR][caches] Fixed problems with inline classes
Fixes https://youtrack.jetbrains.com/issue/KT-50978
2022-02-02 22:46:16 +05:00
Igor Chevdar 949e222305 [IR] Fixed a problem with signature search
The function findDescriptorBySignature should return null if no such signature has been found
letting the caller to handle this correctly. Fixes https://youtrack.jetbrains.com/issue/KT-50976
2022-02-02 22:46:16 +05:00
Igor Chevdar 554e94a322 [K/N][IR] Never consider a enum a final class
Unfortunately, neither descriptors nor Lazy IR have enough information
to correctly deduce a enum's modality as psi2ir does, so to avoid the RTTI generator
generating different vtables in different setups (whether a klib is cached or not),
conservatively consider all enums non-final.
2022-02-02 22:46:15 +05:00
Igor Chevdar 97a28df43d [K/N][IR] Handle some corner cases for enums when building caches
Helps workaround https://youtrack.jetbrains.com/issue/KT-50977
2022-02-02 22:43:53 +05:00
nataliya.valtman 0382610120 Report build reports for http in separate executor 2022-02-02 19:51:18 +03:00
Roman Golyshev 7e1a9e2b9a KTIJ-20637 Group files by module in getFacadeClassesInPackage also
Fixup for 35e2561dab, since these changes
were overlooked in the initial commit.

^KTIJ-20637 Fixed
2022-02-02 19:02:23 +03:00
Nikita Bobko ce2a469a88 coop dev: make it obvious how to resolve problems with outdated iml mapping 2022-02-02 15:41:07 +00:00
Igor Yakovlev 0ae7e00ed8 Revert "[WASM] Remove ignore from passing tests"
This reverts commit a655f9da58.
2022-02-02 16:44:48 +03:00
Igor Yakovlev 1446914ba9 [WASM] Run box tests with dce and non-dce modes 2022-02-02 16:44:47 +03:00
Svyatoslav Scherbina 9a967952b5 ObjCExport: fix crash when KotlinBase +initialize is called before +load
This generally shouldn't happen, but sometimes it does.

^KT-50982 Fixed
2022-02-02 12:57:20 +00:00
Dmitriy Novozhilov c23624380e [FE 1.0] Enable StopPropagatingDeprecationThroughOverrides in progressive mode
^KT-47902
2022-02-02 15:07:44 +03:00
Dmitry Petrov bbad3e9e94 JVM collect additional performance metrics in FE1.0 + JVM_IR pipeline 2022-02-02 11:56:01 +00:00
Pavel Punegov 74cf792b41 [K/N][test] Don't rebuild platform libs in non default dist if exist 2022-02-02 10:53:07 +00:00
Dmitriy Novozhilov e544c404b9 [FIR] Fix error message for CONFLICTING_INHERITED_MEMBERS 2022-02-02 10:55:40 +03:00
Dmitriy Novozhilov ee1a842b6c [FIR] Fix error message for LEAKED_IN_PLACE_LAMBDA 2022-02-02 10:52:54 +03:00
Ilya Matveev 6c173b2b6c [K/N] Add mmap to thread state checker exclude list 2022-02-02 05:22:59 +00:00
Roman Golyshev 35e2561dab KTIJ-20637 Group files by module and create facade class for each one
Before all files were going to `getOrCreateSymbolLightFacade`. If there
were both compiled and source files, it caused exceptions later
(see `SymbolLightClassFacadeCache.getOrCreateFirLightFacadeNoCache`).

When grouped by the `KtModule`, each file group should contain either
only sources or only compiled classes.

^KTIJ-20637 Fixed
2022-02-01 22:00:51 +03:00
Jinseong Jeon 71c60ce9d0 FIR2IR: fix type of delegating constructor call 2022-02-01 19:15:25 +03:00
Mikhail Glukhikh 029e946fb2 FIR: report VAL_REASSIGNMENT on synthetic immutable properties
#KT-50972 Fixed
2022-02-01 18:48:50 +03:00
Ilya Kirillov b8c36b7998 Analysis API FIR: remove compilation errors from new testdata 2022-02-01 16:31:29 +01:00
Ilya Kirillov 441de5cd75 Analysis API FIR: resolve Java synthetic properties KtSyntheticJavaPropertySymbol 2022-02-01 16:31:28 +01:00
Ilya Kirillov dcbf84771d Analysis API: regenerate tests 2022-02-01 16:31:27 +01:00
Mads Ager d13e117a58 Change FIR analysis API resolution for super type calls.
The IDE expects the super type calls to resolve to the constructor
invoked and not the class. The frontend itself resolves to the
class, so an extra layer is needed to adjust that to the constructor.
2022-02-01 16:31:26 +01:00
Yahor Berdnikau 95698b0138 Allow specifying additional JVM arguments for Kapt task
These arguments are only used when 'kapt.workers.isolation=process' mode
is used. It allows users to apply workaround for running kapt on newer
JDK version without waiting for a new Kotlin release

^KT-48450 Fixed
2022-02-01 15:00:12 +00:00
Denis.Zharkov adb9dfb256 FIR: Rework processing AugmentedArraySetCall
Previously (few commits earlier), it contained two versions
of receiver (lhs) generated separately for each desugaring version
that looked a bit redundant.

Now, at FIR building stage we just don't create desugaring sub-trees,
instead they are being built during bodies transformation and that seems
to be much convenient there, since we don't need to reverse-engineer
get-set-operator version to check if containing calls are successful
(as we just built those calls and retain them)

Semantically, this changes may only change how data flow works
for such statements (see changed compatibilityResolveWithVarargAndOperatorCall.kt)

^KT-50861 Relates
2022-02-01 13:12:49 +03:00
Denis.Zharkov 772579143b FIR: Change semantics for combination of safe calls and operators
^KT-41034 Fixed
2022-02-01 13:12:49 +03:00
Denis.Zharkov 0dd5042e62 FIR: Extract putIncrementOrDecrementStatements 2022-02-01 13:12:48 +03:00
Denis.Zharkov 32ba136366 FIR: Minor. Put variable closer to its usages 2022-02-01 13:12:47 +03:00
Denis.Zharkov e8581bdde5 FIR: Clarify parameter names in BaseFirBuilder.generateIncrementOr* 2022-02-01 13:12:46 +03:00
Denis.Zharkov 111b606580 FIR: Clarify contract for BaseFirBuilder.generateAssignment
^KT-50861 Relates
2022-02-01 13:12:45 +03:00
Denis.Zharkov 6f89f1ebf4 FIR: Allow selector of safe calls to be a FirStatement
It's necessary to allow a?.b += v be interpreted as a?.(b += v)
But currently FirAssignmentOperatorStatement is not FirQualifiedAccess

^KT-41034 In Progress
2022-02-01 13:12:45 +03:00
Ilya Matveev c35b8342d8 [K/N][Runtime] Support equality and hashcode for stacktraces 2022-02-01 10:02:50 +00:00
Hung Nguyen 1cb509d529 KT-45777: Remove proto-based approach to compute Java class snapshots
as the ASM-based approach is better, and we have switched to the
ASM-based approach for a while now.
2022-02-01 12:41:53 +03:00
Pavel Punegov f819a10968 [K/N][test] Ignore test with synchronized java keyword 2022-02-01 11:46:35 +03:00
Alexander Udalov 7dfe1793c8 Remove obsolete code used to load module annotations
`CliModuleAnnotationsResolver.getAnnotationsOnContainingModule` took
0.5% of total compilation time on IntelliJ.

 #KT-48233
2022-02-01 08:42:40 +01:00
Alexander Udalov d0f958d7a1 JVM IR: optimize isStaticInlineClassReplacementDelegatingCall
Static inline class replacements are possible only in inline classes.

Iterating over class declarations here took ~0.5% of backend time on
average projects, and up to 4% of total compilation time on degenerate
projects such as the one in KT-20055.
2022-02-01 08:42:39 +01:00
Ilya Kirillov 6e999f6e84 LL API: refactoring: replace FirIDE prefixes with LLFir prefixes 2022-01-31 21:12:31 +01:00
Ilya Kirillov 4530041cbb Analysis API: move reference resolve testsdata with errors to dedicated folders 2022-01-31 21:12:30 +01:00
Ilya Kirillov 1a2de65421 Add Generate Analysis Tests run configuration 2022-01-31 21:12:29 +01:00
Ilya Kirillov caddbda01b Analysis API FIR: introduce library resolve tests 2022-01-31 21:11:56 +01:00
Ilya Kirillov 96e1f1e7d4 Analysis API: fix some compilation errors in reference resolve testdata 2022-01-31 21:11:54 +01:00
Ilya Kirillov d926dda27f Analysis API FIR: introduce declarations from library resolve
^KT-50252 fixed
2022-01-31 21:11:52 +01:00
Ilya Kirillov d9200affe4 LL API: simplify FirModuleResolveState interface 2022-01-31 21:11:51 +01:00
Mikhail Glukhikh 05d65275bf FIR u/s scope: choose most specific intersection member for override check
Before this commit we took just first intersection member for this check.
However it's quite bad, because we were dependent on supertype order.
Choosing the most specific member looks more consistent here.

#KT-50969 Fixed
2022-01-31 21:59:18 +03:00