Alexander Udalov
0fb398d45e
Build: enable Werror for almost all compileKotlin tasks
...
The only exception at this point is :kotlin-gradle-plugin:compileKotlin.
2021-08-13 17:46:57 +02:00
Ivan Kochurkin
f2ffead881
Reduce allocations in KotlinTarget and modifier checkers
2021-08-13 18:32:29 +03:00
Ivan Kochurkin
2c1c24c042
[FIR] Implement WRONG_MODIFIER_CONTAINING_DECLARATION, DEPRECATED_MODIFIER_CONTAINING_DECLARATION
2021-08-13 18:32:28 +03:00
Ivan Kochurkin
cd6384eb20
[FIR] Fix handling of WRONG_MODIFIER_TARGET
...
Implement DEPRECATED_MODIFIER, DEPRECATED_MODIFIER_FOR_TARGET, REDUNDANT_MODIFIER_FOR_TARGET
2021-08-13 18:32:27 +03:00
Ivan Kochurkin
e85940a1ac
Unbind modifiers checks from psi
...
Use common code in FE and FIR in modifier checker, refactor
2021-08-13 18:32:26 +03:00
Dmitry Petrov
ed0e3b0fed
JVM_IR KT-47984 minor fixes after review
2021-08-13 18:08:55 +03:00
Dmitry Petrov
f8503ba1bf
JVM_IR KT-47984 minor avoid using @Deprecated function in tests
2021-08-13 18:08:55 +03:00
Dmitry Petrov
55663a0fb1
JVM_IR KT-47984 allow only limited list of GETSTATICs in arg loading
2021-08-13 18:08:54 +03:00
Dmitry Petrov
32c51cbb45
JVM_IR KT-47984 minor drop unneeded caching
2021-08-13 18:08:53 +03:00
Dmitry Petrov
15c41b2610
JVM_IR KT-47984 add test for argument reordering
2021-08-13 18:08:52 +03:00
Dmitry Petrov
edd2ca775b
JVM_IR KT-47984 use stack size calculator from ASM
2021-08-13 18:08:52 +03:00
Dmitry Petrov
5096e8c5c4
JVM_IR KT-47984 transform inplace arguments before inlining
2021-08-13 18:08:49 +03:00
Dmitry Petrov
7a99f9ff2e
JVM_IR KT-47984 allow noinline functional inplace args
2021-08-13 18:08:48 +03:00
Dmitry Petrov
9be941def2
JVM_IR KT-47984 don't move inplace arguments with suspension points
2021-08-13 18:08:47 +03:00
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
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
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
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
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
Andrey Zinovyev
1338675833
[FIR] Fix while's label, when condition has lambda
...
#KT-48116 Fixed
2021-08-12 10:20:45 +03:00
Andrey Zinovyev
d3905fd763
Add dist dependency for tests
...
Because some tests require stdlib
2021-08-11 21:57:16 +03:00