Commit Graph

83229 Commits

Author SHA1 Message Date
Roman Artemev bbcd511c44 [TEST] fix irText testData
- support DELEGATED_MEMBER overrides
2021-06-16 21:16:48 +03:00
Roman Artemev cb130181a2 [Psi2Ir] Fix overridden symbols of Delegated Properties 2021-06-16 21:16:47 +03:00
Roman Artemev 32bbc3b8ad [KLIB] Fix SimpleTypeKey in case of type abbreviation 2021-06-16 21:16:46 +03:00
Roman Artemev 2f772c7a7c [KLIB] Add IrStatementOrigin into IrConstructorCall message 2021-06-16 21:16:45 +03:00
Roman Artemev 16ea3d9ae9 [TEST] Add IrText klib tests 2021-06-16 21:16:44 +03:00
Roman Artemev 14c91ca0de [TEST] Set proper TARGET_BACKEND for jvm-specific irText tests 2021-06-16 21:16:43 +03:00
Roman Golyshev b587b71b0f FIR IDE: Move KtDeclarationAndFirDeclarationEqualityChecker.kt to nested api package 2021-06-16 15:38:57 +00:00
Roman Golyshev c42fec5c93 FIR IDE: Refactor findSourceFirCompiledDeclaration
Add `FirDeclarationForCompiledElementSearcher` class to encapsulate
searching by the compiled declarations, move it to the separate file
2021-06-16 15:38:56 +00:00
Roman Golyshev b0bac90a8b FIR IDE: Make findNonLocalDeclarationForCompiledElement a member of FirModuleResolveState 2021-06-16 15:38:56 +00:00
Roman Golyshev e1f985424f FIR IDE: Move KtDeclarationAndFirDeclarationEqualityChecker to api package 2021-06-16 15:38:55 +00:00
Roman Golyshev ad34c19f9a FIR IDE: Add explicit assertion that module info is ModuleSourceInfo 2021-06-16 15:38:54 +00:00
Roman Golyshev 44f74888e0 FIR IDE: Add tests for resolving compiled declarations
Also, use correct index to find source for properties in
`FirIdeDeserializedDeclarationSourceProvider` - this bug
was revealed by the tests
2021-06-16 15:38:53 +00:00
Roman Golyshev 0fe068c6ce FIR IDE: Find FIR declarations for compiled PSI elements separately
When PSI declaration comes from the library with classfiles,
its `moduleInfo` is represented by `LibrarySourceInfo` class.
In this case we have to resort to other ways of looking for
corresponding FIR declaration

It is easy to do for classes (by `classId`) and for the properties
(by `classId` of the containing class and property's name)

It is harder for callables, so we use
`KtDeclarationAndFirDeclarationEqualityChecker` to do that
2021-06-16 15:38:52 +00:00
Roman Golyshev be51738483 FIR IDE: Move KtDeclarationAndFirDeclarationEqualityChecker to idea-fir-low-level-api module
It will be required to compare PSI and FIR declarations
for compiled PSI elements
2021-06-16 15:38:51 +00:00
Roman Golyshev 66047f159f FIR IDE: Resolve declaration in withFirDeclaration only if needed 2021-06-16 15:38:51 +00:00
Roman Golyshev 9e4c5eed5f FIR IDE: Make ModuleLibrariesSearchScope work only on .class sources
If this scope will accepts sources, then it will cause problems later
(when we will get libraries' sources from indices and will try to
resolve them to FIR declaration)
2021-06-16 15:38:50 +00:00
Igor Chevdar caa852061a [box-tests] Ignored a test for K/N
More info in https://youtrack.jetbrains.com/issue/KT-44571
2021-06-16 17:25:07 +05:00
Abduqodiri Qurbonzoda 59031543e2 Throw on invalid AbstractMutableList.addAll index #KT-47211 2021-06-16 11:59:46 +00:00
Nikita Nazarov 7e44cddbab Introduce the fragment compiler backend to the debugger infrastructure 2021-06-16 13:58:18 +03:00
pyos aa47191de4 JVM: hide ExpressionCodegen in finally block generation during inlining 2021-06-16 12:13:32 +02:00
pyos 108bd01698 JVM: refine the stack spilling around inline calls
Not all suspend functions need it - only those with suspension points.
2021-06-16 12:13:32 +02:00
pyos b136acb185 JVM: move callSiteFile to InlineCallSiteInfo 2021-06-16 12:13:32 +02:00
pyos 6c1a5e1211 JVM: make inline function argument processing a bit shorter 2021-06-16 12:13:32 +02:00
pyos 392e4fba42 JVM: fix inlining of default lambdas of signature (Result) -> Any
They have no `invoke` bridge, and the overridden invoke expectes a boxed
`Result` as an argument.
2021-06-16 12:13:32 +02:00
pyos a0a14d9e25 JVM: remove descriptors from SourceCompilerForInline
Printing the call site source on errors isn't really useful anyway - the
old backend points to a specific PsiElement, and JVM_IR wraps the
exception in FunctionCodegen (and printing the source never worked with
JVM_IR anyway).
2021-06-16 12:13:32 +02:00
pyos 32ad747632 JVM: load default lambda method nodes immediately
The ones that are not needed are filtered out before DefaultLambda is
even constructed anyway, and this way we need fewer lateinit vars.
2021-06-16 12:13:32 +02:00
pyos 1e953eaf01 JVM: remove contextKind from SourceCompilerForInline
Guess what? It's only useful for the old backend's type mapper!
2021-06-16 12:13:32 +02:00
pyos 1109348b6d JVM: remove lookupLocation from SourceCompilerForInline 2021-06-16 12:13:32 +02:00
pyos b6e9f64e18 JVM: remove functionDescriptor from InlineCodegen 2021-06-16 12:13:32 +02:00
pyos d89e2d9f08 JVM: split inline intrinsics into "needed by JVM_IR" and "not"
or, alternatively, "suspend" and "not".
2021-06-16 12:13:32 +02:00
pyos eb4d831d27 JVM_IR: implement typeOf<T> as a codegen intrinsic
rather than a fake inline function.

Also, generate more correct instructions for typeOf. Not sure how that
even worked before - `aconst(Boolean)` isn't even valid.
2021-06-16 12:13:32 +02:00
pyos 7dbf08ae1c JVM: move loadCompiledInlineFunction out of InlineCodegen 2021-06-16 12:13:32 +02:00
pyos 8307367f90 JVM: don't thread callDefault through the inliner
It's only used by the old backend, and should be given to
PsiSourceCompilerForInline by PsiInlineCodegen.
2021-06-16 12:13:32 +02:00
sebastian.sellmair 6dd598c7a7 [Gradle] Enable Kotlin tooling metadata artifact by default
^KT-44584
2021-06-16 09:44:32 +00:00
Igor Chevdar a1e5bef3ad [box-tests] Ignored some tests for K/N
A file included twice in a source set is not supported for now
2021-06-16 14:27:14 +05:00
Iaroslav Postovalov 0ba3ddcc29 Minor. Fix a typo, change visibility of internal object 2021-06-16 10:22:44 +03:00
Svyatoslav Scherbina e324c9b3fb Generate initRuntimeIfNeeded() at the beginning of staticCFunction
#KT-44283 Fixed
2021-06-16 06:39:51 +00:00
Yaroslav Chernyshev 6e9739caec Add regression test for MPP android source set with resources 2021-06-16 09:32:45 +03:00
Georgy Bronnikov f0f01db66e Temporarily mute a failing test 2021-06-16 01:48:28 +03:00
Ilya Kirillov 39e2df6916 FIR IDE: render unresolved types as qualifiers for member generator 2021-06-16 01:17:44 +03:00
Ilya Kirillov cf7870e376 FIR IDE: implement toString for KtType 2021-06-16 01:17:43 +03:00
Ilya Kirillov af9e6253e4 FIR IDE: add ability to specify type argument in KtClassTypeBuilder 2021-06-16 01:17:42 +03:00
Ilya Kirillov 148c90dd1e FIR IDE: do not make KtTypeArgumentWithVariance abstract
As it does not require specific FIR implementation
2021-06-16 01:17:41 +03:00
Ilya Kirillov 6a9c49dd9d FIR IDE: rename coneType parameter in KtFirType constructors to not accidentally leak it via lambdas 2021-06-16 01:17:40 +03:00
Ilya Kirillov 1d1eab6947 FIR IDE: make KtSymbolByFirBuilder to be a weak ref in KtType to avoid memory leaks 2021-06-16 01:17:39 +03:00
Ilya Kirillov 73bb2e76f2 FIR IDE: introduce KtFirDefinitelyNotNullType 2021-06-16 01:17:38 +03:00
Ilya Kirillov 8177a70ff9 FIR IDE: introduce KtCapturedType 2021-06-16 01:17:36 +03:00
Ilya Kirillov e2cfd933f1 FIR IDE: introduce HL API for creating class types 2021-06-16 01:17:35 +03:00
Ilya Kirillov 8094a5448d FIR IDE: render error message for KtClassErrorType 2021-06-16 01:17:34 +03:00
Ilya Kirillov 0a6c96492a FIR IDE: simplify KtType hierarchy
- get rid of Kt(Non)DenotatbleType super classes as unused
- make KtErrorType to inherit KtClassType to be consistent with FIR
2021-06-16 01:17:32 +03:00