Commit Graph

39038 Commits

Author SHA1 Message Date
Georgy Bronnikov 10c3429ce6 IR: remove dead code 2022-01-27 01:02:19 +03:00
Georgy Bronnikov 836925b4be JVM_IR: replace calls to expect declarations in ExprectDeclarationRemover
References to expect declarations still remain in IrTypes;
we will need to remove those as well sooner or later.
2022-01-27 01:02:18 +03:00
Georgy Bronnikov 63359d8492 IR: use descriptor directly in IrLazyEnumEntryImpl
This works even when the symbol contains no descriptor
(as it does happen after deserialization).
2022-01-27 01:02:17 +03:00
Georgy Bronnikov eda913554d IR: compute correct IR-based mangles for Java fields 2022-01-27 01:02:17 +03:00
Georgy Bronnikov 044acbb5ef JVM_IR: do not use return type in Java property mangles
Another case of discrepancy between IR-based mangles and
descriptor-based mangles.
2022-01-27 01:02:16 +03:00
Georgy Bronnikov 4d2bcf7e66 IR: compute file local signatures from descriptors 2022-01-27 01:02:16 +03:00
Georgy Bronnikov b6ddd758ec IR: fix deserialization of publicly visible type parameters 2022-01-27 01:02:15 +03:00
Georgy Bronnikov 3cc883cf7b IR: use DescriptorBySignatureFinder in DeclarationStubGenerator
Duplicating code that was used for the same purpose in
DeclarationStubGenerator is removed.
2022-01-27 01:02:14 +03:00
Igor Yakovlev a655f9da58 [WASM] Remove ignore from passing tests 2022-01-26 23:40:42 +03:00
Igor Yakovlev 2ec0411a7f [WASM] DCE implementation 2022-01-26 23:40:41 +03:00
Dmitry Petrov e55f7459f4 JVM_IR drop StripTypeAliasDeclarationsLowering 2022-01-26 12:49:20 +00:00
Mikhail Glukhikh ad0d0ca47f Drop redundant Suppress("RemoveExplicitTypeArguments") 2022-01-26 12:19:55 +00:00
Dmitriy Dolovov 7df68af664 [IR, Native] KLIB ABI tests: backup but don't overwrite artifacts
^KT-50775
2022-01-26 13:36:25 +03:00
Dmitriy Dolovov 9096725d1d [IR, JS] KLIB ABI tests: separate testing logic so that it can be reused in non-JS tests
^KT-50775
2022-01-26 13:36:25 +03:00
Dmitriy Dolovov d64a720749 [IR, JS] KLIB ABI tests: create KotlinCoreEnvironment in setUp()
^KT-50775
2022-01-26 13:36:24 +03:00
Dmitriy Dolovov d80572dac8 [IR, JS] KLIB ABI tests: create and clean up build directory with setUp()/tearDown()
^KT-50775
2022-01-26 13:36:24 +03:00
Dmitriy Dolovov 703fd8539d [IR, JS] KLIB ABI tests: don't create unnecessary disposable
^KT-50775
2022-01-26 13:36:24 +03:00
Dmitriy Dolovov 24b011436c [IR] Improve partial linkage error messages
^KT-50775
2022-01-26 13:36:24 +03:00
Dmitriy Dolovov 319125607e [IR, JS] Refactoring: Introduce JsUnlinkedDeclarationsSupport
^KT-50775
2022-01-26 13:36:23 +03:00
Dmitriy Dolovov 0b1a7d05a9 [IR] Move UnlinkedDeclarationsProcessor to another package
^KT-50775
2022-01-26 13:36:23 +03:00
sebastian.sellmair 0fd65ab1a0 [Native] TargetedLibraryImpl: Respect 'commonizerNativeTargets' property
^KT-50847 Verification Pending
2022-01-25 16:59:27 +00:00
Simon Ogorodnik 33e16d3761 FIR Tests. Fix jdkHome loading, allow to specify jvmTarget for FP test 2022-01-25 17:13:25 +03:00
Dmitry Petrov baf4b3158c JVM_IR merge lateinit lowerings into one 2022-01-25 13:50:21 +00:00
Sergey Bogolepov 2306834b06 [K/N] Fix comparison of IrConstantPrimitiveImpl 2022-01-25 09:11:00 +00:00
Ilmir Usmanov da80ac008b Make CHECKCAST not break TCO
So, treat CHECKCASTs as { POP, Unit } sequences. If the CHECKCAST is
between suspension point and ARETURN, put check for COROUTINE_SUSPENDED
before it and return if the suspension point is suspended.

This is safe, since if the function throws CCE, it will be thrown from
the last state in state-machine and we cannot reenter the function
during resume. So, in case of CHECKCAST throwing CCE the behavior is the
same, whether we have state-machine or not.

We do not need to disable TCO in some cases, as we do for functions,
returning Unit, since in latter case suspend function, returning Unit
might appear as returning non-Unit during resumption due to missing
{ POP, Unit } sequence, which is not executed, since the function is
tail-call. However, in case of functions, returning non-Unit there is
no such concern, since we do not POP result of suspension point, but
rather, return it after CHECKCAST.

 #KT-50835 Fixed
2022-01-25 03:30:22 +01:00
Xin Wang ebcc2cc3b2 PSI2IR: KT-49485 chunk ktConditions to avoid stackoverflow 2022-01-24 19:28:59 +03:00
Alexander Korepanov b40227b66e [JS IR] Re-export all JS-exports from main module in multi-module mode
Add an implicit transitive re-export through
main module for all other module's JS-exports.
2022-01-24 15:17:56 +00:00
Yahor Berdnikau 35ef8cc6da Show user-friendly message on OOM compilation error
This should provide a hint to user how to mitigate out-of-memory error
on compilation inside Kotlin daemon or in-process.

^KT-47522 Fixed
2022-01-24 10:30:53 +01:00
Dmitriy Novozhilov dd953908df [FE 1.0] Add compiler flag for rendering internal diagnostic names in error messages 2022-01-23 11:14:56 +03:00
Dmitriy Novozhilov d1fb8338ef [FIR] Infer type of elvis from lhs if rhs is Nothing
^KT-50875 Fixed
2022-01-23 08:22:07 +03:00
Simon Ogorodnik 83ff0946fe Inference. Remove chain inference stubs from fixed variables constraints 2022-01-22 09:02:02 +03:00
Ivan Kochurkin ed836f28f4 [FIR2IR] Function reference type approximation hack KT-49526 2022-01-21 19:34:11 +03:00
Ivan Kochurkin 070e860669 [FIR] Fix visibility for property accessors in raw fir common 2022-01-21 19:34:10 +03:00
Ivan Kochurkin defb0cf611 [FIR] Fix ambiguity between Sequence.forEach and Iterable.forEach (with @HidesMembers) ^KT-50776 Fixed 2022-01-21 19:34:10 +03:00
Ivan Kochurkin 4a200a2d7e [FIR2IR] Fix NSEE in case of lambda in enum entry constructor call, ^KT-50774 Fixed 2022-01-21 19:34:09 +03:00
Ilya Kirillov c7729689c4 LL API: always create FirFile with lazy bodies 2022-01-21 16:46:38 +01:00
Ilya Kirillov 16fbc09997 Analysis API: use FirSymbol in KtFirSymbol's instead of FirDeclaration
^KT-50271 fixed
2022-01-21 16:46:27 +01:00
Ilya Kirillov b20859e305 FIR: use "value" name in default setter value parameter symbol
This name is used in corresponding declaration
2022-01-21 16:46:26 +01:00
Anastasia.Shadrina 87b0670bbb [Tests] Add CompileKotlinAgainstCustomBinaries test for CR 2022-01-21 17:22:00 +03:00
Anastasia.Shadrina a86b4d767e [FE] KT-50878 Prohibit using contextual declarations without -Xcontext-receivers 2022-01-21 17:21:59 +03:00
Mikhail Glukhikh 756ff6cf43 Minor performance improvements in tryToCompleteWithBuilderInference 2022-01-20 23:46:40 +03:00
Mikhail Glukhikh 98cdc95cd0 FIR DFA: exit delegate expression only after accessor completion
This commit fixes DFA problem (see test) when we accidentally try
to merge incoming flows from member property (val ... by cached ...) and
the following function. While completing lambda of buildList { ... }
inside by cached we accidentally assume that delegate is already left
and add the lambda into exitsFromCompletedPostponedAnonymousFunction.
This commit fixes the problem by exiting delegate later, after completion.
2022-01-20 23:46:39 +03:00
Mikhail Glukhikh c324bbfc37 FIR: fold two last getOrderedAllTypeVariables calls into one (stage 7,8)
This commit saves us some performance and fixes test for KT-35684.
FIR-based constraint completer at this moment can't extract type
variables from already completed calls.
Folding allows us to extract ordered type variables before completion.
2022-01-20 23:46:38 +03:00
Mikhail Glukhikh 7f62d1bc5a FIR: move down inference session handling in PostponedArgumentsAnalyzer
After this commit the handling of inference session in similar for
FIR and FE 1.0
2022-01-20 23:46:37 +03:00
Mikhail Glukhikh bd6fef7841 FIR: don't add partially resolved call in builder inference mode 2022-01-20 23:46:37 +03:00
Mikhail Glukhikh e8be9d4861 FIR: support don't use builder inference if possible
In this commit we upgrade FIR builder inference logic from
the compiler version to 1.7. FIR-based compiler now works with
"don't use builder inference" flag always ON and supports switching
the flag "use builder inference only if needed". To do it,
ContraintSystemCompleter (FIR) and KotlinConstraintSystemCompleter (FE 1.0)
are made similar with extracting some common parts into
ConstraintSystemCompletionContext.

Test status: one BB test fails after this commit (KT-49285).
Also we have a crush in DFA logic in FIR bootstrap test and somehow
questionable behavior in FIR diagnostic test. However,
two BB tests were fixed, the 3rd case from KT-49925 were also fixed.

#KT-49925 Fixed
2022-01-20 23:46:36 +03:00
Mikhail Glukhikh d2bfb7153e Add test from KT-49925 (example 3, fails yet) 2022-01-20 23:46:35 +03:00
Ilya Kirillov ce1e4f252f FIR: make transformInplace to be thread safe if no transformation was done
^KT-50822 fixed
2022-01-20 23:28:08 +03:00
Ilya Kirillov 0eda3d6cd5 LL API: fix unresolved class supertype from importing scope 2022-01-20 23:26:29 +03:00
Ilya Kirillov 3b943706d8 Analysis API: fix call resolve inside plusAssign target
^KT-50864 fixed
2022-01-20 23:26:28 +03:00