Commit Graph

6670 Commits

Author SHA1 Message Date
Dmitry Petrov 88f41d006a FIR2IR don't generate delegates for default interface members 2021-11-25 13:25:36 +03:00
Mads Ager 261482904c [FIR] Give external package fragments different module descriptors.
The inliner uses module descriptors to figure out if it needs to
regenerate objects.

We should avoid the use of descriptors in the inliner, but this
works as a first quick fix.
2021-11-25 13:20:31 +03:00
Ivan Kochurkin b83ed7a6ed [FIR] Fix KtExpression.usedAsExpression for labeled expression 2021-11-24 23:13:37 +03:00
Dmitry Petrov 91b1814b02 FIR2IR insert implicit cast on elvis RHS 2021-11-24 16:19:11 +00:00
Dmitry Petrov badfade2fd FIR2IR strip FlexibleNullability on IMPLICIT_NOTNULL 2021-11-24 16:19:10 +00:00
Mikhail Glukhikh 0058d7e3d6 Add BB test for problem fixed with c2ab91d0 2021-11-24 15:30:33 +03:00
Mads Ager 8255118204 [JVM] Do not extend local ranges across control-flow merges.
The coroutine method transformer extends the range of locals
across code where the local is not live when it is safe to do
so. However, it only bailed out for one case of control-flow
merging, namely backwards branches for loops. That is not
sufficient as there can be control flow merges without loops
where the local is only defined on one control-flow path.

This change generalizes the bailout to any control-flow merge.

^KT-49834 Fixed
2021-11-23 13:49:45 +01:00
Dmitry Petrov 55d1fdfbc2 JVM_IR prevent clash of unsubstituted special bridges 2021-11-23 12:05:13 +00:00
Dmitry Petrov 2179987de7 FIR2IR fix enum special methods generation 2021-11-23 06:34:33 +00:00
Dmitry Petrov 2a263eca65 FIR2IR strip annotations from IrConst type 2021-11-23 06:34:03 +00:00
Roman Artemev 3bef04cf5e Fix test and unmute it for JVM 2021-11-22 19:00:43 +03:00
Ilya Goncharov f48436b35e rra/ilgonmic/eager-like-native
[JS IR] Leave JsEagerInitialization until bootstrap update

[JS IR] Fix js stdlib api

[JS IR] Change annotation on eager initialization in sources

[JS IR] Make eager initialization consistent with native

Merge-request: KT-MR-5030
2021-11-22 12:45:37 +00:00
Victor Petukhov a6fd14d4e6 [FE 1.0] Eliminate resolution ambiguity on inherited SAM-interfaces
^KT-17765 Fixed
2021-11-22 14:18:30 +03:00
Victor Petukhov a5c6d370dd [FE 1.0] Eliminate resolution ambiguity with external type parameters
^KT-10926 Fixed
2021-11-22 14:18:29 +03:00
Dmitry Petrov e525e25518 JVM KT-47851 fix redundant checkcast elimination 2021-11-20 23:29:19 +03:00
Dmitry Petrov 8b066fd345 JVM add tests for KT-49615 2021-11-20 23:29:18 +03:00
Mikhail Glukhikh cf104c8433 FIR: add status line to all failing black box tests 2021-11-20 03:37:31 +03:00
Sergej Jaskiewicz 060074a9d6 [JS IR] Don't concatenate string template segments with '' when possible
If concatenating with an empty string is a sure no-op, just don't do it.
2021-11-19 11:16:33 +00:00
Anton Bannykh 58bd4ffd71 [JS IR] disable some AST checks for now 2021-11-19 00:38:55 +03:00
Svyatoslav Kuzmich f833fc4bcb [Wasm] Default parameter values for external functions
+ import top-level external functions wrapped in lambdas
2021-11-17 19:28:14 +00:00
Dmitry Petrov 30ceb49442 JVM_IR KT-48945 generate special bridge with unsubstituted signature 2021-11-17 17:44:01 +03:00
Ivan Kylchik c7435ba760 Replace all occurrences of WITH_RUNTIME with WITH_STDLIB
We are going to deprecate `WITH_RUNTIME` directive. The main reason
behind this change is that `WITH_STDLIB` directive better describes
its meaning, specifically it will add kotlin stdlib to test's classpath.
2021-11-17 15:26:38 +03:00
Alexander Udalov 850d76f6bf Remove error on annotated types as arguments to typeOf
Instead, document that `KType.annotations` returns an empty list for
types created with `typeOf`. Annotations might be supported in the
future.

 #KT-49573 Fixed
 #KT-29919
2021-11-16 15:02:50 +01:00
Igor Yakovlev a7f0f62f69 [WASM] Generate missing WASM tests and mute failing ones 2021-11-15 19:53:49 +03:00
Igor Yakovlev ee7f4c7278 [WASM] Implementation typeOf support 2021-11-15 19:53:48 +03:00
Igor Yakovlev ce360bb10b [WASM] Implementation of Class references 2021-11-15 19:53:46 +03:00
Igor Yakovlev d9f2bd7963 Revert "[Wasm][Temporary] Stubs for typeOf and ::class constructs"
This reverts commit 8dc81b6c57.
2021-11-15 19:53:45 +03:00
Steven Schäfer a6dae0b37b JVM IR: Fix value class mangling in SAM wrappers from different modules
KT-49659
2021-11-14 21:52:39 +01:00
zhelenskiy c1dc1f7e33 Diagnostics renamed
Signed-off-by: zhelenskiy <zhelenskiy2000@yandex.ru>
2021-11-13 12:38:45 +01:00
Mikhail Glukhikh d6bc6bec59 FIR2IR: read extension function type attribute properly 2021-11-12 12:53:32 +03:00
Ilya Goncharov d6112224b4 [JS IR] Generate references from fake override to body in case of generic superclass 2021-11-11 15:12:34 +00:00
Dmitriy Dolovov 1e8dbd4846 [Native][tests] Add ExperimentalContracts OPT_IN directive for kt47300.kt
Without this directive the test can't be compiled by Kotlin/Native, because the box() function which is annotated with @ExperimentalContracts is called from the generated test runner source code that itself is not marked by this annotation.
2021-11-11 12:33:00 +03:00
Alexander Udalov 27cfcb9b3d IR: fix thisReceiver parameter type for function classes
Incorrect builder was used at line 269, which led to non-sensible type
in `IrClass.thisReceiver` for function types, such as
`SuspendFunction1<SuspendFunction1, SuspendFunction1>` in the linked
issue.

Avoid creating types manually completely to simplify this code and fix
the bug.

 #KT-49168 Fixed
2021-11-10 21:58:41 +01:00
Denis.Zharkov 65d7da122f FIR: Fix invalid INITIALIZER_TYPE_MISMATCH for suspend lambda 2021-11-10 22:00:01 +03:00
Svyatoslav Kuzmich 03c352c11e [Wasm] Lower complex external declarations
- Properties
- Member functions
- Object declarations
- Constructors
- Classes with instance checks
2021-11-10 19:48:11 +03:00
Svyatoslav Kuzmich c0761bf34a [Wasm] Support callable references to external functions
1. Move jsInteropFunctionsLowering after callable reference lowering,
  so it can continue to deal with just functions and function calls.
2. Generate lowered closure class in JsInteropFunctionsLowering because
2021-11-10 19:48:10 +03:00
Dmitry Petrov 916379c0e7 JVM KT-49613 use adapter for indy reference to protected constructor 2021-11-10 19:37:27 +03:00
Dmitry Petrov 76bdf4ff1a JVM KT-49548 extra test 2021-11-10 19:37:25 +03:00
Dmitry Petrov 9a4cff0dc7 JVM KT-49548 progression iterators can be tainted 2021-11-10 19:37:24 +03:00
Mads Ager 604f217360 [FIR] Report properties from java methods in Fir2IrLazyClass.
This shows up in annotation instantiation tests where we need
to make sure to generate a property on the annotation implementation
class for such properties.
2021-11-09 23:51:49 +03:00
Mads Ager b79ca7d7df [FIR] Allow annotation instantiation.
This commit disables the frontend error reporting for supported cases.
2021-11-09 23:51:48 +03:00
Alexander Udalov 1071919706 Remove backend tests on old inference
Also remove any mentions of NewInference, and rename some tests.
2021-11-09 20:07:33 +01:00
Mikhail Glukhikh 6eaeada1e6 FIR: cache properties in use-site scope properly 2021-11-09 21:04:40 +03:00
Mikhail Glukhikh f2c734fc02 FIR2IR: add another fallback for simple synthetic property 2021-11-09 21:04:39 +03:00
Mikhail Glukhikh b50350f6a5 FIR2IR: add fallback for a synthetic property override situation 2021-11-09 21:04:39 +03:00
Mikhail Glukhikh a05244eca1 FIR: don't enhance synthetic property if not needed 2021-11-09 21:04:38 +03:00
Mikhail Glukhikh 5a44fda42c FIR2IR: bind fake override calls via symbol table 2021-11-09 21:04:37 +03:00
Mikhail Glukhikh 0622a47493 FIR2IR: implement early f/o overridden symbols binding #KT-42784 Fixed
Related to KT-49288
2021-11-09 21:04:36 +03:00
Mikhail Glukhikh 5b6e21690b FIR2IR: call fake overrides properly #KT-49288 Fixed 2021-11-09 21:04:35 +03:00
Dmitry Petrov 271368ac53 JVM_IR prefer loop with inclusive bound for unsigned integer ranges
In general, we would rather prefer a range-based for loop to look like
a counter loop in Java ('for (i = start; i < end; ++i) { <BODY> }').
This corresponds to

    i = start;
    do {
        if (i >= end) break;
        <BODY>
    } while ( { ++i; true } )

However, HotSpot doesn't recognize Kotlin unsigned integer comparison
in 'if (i >= end) break;' as a counter loop condition. Thus, the loop
doesn't get optimized as a counter loop, resulting in a performance
regression.
If we use exclusive range-based for loop instead, then we actually use
unsigned integer equality instead of unsigned integer comparison, which
is Ok for HotSpot.

KT-49444
2021-11-09 13:25:06 +03:00