Commit Graph

5609 Commits

Author SHA1 Message Date
Iaroslav Postovalov 8a7bc2ef6f Rename continuation fields according the convention and count them in IR 2020-12-23 19:45:13 +01:00
Iaroslav Postovalov 6f34f00c61 Do not generate the field for unused parameters in suspend lambdas 2020-12-23 19:45:04 +01:00
Ilmir Usmanov f49cf2d5ca IC Mangling: correctly mangle inline default functions
#KT-43682 Fixed
2020-12-23 18:13:09 +01:00
Georgy Bronnikov 076272f7ca FIR2IR: avoid descriptors computing hashCode
When synthesizing the hashCode function for data classes, descriptors
were used, in partcular, memberScope for primitive classes.
IrBasedDescriptors have no member scope, so we compute the hashCode
function based on IR structures.
2020-12-23 18:50:52 +03:00
Jinseong Jeon aaa3f2e2c1 FIR2IR: correct IR origin for substitution overrides
#KT-44054 Fixed
2020-12-23 16:13:05 +03:00
Jinseong Jeon 34dbbdce07 FIR2IR: use lookupTag or class to getLocalClass, not classId
Before this commit, we sometimes tried to fetch anonymous object by id,
getting sometimes a wrong result because it's singleton.
Now we use lookupTag or FIR class itself instead.

#KT-44050 Fixed
2020-12-23 16:12:58 +03:00
Dmitry Petrov 632f5af442 Minor: kt21014.kt - add JVM_TARGET 1.8 2020-12-23 11:25:36 +03:00
Dmitry Petrov 3ae8521f12 Minor: drop kt21014.kt (SIGSEGV on HotSpot 6.0_45-b06) 2020-12-22 19:56:54 +03:00
Dmitry Petrov 796d821776 JVM_IR box tests for JDK9 2020-12-22 16:09:48 +03:00
Dmitry Petrov c9d330207b JVM_IR no nullability annotations on SAM wrapper constructor parameters 2020-12-22 16:09:46 +03:00
Dmitry Petrov 0dff583070 JVM KT-36984 SAM wrappers are anonymous inner classes 2020-12-22 16:09:45 +03:00
Dmitry Petrov 57dd9fc87a JVM_IR KT-36984 SAM wrappers are anonymous inner classes 2020-12-22 16:09:45 +03:00
Dmitry Petrov 443cd0fc2c Tests for issues fixed in JVM_IR 2020-12-22 16:07:06 +03:00
Jinseong Jeon 3bca6ae893 FIR: allow lower bound of flexible type when finding contributed invoke 2020-12-21 18:01:25 +03:00
Jinseong Jeon d5a6991b2d FIR: extend SAM conversion to subtype of functional type 2020-12-21 18:01:22 +03:00
Jinseong Jeon dea01125d6 FIR deserializer: keep SourceElement for more precise Fir2IrLazyClass's source 2020-12-18 12:17:23 +03:00
Jinseong Jeon 4608431682 FIR2IR: correct base symbols of fake overrides for delegated member
#KT-43984 Fixed
2020-12-18 11:21:02 +03:00
Shagen Ogandzhanian 4f96f9d6a1 [JS IR] Initialize enum fields before accessing them in companion object
see https://youtrack.jetbrains.com/issue/KT-43901
2020-12-18 01:54:59 +01:00
Dmitry Petrov 8999fd88b1 JVM_IR KT-43401 KT-43518 fix ACC_STRICT and ACC_SYNCHRONIZED flags 2020-12-16 14:10:36 +03:00
Dmitry Petrov 7ed3860c70 JVM_IR KT-43043 fix nullability annotations for inline class members 2020-12-16 13:43:29 +03:00
Jinseong Jeon 6239301f4e FIR: no constraint for coerced-to-Unit last expression of lambda 2020-12-15 17:52:49 +03:00
Dmitry Petrov b0f6461fa9 JVM_IR KT-42020 special IdSignature for some fake override members 2020-12-15 12:56:45 +03:00
Jinseong Jeon 12cfba9ca9 FIR BB: remove stale test ignoring tags in old language versions
Since bf06d381 (move old Java nullability assertion tests...),
these tests aren't used by (Fir|Ir)BlackBoxCodegenTest anymore.
2020-12-15 11:52:50 +03:00
Jinseong Jeon f7ade2b0b8 FIR2IR: introduce implicit casts for extension receivers 2020-12-15 11:52:49 +03:00
Kristoffer Andersen 8a5f260d04 [IR] Align debugging of suspend lambdas with old BE
The existing backend restores LVs and parameters from the suspend lambda
fields used for spilling between suspension points, hence they are
visible in the debugger as local variables, plain and simple.

This PR introduces the same pattern to the IR backend, to bring the
debugging experience in line with the existing backend.

Both backends are still at the mercy of the liveness analysis
performed in the coroutine transformer where a liveness analysis
minimizes live ranges of entries in the LVT. E.g. an unused parameter
will be dropped entirely.

Adjusted existing test expectations accounting for the differences in
LV behavior.
2020-12-12 11:48:47 +01:00
Dmitry Petrov b7330a9e14 JVM_IR KT-43877 fix generic signatures for SAM-converted lambdas 2020-12-11 20:26:29 +03:00
Ilmir Usmanov 2b0a99b7b0 IC Mangling: Use correct java field type if the type is inline class
in old JVM BE.
 #KT-26445
2020-12-11 17:51:37 +01:00
Ilmir Usmanov 69bb65496f IC Mangling: Change test since we pass boxed inline class to java method
#KT-28214
2020-12-11 17:51:34 +01:00
Ilmir Usmanov 0cab69a7a0 IC Mangling: Do not mangle functions with inline classes from Java
in old JVM BE. Map types to boxed variants, when mapping signatures.
 #KT-26445
2020-12-11 17:51:30 +01:00
Mikhael Bogdanov b143cb9ae5 Disable new test on WASM 2020-12-11 06:36:42 +01:00
Mads Ager c922484758 [JVM_IR] Use direct field access to backing fields on current class.
The current backend uses direct field access to the backing field
instead of calling the companion object accessor, which calls
an accessibility bridge, which then gets the field for code such as:

```
class A {
  companion object {
    val s: String = "OK"
  }

  // f uses direct access to the A.s backing field.
  fun f() = s
}
```

This change does the same for the IR backend.
2020-12-11 06:24:55 +01:00
Jinseong Jeon 8f2ad57f7a FIR: pass elvis expected type to lhs/rhs 2020-12-10 20:52:49 +03:00
pyos 41f56729f9 FIR: serialize correct fqnames for local classes 2020-12-10 20:52:48 +03:00
pyos 12f936f6b7 FIR2IR: do not approximate reified type arguments to super class 2020-12-10 20:52:46 +03:00
pyos 5efe774dba FIR: remap Java meta-annotations to Kotlin equivalents
This is a direct port of JavaAnnotationMapper from the old frontend.
2020-12-10 20:52:43 +03:00
Mads Ager fadedc84db [JVM_IR] Refactor and add bytecode text tests for compose-like code.
Tests that the default argument mask is not in the local variable
table.
2020-12-10 17:22:18 +01:00
Mads Ager 83588e9f22 [JVM_IR] Add tests of Compose-like default argument handling. 2020-12-10 17:22:18 +01:00
Mads Ager a7efa5c98b [IR] Fix remapping of arguments in LocalDeclarationsLowering.
It only remapped arguments for IrGetValue and not for IrSetValue.
This is hitting Compose which has non-standard default argument
handling.
2020-12-10 17:22:18 +01:00
Ilya Goncharov 167e60b9fb [JS IR] Assert createdOn equals 0 for properties initialization fun for file 2020-12-10 18:07:50 +03:00
Dmitry Petrov 5be28520fc JVM_IR KT-43851 preserve static initialization order in const val read 2020-12-10 17:55:13 +03:00
LepilkinaElena c8c83c04c0 [IR] Fix saving function calls during inlining const properties in PropertyAccessorInlineLowering (#3971) 2020-12-10 12:24:23 +03:00
Ilmir Usmanov dccfb33bcc JVM_IR: Unbox argument of type kotlin.Result
if the argument has different type in parent: either generic or Any.
 #KT-41163 Fixed
 #KT-43536 Fixed
2020-12-10 08:27:32 +01:00
Dmitriy Novozhilov b416c669b0 [TEST] Update testdata due to dropped COMMON_COROUTINE_TEST directive 2020-12-10 01:31:04 +03:00
Dmitriy Novozhilov b6bd7c48f4 [FE] Rename FreedomForSealedClasses feature with more meaningful name 2020-12-09 22:54:38 +03:00
Dmitriy Novozhilov e76acc8ee0 [FE] Collect inheritors of sealed classes from new places in computeSealedSubclasses
#KT-13495
2020-12-09 22:54:24 +03:00
Dmitriy Novozhilov f5f1984a60 [FE] Allow declare sealed class inheritors in different files in one module
#KT-13495
2020-12-09 22:54:21 +03:00
Dmitry Petrov 313dfaf48c JVM_IR KT-43812 erase generic arguments of SAM wrapper supertype 2020-12-09 20:06:02 +03:00
Jinseong Jeon 2dfba10d84 FIR: extend suspend conversion to intersection type 2020-12-09 19:53:25 +03:00
Denis.Zharkov 920ed558ee Add some tests on corner cases for @JvmRecord 2020-12-09 16:47:25 +03:00
Denis.Zharkov 46c3979acd Separate JVM target option from javac's --enable-preview analogue 2020-12-09 16:47:24 +03:00