Mikaël Peltier
8676ca34d7
KT-22334 Specialized loops using range such as integer..array.size-1
...
- Into PrimitiveNumberRangeLiteralRangeValue modifies how bounded
value are created by checking if the high bound range can be modified
to be exclusive instead of inclusive such as the generated code will
be optimized.
- Add black box tests checking that the specialization does not fail
on any kind of arrays.
- Add a bytecode test checking that the code is correctly optimized.
Fix of https://youtrack.jetbrains.com/issue/KT-22334
2018-02-15 12:41:33 +03:00
Mikaël Peltier
8ab7e5c406
KT-10057 Use lcmp instead of Intrinsics.compare
...
Fix of https://youtrack.jetbrains.com/issue/KT-10057
2018-02-14 09:46:29 +01:00
Denis Zharkov
c47c1c5ffd
Fix runtime CCE in case of out-projected SAM
...
Probably, when NI is there this fix will become unnecessary because
there will be no approximation applied, thus the value parameter
will remain Hello<#Captured> instead of Nothing
#KT-17171 Fixed
2018-02-14 10:29:14 +03:00
Mikhail Zarechenskiy
e017e9cb5f
Support passing inline class values with spread operator
2018-02-13 13:16:45 +03:00
Mikhail Zarechenskiy
3919dc94e1
Box values of inline class types when passing to function as varargs
2018-02-13 13:16:44 +03:00
Mikhail Zarechenskiy
6687751cf5
Generate as check for inline classes using wrapper
...
Should be improved when inline class is based on non-null reference
2018-02-13 13:16:44 +03:00
Mikhail Zarechenskiy
a88dbefcd9
Generate is check for inline classes same as for primitives
...
Should be improved when inline class is based on non-null reference
2018-02-13 13:16:44 +03:00
Mikhail Zarechenskiy
d606e5bc89
Correct boxing for functional types containing inline classes
2018-02-13 13:16:43 +03:00
Mikhail Zarechenskiy
1d16d21dbb
Fix boxing for non-local and labeled returns with inline classes
2018-02-13 13:16:42 +03:00
Mikhail Zarechenskiy
80dd5c106e
Propagate KotlinType through call generator, fix boxing on arguments
2018-02-13 13:16:42 +03:00
Mikhail Zarechenskiy
22b9c25dd0
Add KotlinType info about this inside inline class
2018-02-13 13:16:41 +03:00
Mikhail Zarechenskiy
c86d3e354b
Skip call to the underlying value of inline class
2018-02-13 13:16:41 +03:00
Mikhail Zarechenskiy
2c279978c8
Fix generation of property accessor to the underlying value
2018-02-13 13:16:40 +03:00
Mikhail Zarechenskiy
ce601bebbe
Fix detection of erased this for inline class
2018-02-13 13:16:40 +03:00
Mikhail Zarechenskiy
059f1e9eed
Support inline classes working with collection elements (get/set)
2018-02-13 13:16:39 +03:00
Mikhail Zarechenskiy
8015295059
Desugar constructor call of inline class to the underlying value
...
Also add information about KotlinType to the constant stack values
2018-02-13 13:16:39 +03:00
Mikhail Zarechenskiy
6320368609
Add KotlinType to the Coercion stack value
2018-02-13 13:16:38 +03:00
Dmitry Petrov
839ebba157
ProperNumberComparisons is disabled by default (until LDC decision)
2018-02-13 09:26:00 +03:00
Dmitry Petrov
a790195808
Implement "proper numeric comparisons" support in JVM BE
2018-02-13 09:25:40 +03:00
Dmitry Petrov
e23a48e8d0
Minor: reformat code
2018-02-13 09:25:40 +03:00
Mikhail Zarechenskiy
0ecb3afdf7
Refactoring: rename AsmTypeAndKotlinType -> JvmKotlinType
2018-02-09 05:06:34 +03:00
Mikhail Zarechenskiy
913e4b42bb
Support inline classes as last expression in lambda
2018-02-09 05:06:32 +03:00
Mikhail Zarechenskiy
396cc7d02b
Support unboxing of inline classes in elvis
2018-02-09 05:06:31 +03:00
Mikhail Zarechenskiy
fefcddc803
Support boxing/unboxing for captured vars of inline class types
2018-02-09 05:06:29 +03:00
Mikhail Zarechenskiy
9f24bbd980
Support unboxing of inline classes after assertion operator
2018-02-09 05:06:27 +03:00
Mikhail Zarechenskiy
30c79ffadc
Support generating computable properties inside inline classes
2018-02-09 04:57:20 +03:00
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
4eb64fb4b9
Support mapping for inline classes based on type variables
2018-02-09 04:56:41 +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
b0ee61620c
Add KotlinType to methods coerceTo & coerceFrom
2018-02-09 02:08:11 +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
f856455841
Introduce stateless methods to map types without predefined mapping
2018-02-09 02:08:10 +03:00
Mikhail Zarechenskiy
1cdad65b9b
Refactoring: propagate KotlinType through hierarchy of StackValue
...
Mainly, this is needed to introduce boxing over inline classes
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
Mikhail Zarechenskiy
b08a32af2f
Fix local variables table for inline classes
2018-02-09 02:08:09 +03:00
Yan Zhulanow
a25e93d82a
Debugger: (EA-112731) Do not crash miserably if we don't know the anonymous class name
...
Continue to log the exception, avoid breaking UX
2018-02-08 19:36:38 +03:00
Ilmir Usmanov
87bbac9d43
Take coroutineContext into account in RedundantSuspendModifierInspection
...
#KT-22651: Fixed
2018-02-08 19:34:20 +03:00
Alexander Udalov
ff33e0bad3
Write/read module annotation FQ names to/from metadata on JVM
...
#KT-22759 In Progress
2018-02-08 17:07:23 +01: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
Alexander Udalov
80a7f92309
Extract logic to get function parameters for default value generation
...
For some reason, this logic was a bit different in JVM (FunctionCodegen)
and JS (FunctionBodyTranslator). For example, in JS the
EXPECTED_FUNCTION_SOURCE_WITH_DEFAULT_ARGUMENTS_NOT_FOUND diagnostic was
reported even in the case when no expected function was found for the
actual function at all, which made it quite difficult to write
multiplatform sources for JS stdlib where it both should be compiled as
a part of the multiplatform project, and by itself (suppressing
NO_ACTUAL_FOR_EXPECT): in the latter case, the new error must have been
suppressed everywhere as well
#KT-21913
2018-02-08 14:14:10 +01:00
Mikhael Bogdanov
0954d1ab1b
Don't generate hash in sam wrapper class name
...
#KT-17091 Fixed
2018-02-08 10:11:48 +01:00
Alexander Udalov
ba5cc65792
Rename JvmPackageTable -> JvmModuleProtoBuf, PackageTable -> Module
...
This protobuf message is going to contain more information about the
module than just the table of package parts
2018-02-07 17:25:43 +01:00
Yan Zhulanow
145ddf3b1f
Parcelable: Add CREATOR field (and other generated declarations) in light classes (KT-19300, KT-19853)
2018-02-06 22:15:59 +03: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