Commit Graph

85410 Commits

Author SHA1 Message Date
Alexander Shabalin f265cd49ea [K/N] Feedback section for the new MM migration guide 2021-08-31 12:30:54 +00:00
Alexander Udalov 04c5bbdcf8 JVM IR: change generation scheme of property $delegate methods
Generate $delegate method as instance method in
PropertyReferenceDelegationLowering, and remove dispatch receiver later
in MakePropertyDelegateMethodsStatic. The method needs to be static to
be non-overridable (see delegateMethodIsNonOverridable.kt), and public
to be accessible in reflection.

Otherwise we generated incorrect IR where a static function accessed an
instance field of the containing class, which failed in multiple places
including LocalDeclarationsLowering.

 #KT-48350 Fixed
2021-08-31 14:07:22 +02:00
Mark Punzalan 50508da156 HL API: Add type parameters and visibility to KtTypeAliasSymbol. 2021-08-31 14:59:06 +03:00
Mark Punzalan c2529a4abb HL API: Handle resolve case when source for FirResolvedQualifier is a
KtCallExpression.
2021-08-31 14:59:06 +03:00
Mark Punzalan cba77452f3 FIR: Add candidates to ConeFunctionCallExpectedError. 2021-08-31 14:59:06 +03:00
Mark Punzalan 16eabf0ff1 FIR: Add ConeDiagnosticWithCandidates and
ConeDiagnosticWithSingleCandidate to ConeDiagnostic type hierarchy.
2021-08-31 14:59:06 +03:00
Mark Punzalan db38cd95da HL API: Add candidate symbols to KtClassErrorType.
Also remove redundant
FirReferenceResolveHelper.getFirSymbolsByErrorNamedReference() in favor
of FirUtils.getCandidateSymbols(), and add more candidate symbols from
more ConeDiagnostic subclasses.
2021-08-31 14:59:06 +03:00
Mark Punzalan fb0d946e50 HL API: Make all symbol marker classes inherit from KtSymbol. 2021-08-31 14:59:06 +03:00
Sergey Bogolepov dc29618857 [K/N] Fix KT-48523 2021-08-31 11:54:45 +00:00
Mark Punzalan 34e6459014 FIR: Ensure that the array set argument (on RHS of =) is always mapped
to the last parameter of the set operator function, even if there are
missing or too many index arguments.
2021-08-31 14:52:28 +03:00
SvyatoslavScherbina 2bb3e94ef7 kotlin-native/NEW_MM.md: update Kotlin version 2021-08-31 13:59:47 +03:00
Ilmir Usmanov 0733dbf2d5 Minor. Regenerate tests 2021-08-31 12:05:35 +03:00
pyos 5e4f022c59 JVM_IR: use nullability when boxing/unboxing inline class types
Given inline class V(Any?), a coercion from (Object, V) to (Object, V?)
is boxing.

In theory, the same issue in the old backend can be fixed by making
`KotlinTypeMapper.mapUnderlyingTypeOfInlineClassType` use
`computeExpandedTypeForInlineClass`, but for some reason this breaks a
lot of stuff.

 #KT-48430 Fixed
2021-08-31 12:05:34 +03:00
Svyatoslav Scherbina d4a8c51637 Native: report a warning on invalid characters in identifiers
This will become an error in Kotlin 1.7.

^KT-46182 Fixed
2021-08-31 08:50:14 +00:00
Svyatoslav Scherbina 64dc19fafb Update kotlin-native/NEW_MM.md 2021-08-31 08:30:09 +00:00
Sergey Bogolepov 712f7daeb2 [K/N] mention freezing binaryOption in NEW_MM.md 2021-08-31 07:40:46 +00:00
Steven Schäfer b2e6e075ab Parcelize: Fix diagnostics for parcelable value classes 2021-08-31 02:48:03 +02:00
Mikhail Glukhikh 153ca8675f Fail fast in case of invalidation in getContributedClassifier
Related to IDE problems like descriptor not found
2021-08-31 00:25:38 +03:00
Jinseong Jeon 24abf7168c FIR LC: get origin of property accessors via light member origin 2021-08-30 23:13:23 +03:00
Jinseong Jeon dbce9b3d45 FIR LC: use FirLightParameterList for setter parameter
to preserve the parent chain from setter parameter to setter
2021-08-30 23:13:22 +03:00
sebastian.sellmair 5a63498963 [Commonizer] Use qualified name string for 'UnsafeNumber' annotation
^KT-48459
^KT-48455
2021-08-30 19:25:43 +00:00
sebastian.sellmair e7e3cedf69 [Commonizer] Finalize tests for ^KT-48455 2021-08-30 19:25:43 +00:00
sebastian.sellmair 60ccdf23ea [Commonizer] Choose lower bit width numbers for optimistic number commonization
^KT-48455
2021-08-30 19:25:43 +00:00
sebastian.sellmair 642bb68916 [Commonizer] Rename TargetDependentCommonizer.kt to SingleInvocationCommonizer.kt 2021-08-30 19:25:42 +00:00
sebastian.sellmair f7839e847a [Commonizer] Emit 'UnsafeNumber' for optimistically commonized typealias
^KT-48459 Verification Pending
2021-08-30 19:25:42 +00:00
sebastian.sellmair bff62aba5f [Native] Implement 'kotlinx.cinterop.UnsafeNumber' interface
^KT-48459
2021-08-30 19:25:41 +00:00
sebastian.sellmair 814a147a53 [Commonizer] Implement optimistic number commonization for typealias
When typealias point to a number of different bit width on
certain platforms, this implementation will choose
the number type with higher bit width as commonization result
for typealias types and typealias underlying types.

This will effectively port the "analyse code for a single
selected platform" UX approach into HMPP (for numbers only)

^KT-48455 Verification Pending
2021-08-30 19:25:41 +00:00
Alexander Udalov fbfbb0c72c CLI: support false and true values for boolean -X arguments
#KT-48417 Fixed
2021-08-30 19:45:03 +02:00
Alexander Udalov a37642e5af Minor, cleanup CLITool
Reformat, remove unused code which was copied to another place in
04b04ea0ee.
2021-08-30 19:45:02 +02:00
Alexander Udalov 0b11d4214c Make typeOf stable since 1.6
#KT-45396 Fixed
2021-08-30 19:36:32 +02:00
Alexander Udalov 98be418245 Uncomment new SinceKotlin and remove obsolete warning suppressions 2021-08-30 19:36:32 +02:00
Alexander Udalov 6c400ce864 Build: update kotlinLanguageVersion to 1.6
Update binary-compatibility-validator dependency to 0.7.1 to allow it to
read Kotlin metadata of version 1.6.

 #KT-48445
2021-08-30 19:36:32 +02:00
Denis.Zharkov 019001ca20 Optimize memory footprint related to empty/single element collections
^KT-47926 Related
2021-08-30 16:51:55 +03:00
Denis.Zharkov 112af9b145 FIR: Rework bare types support
^KT-48305 Fixed
2021-08-30 16:24:44 +03:00
Sergey Bogolepov 587146679d [K/N] Add tests for -Xbinary=freezing=... 2021-08-30 12:33:04 +00:00
Sergey Bogolepov 4b5a7c6646 [K/N] Add binary option to disable freezing
We don't want to deprecate freezing at all, but it is possible
that freezing, new memory model and lazy global initialization
combination might not work in some cases. It might be a problem
when such case appears in 3rd-party library that user can't fix.

To mitigate this problem this commit introduces `freezing` binary
option. It has three variants:
* Full - ol' good behavior.
* Disabled - well, no freezing at all.
* ExplicitOnly - a compromise when user want to freeze something
themselves, but something is messed up during globals initialization.
2021-08-30 12:33:03 +00:00
Alexander Shabalin db34f67c1c [K/N] New MM migration guide 2021-08-30 11:53:14 +00:00
Ilmir Usmanov 92fac304e7 Forbid @Synchronized annotation on suspend functions
and lambdas. With warning for now.
 #KT-27333
2021-08-30 13:47:34 +02:00
Ilmir Usmanov 97176b5d60 Remove experimental coroutines wrapper generation 2021-08-30 14:21:58 +03:00
Ilmir Usmanov 1f8dd45c2b Remove experimental coroutines support. Part 2 2021-08-30 14:21:57 +03:00
Dmitriy Novozhilov 0ae18372c5 Revert "FIR: don't report EQUALITY_NOT_APPLICABLE for classes from java.*"
This reverts commit 73a8b4544a.
2021-08-30 14:11:31 +03:00
Ilmir Usmanov fdd069ddec Read experimental suspend functional types as suspend
Before 1.6 we wrote suspend functional types with last parameter of
kotlin.coroutines.experimental.Continuation type to .kotlin_metadata
files. For example, kotlin-stdlib-common. Thus, we need to read
them, since coroutines have been released in 1.3 and we need to be able
to read stable binaries.
2021-08-30 10:44:30 +02:00
Dmitriy Novozhilov 67dd23354c [FIR] Check compatibility of equality call between IT by component of each type
^KT-48113 Fixed
2021-08-30 11:11:50 +03:00
Svyatoslav Scherbina 5bdfa14a37 Native: make -Xbinary=memoryModel= equivalent to -memory-model=
In particular, the former now enables lazy initialization and hook-based
worker exception handling too, as intended.
2021-08-29 07:35:32 +00:00
Mads Ager a12b22c04d [JVM] Force lock object in JVM synchronized implementation into local.
This fixes a performance problem in the case where the lock object
is a capture and the monitor enter/exit happens directly on
field loads. When the locking happens on field loads instead of a
local, the JVM cannot prove that locking is balanced. That has
the consequence that the code is runs very slow (always in the
interpreter).

^KT-48367 Fixed.
2021-08-27 21:29:12 +02:00
Steven Schäfer 9fd777cb7d Parcelize: Add support for unsigned types on the IR backend 2021-08-27 21:28:31 +02:00
Steven Schäfer 34a200bf09 Parcelize: Refactor AndroidSymbols 2021-08-27 21:28:31 +02:00
Steven Schäfer 2f7bc8ca79 Parcelize: Add tests for parcelable value classes 2021-08-27 21:26:46 +02:00
Steven Schäfer a743669bc9 Parcelize: Fix type signatures in parcelable creator objects
These objects are visible from annotation processors and should not
refer to the type parameters of enclosing parcelable classes.
2021-08-27 21:26:46 +02:00
Steven Schäfer 0bbb36e765 Parcelize: Add tests for obsolete issues 2021-08-27 21:26:46 +02:00