Commit Graph

4941 Commits

Author SHA1 Message Date
Mikhail Zarechenskiy 47aeeb36e4 Get accessors for companion object properties through wrapper class 2018-02-09 04:56:46 +03:00
Mikhail Zarechenskiy 70cd1cfcdf Fix generation of companion object inside inline classes 2018-02-09 04:56:45 +03:00
Mikhail Zarechenskiy e1d3b21201 Skip bridge methods generation for inline classes 2018-02-09 04:56:43 +03:00
Mikhail Zarechenskiy 0fd80ce980 Unbox inline classes after safe calls if needed 2018-02-09 04:56:40 +03:00
Mikhail Zarechenskiy c5c8d84719 Support boxing/unboxing for method return types 2018-02-09 04:56:36 +03:00
Mikhail Zarechenskiy 390c214943 Support boxing for inline classes on function calls 2018-02-09 04:56:08 +03:00
Mikhail Zarechenskiy 0d682879f5 Initial boxing for inline classes: local variable assignments 2018-02-09 04:55:44 +03:00
Mikhail Zarechenskiy 1ac4e9755a Generate synthetic unbox method for each wrapper of inline class 2018-02-09 02:08:11 +03:00
Mikhail Zarechenskiy a59917b6f8 Generate synthetic box method for each erased inline class 2018-02-09 02:08:10 +03:00
Mikhail Zarechenskiy 9d05fac771 Don't generate backing field for erased inline class 2018-02-09 02:08:09 +03:00
Mikaël Peltier 126afbb8ac Avoid to generate unecessary checkcast
StackValue already avoid to generate checkcast from a type or an
 array to java.lang.Object. Add a new case to avoid to generate a
 checkcast from an array to an array of java.lang.Object when arrays
 have the same dimensions.

 #KT-22714 Fixed
2018-02-08 16:38:46 +01:00
Denis Zharkov ef01f641f3 Imitate support for suspend modifier on parameterless lambdas
#KT-22766 In Progress
2018-02-08 17:47:37 +03:00
Mikhael Bogdanov 0954d1ab1b Don't generate hash in sam wrapper class name
#KT-17091 Fixed
2018-02-08 10:11:48 +01:00
Ilmir Usmanov ad385f42a9 Fix continuaion retrieval on generated coroutineContext intrinsic code
Use fake continuation instead on real one in JVM BE.
Pass continuation parameter to closure generator in JS BE.

 #KT-22577: Fixed
2018-02-06 21:14:37 +03:00
Mikhael Bogdanov ad48099ca6 Move java 8 tests to java8 folder 2018-02-06 10:32:14 +01:00
Mikaël Peltier a2a3043607 KT-18731 Use reference equality to compare enums
Fix of https://youtrack.jetbrains.com/issue/KT-18731
2018-02-05 18:34:44 +03:00
Alexander Udalov 9e500831dd Allow expect/actual annotation constructors to have default values
When a parameter has a default argument value both in the expected
annotation and in the actual annotation, they must be equal. This check
has been only implemented for the case when actual annotation is Kotlin
source code, and NOT a Java class coming from an actual typealias. The
latter case would require a bit more work in passing a platform-specific
annotation-value-reading component to ExpectedActualDeclarationChecker,
and is therefore postponed.

For now, Java annotations that are visible through actual type aliases
cannot have default argument values for parameters which already have
default values in the expected annotation declaration

 #KT-22703 Fixed
 #KT-22704 Open
2018-02-05 14:13:32 +01:00
Alexander Udalov db4ce703a6 Support default arguments for expected declarations
#KT-21913 Fixed
2018-02-05 13:38:05 +01:00
Mikhail Zarechenskiy 5dacfae793 Support calling inline functions inside inline classes 2018-02-05 12:07:41 +03:00
Mikhail Zarechenskiy 2536eb4d45 Generate argument expression instead of constructor for inline classes 2018-02-05 12:07:40 +03:00
Mikhail Zarechenskiy 928a342ace Initial version of codegen for inline classes 2018-02-05 12:07:40 +03:00
Anton Bannykh 3ead464671 JS: fix callable reference with implicit extension receiver (KT-22638 fixed) 2018-02-02 14:34:34 +03:00
Ilmir Usmanov 18c03f94f8 Move coroutineContext to correct package
from kotlin.coroutines.experimental.instrinsics to kotlin.coroutines.experimental

 #KT-22400
2018-02-01 13:18:32 +03:00
Mikhael Bogdanov cc346aef64 Support @JvmStatic for interface companion objects in backend 2018-01-26 10:09:21 +01:00
Dmitry Savvinov b29a6e48fb Refactor language features, which control effect system
- Introduce new language feature 'ReadDeserializedContracts', which
allows to deserialize contracts from metadata.

- Introduce new language feature 'AllowContractsForCustomFunctions',
which allows reading contracts from sources.

- Use new features instead of combination 'CallsInPlaceEffect ||
ReturnsEffect'

- Rename 'CallsInPlaceEffect' -> 'UseCallsInPlaceEffect',
'ReturnsEffect' -> 'UseReturnsEffect'. As names suggest, they control
if it is allowed to use corresponding effect in analysis.

We have to introduce separate 'ReadDeserializedContracts' to enable
contracts only in some modules of the project, because libraries are
read with project-wide settings (see KT-20692).
2018-01-26 11:30:44 +03:00
Dmitry Petrov 5e34f290ce Reified 'as?' produces nullable result
Previously, this was treated as a regular CHECKCAST, causing KT-22410.

 #Fixed KT-22410 Target versions 1.2.30
2018-01-26 10:22:59 +03:00
Alexander Udalov 543db380d2 Use isJvmInterface in JVM back-end instead of isInterface
To support const vals and proper initialization order for companions of
annotations (since 1.3+) as well as interfaces

 #KT-16962 Fixed
2018-01-24 15:54:35 +01:00
Alexander Udalov a46a2b9b1c Support nested classes in annotation classes
#KT-16962 In Progress
2018-01-24 15:54:35 +01:00
Dmitry Petrov 72ffbb9825 Add test for array modification within for-in-array-withIndex loop body 2018-01-23 10:55:24 +03:00
Dmitry Petrov 40d1925e19 Provide optimized code generation for for-in-withIndex for sequences
#KT-5177 In Progress
2018-01-23 10:55:24 +03:00
Dmitry Petrov 2399a39414 Provide optimized code generation for for-in-withIndex for CharSequences
#KT-5177 In Progress
2018-01-23 10:55:24 +03:00
Dmitry Petrov 9c9e507172 Provide optimized code generation for for-in-withIndex for iterables
#KT-5177 In Progress
2018-01-23 10:55:24 +03:00
Dmitry Petrov 08622b0953 Provide optimized code generation for for-in-withIndex for arrays
#KT-5177 In Progress
2018-01-23 10:55:24 +03:00
Ilmir Usmanov f4ad5182b8 Fix OOM error in ReturnUnitMethodTransformer
#KT-22345: Fixed
2018-01-19 20:13:23 +03:00
Kirill Rakhman 8bc020f31b Fix modifier order in generated overriden functions
Fixes #KT-21600
2018-01-16 15:42:02 +01:00
Ilmir Usmanov ed11528664 Ignore unreachable code on tail call optimization
#KT-21759: Fixed
2018-01-15 12:57:10 +03:00
Alexander Udalov b925b6ef9f Add test for obsolete issue
#KT-10494
2018-01-12 12:50:38 +01:00
Ilmir Usmanov 32a94c70e9 Use tail call optimization if ARETURN has multiple sources
#KT-21977: Fixed
2018-01-10 20:14:32 +03:00
Ilmir Usmanov 5dbab2f907 Disable tail call optimization, if the call is inside try block
#KT-21165: Fixed
2018-01-10 20:13:55 +03:00
Dmitry Petrov 5ffd6a737e Closures in scripts have outer expression
#KT-22029 Fixed Target versions 1.2.30
2018-01-10 14:08:56 +03:00
Alexander Udalov f3f8db989a Fix test data for annotations on DefaultImpls members
After ea5505f80c, the annotations are now generated correctly
2017-12-27 14:12:14 +01:00
Mikhael Bogdanov ea5505f80c Generate annotations in proper order in DefaultImpls 2017-12-22 10:02:04 +01:00
Mikhael Bogdanov c9d0ab38cf Generate proper java parameter names for DefaultImpls
#KT-21919 Fixed
2017-12-22 10:02:04 +01:00
Ilmir Usmanov c8904b1c7c Replace POP with ARETURN if it pops Unit and ARETURN shall return Unit
#KT-16880: Fixed
2017-12-21 18:08:39 +03:00
Mikhael Bogdanov 50608d0844 Don't delete nested default lambda classes during inline transformation 2017-12-21 12:52:29 +01:00
Mikhael Bogdanov b65dcf27ee Provide test source mapping data for separate and non-separate compilation
Compilation in same module or in separate ones
2017-12-21 12:52:28 +01:00
Mikhael Bogdanov f4f7c83eeb Copy nested objects of default lambda during inline 2017-12-21 12:52:28 +01:00
Mikhael Bogdanov 3513f1a86a Properly process default lambda source mapping
#KT-21827 Fixed
2017-12-21 12:52:27 +01:00
Mikhael Bogdanov 819a3a95b3 Add support for contract feature in inliner 2017-12-19 16:11:39 +01:00
Mikhail Zarechenskiy 9eca8cd451 [NI] Fix hierarchy of resolution atoms for lambda with non-local return 2017-12-19 15:11:04 +03:00