Commit Graph

85032 Commits

Author SHA1 Message Date
Dmitry Petrov 9acdcc7590 JVM_IR KT-47984 minor cleanup 2021-08-13 18:08:47 +03:00
Dmitry Petrov bf362abb57 JVM_IR KT-47984 update LVT entries for transformed instructions 2021-08-13 18:08:46 +03:00
Dmitry Petrov 6b18f33f92 JVM_IR KT-47984 don't transform calls with non-local jumps in arguments 2021-08-13 18:08:45 +03:00
Dmitry Petrov b01c13a4df JVM_IR KT-47984 inplace arguments inlining for @InlineOnly functions 2021-08-13 18:08:44 +03:00
Dmitry Petrov ec90649854 JVM_IR minor cleanup in inliner 2021-08-13 18:08:43 +03:00
Pavel Kunyavskiy d88a665fa8 [K/N] Implement Lazy for new mm 2021-08-13 13:20:59 +00:00
Ivan Kylchik 2f2e608502 Expand the possibilities of object's interpretation
It is possible to create object in interpreter even if its
receiver symbol came from function parameter instead of object's class.
#KT-48174 Fixed
2021-08-13 16:18:36 +03:00
Ivan Kylchik 492b8acf93 Rename some methods in interpreter's stack to make their purpose clearer 2021-08-13 16:18:34 +03:00
Ivan Kylchik 69fe7e66a5 Introduce some helpful type aliases in interpreter 2021-08-13 16:18:32 +03:00
Ivan Kylchik 1808f14677 Switch from using of MutableList to ArrayDeque in interpreter's stack 2021-08-13 16:18:32 +03:00
Ivan Kylchik ac2dffa74e Speed up interpreter's stack by using map of variables instead of list 2021-08-13 16:18:31 +03:00
Ivan Kylchik a630273af2 Speed up interpreter's intrinsic check by introducing map of handlers 2021-08-13 16:18:30 +03:00
Ivan Kylchik bc9b2fd78b Uncomment some test cases in reflection test data for interpreter 2021-08-13 16:18:29 +03:00
Ivan Kylchik 23b315446f Support sam conversion in ir interpreter 2021-08-13 16:18:28 +03:00
Ivan Kylchik b85a796492 Support interpretation for floorDiv and mod functions 2021-08-13 16:18:28 +03:00
Ivan Kylchik f9607292b5 Add additional useful ir classes into IrInterpreterEnvironment 2021-08-13 16:18:26 +03:00
Ivan Kylchik b46a42be33 Drop toIrConst function with IrBuiltIns parameter 2021-08-13 16:18:25 +03:00
Pavel Kunyavskiy 7bddc2a815 [K/N] Add new exception for CallsChecker 2021-08-13 13:12:21 +00:00
Mikhail Glukhikh 4e4d36f85a FIR: take lower priority into account during references EagerResolve
#KT-48158 Fixed
2021-08-13 11:14:04 +03:00
Mikhail Glukhikh a21d281c19 FIR: fix capturing on intersection types #KT-48109 Fixed 2021-08-13 11:14:03 +03:00
Mikhail Glukhikh a04913a197 FIR: use captureFromTypeParameterUpperBoundIfNeeded for argument types
#KT-48161 Fixed
2021-08-13 11:14:02 +03:00
Mikhail Glukhikh 73a8b4544a FIR: don't report EQUALITY_NOT_APPLICABLE for classes from java.*
Workaround for KT-48113
2021-08-13 11:14:01 +03:00
Mikhail Glukhikh b617aca8ee FIR: fix scope order for super-type resolve #KT-48159 Fixed 2021-08-13 11:14:01 +03:00
Mikhail Glukhikh ca98417a0c FIR: add test for erroneous type inference in UAST (KT-48159) 2021-08-13 11:14:00 +03:00
Mikhail Glukhikh b1bcbaf48f FirConstChecks: support "Some string".length case properly
#KT-48165 Fixed
2021-08-13 11:13:59 +03:00
Mikhail Glukhikh f6413c41a0 FIR: fix serialization of JvmField-properties of local classes
#KT-48175 Fixed
2021-08-13 11:13:58 +03:00
Mikhail Glukhikh 2e2edf398c FIR: consider enum class overridden members non-final #KT-48164 Fixed 2021-08-13 11:13:57 +03:00
Nikolay Krasko 8e32bbbe90 Clean up 203.8084.24 dependencies a bit 2021-08-12 21:15:32 +03:00
Nikolay Krasko 23c438aa03 Clean up 203.6682.168 dependencies 2021-08-12 21:15:31 +03:00
Nikolay Krasko 63d1e195e0 Clean up 202.7660.26 dependencies 2021-08-12 21:15:31 +03:00
Nikolay Krasko 9e0ba8c3d2 Clean up 193.6494.7 mentionings 2021-08-12 21:15:30 +03:00
Nikolay Krasko c56b6455f1 Clean up 202.7660.3 mentionings 2021-08-12 21:15:29 +03:00
Igor Yakovlev 9b9a529b7f Reflect addition of new 'kotlin.jvm-run-configurations' module in Gradle 2021-08-12 18:16:00 +02:00
Ivan Kochurkin d346953de9 [FIR] Move FirCommaInWhenConditionChecker to syntax subdirectory 2021-08-12 18:42:26 +03:00
Tianyu Geng 1679da45ab FIR checker: COMMA_IN_WHEN_CONDITION_WITHOUT_ARGUMENT
FIR simply ignores anything after the first comma if the when expression
doesn't have a subject. Hence, the checker has to rely on PSI structure
instead.
2021-08-12 18:42:26 +03:00
Sergey Bogolepov db12a96e54 Fix test that was broken by e159392d by disabling native caches. 2021-08-12 18:02:23 +03:00
Ting-Yuan Huang 39c6be86cb K2JsIrCompiler: pass right configuration when creating lib module 2021-08-12 18:01:59 +03:00
Ting-Yuan Huang 06d3c6f233 Support repeated analysis and frontend-only-mode in K2JsIrCompiler 2021-08-12 18:01:58 +03:00
Ting-Yuan Huang e75ca75e3e K2JsIrCompiler: hoist common front-end preparation logic
Instead of creating ModuleStructure and run analysis in each backend,
the common preparation logic is moved into K2JsIrCompiler.doExecute().
2021-08-12 18:01:56 +03:00
Igor Laevsky 94af3adb4b WASM: Disable flaky test 2021-08-12 17:32:35 +03:00
Alexander Udalov 1b98723b3f JVM IR: fix incorrect detection of interface method impls in Java
The problem in the test case was that `JImpl.entrySet` was detected by
ReplaceDefaultImplsOverriddenSymbols as a class fake override, which
overrides non-abstract interface method. Thus, overriddenSymbols of
`MyMap.entrySet` were changed in
`ReplaceDefaultImplsOverriddenSymbols.visitSimpleFunction`.

Later, BridgeLowering tried to determine which special bridges to
generate for `MyMap.<get-entries>`, and for that it inspected existing
methods and their overrides.

Normally we would generate the following special bridge:

    getEntries()Ljava/util/Set;
        invokespecial JImpl.entrySet()Ljava/util/Set;

However, because of incorrect overrides, the generated class method was
selected here instead of the expected `Map.<get-entries>`:
https://github.com/JetBrains/kotlin/blob/06001fc0919c814e757caa494891619882fae15f/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/BridgeLowering.kt#L282
and since the JVM signature of the generated class method is the same as
that of the fake override in MyMap, we never got to generating the
special bridge.

The solution is to skip Java classes when looking for class methods
which override non-abstract interface methods. This logic only makes
sense for Kotlin code, because only Kotlin has DefaultImpls, and the
requirement to generate non-abstract fake overrides of interface methods
as actual methods in the bytecode, delegating to DefaultImpls.

 #KT-48167 Fixed
2021-08-12 13:51:33 +02:00
Alexander Udalov d124239025 JVM IR: do not attempt to mangle function expressions
For some reasons, lambdas and function expressions are represented
slightly differently in psi2ir. Lambdas are translated to a block with a
function of origin LOCAL_FUNCTION_FOR_LAMBDA and name "<anonymous>", but
function expressions are translated to a block with DEFINED function
"<no name provided>".

Tweak the condition for detecting local functions a bit, to avoid
similar situation in the future if we add some other origins for local
functions.

 #KT-48207 Fixed
2021-08-12 13:50:23 +02:00
Mikhail Glukhikh dd3eb53904 Drop forgotten foreign annotation test data 2021-08-12 14:25:18 +03:00
Yahor Berdnikau 3acb96e474 Allow running KotlinJavaToolchainTest on any user JDK. 2021-08-12 10:00:23 +02:00
Bingran c57302abba Only check ExternalDependency when customizing kotlin dependencies
This commit fixes the issue where kgp checks group/version of project
dependencies which is uncompatible with project isolation. With this
change, kgp will only check ExternalDependency which should be enough
for setting up kotlin dependencies.

This change also changes the way we apply cache redirector gradle
files to all projects when setting up test projects. To make it
compatible with project isolation, we should move away from using
project.getAllProjects() function.

^KT-47792 Fixed
Test: existing + SimpleKotlinGradleIT.testProjectIsolation
2021-08-12 09:51:20 +02:00
Andrey Zinovyev 1338675833 [FIR] Fix while's label, when condition has lambda
#KT-48116 Fixed
2021-08-12 10:20:45 +03:00
Alexander Shabalin 06001fc091 [K/N] Tweak fronted warning messages for the new MM 2021-08-11 20:06:19 +00:00
Andrey Zinovyev d3905fd763 Add dist dependency for tests
Because some tests require stdlib
2021-08-11 21:57:16 +03:00
Andrey Zinovyev 3ec9599bc4 [FIR][CFG] Partial support of postponed Nothing calls
In try blocks, last call won't be completed when building node for it
This is workaround to partially reconstruct nothing stub node for such
calls. Should work for non-local returns in try only.
#KT-48160 Fixed
2021-08-11 21:57:14 +03:00
Ivan Kochurkin 445e5122c1 [FIR] Fix conversion of underscored value parameters in functions
Fix false REDECLARATION
2021-08-11 21:52:46 +03:00