Commit Graph

87184 Commits

Author SHA1 Message Date
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
Nikolay Krasko eaf31b1ada Update org.jsoup:jsoup to 1.14.2 2021-08-27 20:32:23 +03:00
Roman Golyshev 08e9a3bc4f Process FirErrorResolvedQualifiers in KtFirReferenceShortener
Also, add `classId` default value to the `FirErrorResolvedQualifierImpl`
just as in `FirResolvedQualifierImpl` - it seemed inconsistent that
we can have a class symbol in error-resolved qualifier, but the
`classId` field will be `null`
2021-08-27 19:29:14 +03:00
Dmitriy Novozhilov f6e49776f8 [Test] Add fir.bench.use.build.file flag to FP intellij configurations 2021-08-27 19:02:58 +03:00
Dmitriy Novozhilov 455ed1bdc0 [Test] Add flag to full pipeline test which allows to use build file instead of regular args 2021-08-27 19:02:58 +03:00
Simon Ogorodnik 4a75222491 [FP] Pass module data to compiler via build file 2021-08-27 19:02:58 +03:00
Mikhail Glukhikh 020b6e9dd1 FIR Java: fix conversion of primitive type 2021-08-27 18:03:02 +03:00
pyos a12e31daf1 FIR: dump nested classes in loadJava tests
Because those test are single Java files, many of them use a top-level
class as a container for multiple classes to be tested. Such tests do
almost nothing if those nested classes aren't handled.
2021-08-27 18:03:01 +03:00
Dmitry Petrov c2b575505a JVM_IR KT-48432 fix overflow in const-bound range optimization 2021-08-27 16:42:52 +03:00
Igor Chevdar ce44403d1b [K/N][IR][codegen] Made lazy init logic JVM-like
Now a file will be initialized only if a top level function has been called
rather than any function like was before the commit
2021-08-27 18:22:52 +05:00
Igor Chevdar e6be5e4266 [K/N][codegen][runtime] Removed remnants of main thread init logic 2021-08-27 18:22:51 +05:00
sebastian.sellmair ae88689e58 [Gradle] Improve NativeDistributionCommonizerTask's cold startup performance
This is done by removing support for Gradle's UP-TO-DATE checker
in favour of our own 'NativeDistributionCommonizationCache'
2021-08-27 12:26:06 +00:00
Igor Yakovlev e802ef27f1 [FIR IDE] Fix invalid lazy expressions for property initializers 2021-08-27 14:55:34 +03:00
Dmitriy Dolovov 19e5e7d511 [Test] Use lazy JUnit5 assertion messages 2021-08-27 08:18:24 +00:00
Jinseong Jeon a711280b6c FIR IDE: APIs to unwrap upper/lower bounds of flexible KtType 2021-08-26 22:30:49 +03:00
Jinseong Jeon dca8789659 FIR IDE: API to determine if the given KtType is a functional interface type 2021-08-26 22:30:49 +03:00
Jinseong Jeon b7a99eca55 FIR IDE: expected type of lambdas and block expression 2021-08-26 22:30:49 +03:00
Jinseong Jeon da3f2c2095 FIR IDE: new symbol/kind/pointer/resolver for SAM constructor 2021-08-26 22:30:48 +03:00
Dmitry Petrov 7df5ebf6ee JVM_IR KT-48433 don't generate null check on 'this$0' parameter 2021-08-26 20:06:20 +03:00
Dmitry Petrov dd98f72fd7 JVM_IR KT-42010 use IINC for postfix int increment/decrement 2021-08-26 20:06:19 +03:00
Georgy Bronnikov ef72413da9 Revert "JVM_IR: use computeIfAbsent in ClassCodegen.getOrCreate()"
This reverts commit 32518eee4b.

Reason: the commit causes lockups in ClassCodegen.
2021-08-26 17:52:42 +03:00
Ilya Matveev d32b42c538 [K/N][New MM] Add runtime asserts to state switch functions 2021-08-26 14:46:08 +00:00
Ilya Matveev 463bc22bf3 [K/N] Enable callbackOnSeparateThread test since KT-44283 is fixed 2021-08-26 14:46:07 +00:00
Ilya Matveev 99bd26c2ef [K/N][Runtime] Switch thread states in termination handlers 2021-08-26 14:46:07 +00:00
Ilya Matveev a1f6c70355 [K/N][Runtime] Use the objc module in the unit tests
Calling initRuntime requires some machinery from the
objc module (e.g. adding the toKotlin method to NSObject).

Include this module to the tests to allow full runtime
initialization in the tests
2021-08-26 14:46:06 +00:00
Ilya Matveev e85761bc47 [K/N][Runtime] Support nice mocks for scoped mock functions 2021-08-26 14:46:06 +00:00
Mark Punzalan f098bf449c HL API: Remove unused // CALL directive in resolve call test data. 2021-08-26 15:52:13 +03:00