Commit Graph

3107 Commits

Author SHA1 Message Date
Igor Chevdar e468a347b5 [box-tests] Tests on field init optimization
Added tests on all primitive types and a test when the field's type is an inline class
2020-08-15 12:16:33 +05:00
Steven Schäfer 0328fcaf5d JVM IR: Avoid IMPLICIT_NOTNULL checks on special bridge methods
...with dynamic type checks, except for the `@PlatformDependent`
methods, for which the JVM backend adds null checks.
2020-08-14 21:59:33 +02:00
Steven Schäfer 9026f89ba5 JVM IR: Avoid CHECKCASTs on type operators (KT-39520)
The type information coming from Java or Kotlin generics may be wrong
due to type erasure and a CHECKCAST instruction could throw an
exception.
2020-08-14 21:58:47 +02:00
Ilmir Usmanov bcbb050326 Use fields for spilled variables for lambda parameters as well
In other words, do not generate p$ fields if we can use L$ fields,
which are being cleaned up.
 #KT-16222 Fixed
2020-08-13 15:52:51 +02:00
Mikhail Zarechenskiy aafe41cf7a Do not force coercion to Unit for nullable lambda return type
#KT-41005 Fixed
2020-08-13 10:40:51 +03:00
Ilmir Usmanov 00bf07fc41 Force boxing kotlin.Result return type of suspend functions
#KT-40843 Fixed
2020-08-11 22:10:47 +02:00
Ilmir Usmanov b06218c456 Minor. Update test data 2020-08-11 20:27:00 +02:00
Steven Schäfer 53fe30eb45 JVM IR: Don't produce CHECKCASTs on null constants (KT-36650) 2020-08-11 15:13:40 +02:00
Ilmir Usmanov d861373c6d Hack attributes for continuation of suspend function in SAM-adapter 2020-08-11 11:58:20 +02:00
Mikhail Zarechenskiy 2e131b870a Add tests for obsolete issues
#KT-38804 Obsolete
 #KT-38801 Obsolete
 #KT-38835 Obsolete
 #KT-38737 Obsolete
 #KT-38664 Obsolete
 #KT-38549 Obsolete
 #KT-38766 Obsolete
 #KT-38714 Obsolete
2020-08-11 12:34:02 +03:00
Mikhail Zarechenskiy e49cdf0ca2 Prohibit using suspend functions as SAM in fun interfaces
#KT-40978 Fixed
2020-08-10 22:04:16 +03:00
Mikhael Bogdanov 607f99ed3c Don't generate implicit overrides delegating to Java defaults
#KT-40920 Fixed
2020-08-10 20:03:23 +02:00
Georgy Bronnikov ea57b4cccb IR: add and unmute tests 2020-08-10 10:16:24 +03:00
Nick 4669e019d1 [FIR] Add diagnostic CONFLICTING_OVERLOADS & REDECLARATION 2020-08-10 10:09:37 +03:00
Ilmir Usmanov b403b63f48 Ease field initialization check
Since there is already VAL_REASSIGNMENT diagnostics, we can safely only
for direct assignments.
 #KT-40893 Fixed
2020-08-07 14:22:18 +02:00
Steven Schäfer ca6e430e89 JVM IR: Handle nested classes in DelegatedPropertyOptimizer 2020-08-06 21:01:59 +02:00
Jinseong Jeon 7ef1c74bbf FIR2IR: apply adapted reference conversion to coercion-to-unit 2020-08-05 17:07:27 +03:00
Mikhail Glukhikh f1356a809e Fir2IrLazySimpleFunction: generate overridden symbols via FirTypeScope 2020-08-05 12:11:33 +03:00
Victor Petukhov f45de9d8fb NI: approximate not top-level captured types during code generation
^KT-40693 Fixed
2020-08-05 10:36:36 +03:00
Ilmir Usmanov 405c9743ef Do not spill dispatch receiver of suspend functions if it is not used
#KT-20571
2020-08-04 15:42:36 +02:00
Jinseong Jeon 5db7957230 FIR2IR: use type arguments from fully expanded type 2020-08-04 14:44:38 +03:00
Mikhail Glukhikh 181a8bb79e [FIR TEST] Mute failing BB test with Byte/Short.and usage 2020-08-04 08:59:16 +03:00
Ivan Kylchik 0a28e5e031 Add argument unwrapping for case when argument is named 2020-08-04 08:59:15 +03:00
Mikhail Glukhikh 8379b3794a [FIR2IR] Return fallback mode for annotation resolved placeholder 2020-08-04 08:59:15 +03:00
Dmitriy Novozhilov b63257345b [FIR] Map Class to KClass in java annotations 2020-08-04 08:59:15 +03:00
Dmitriy Novozhilov 721b9b4d8c [FIR] Resolve annotations as calls 2020-08-04 08:59:14 +03:00
Jinseong Jeon 0e54f98b79 FIR: support adapted callable reference with vararg 2020-08-03 16:37:36 +03:00
Jinseong Jeon c744dfba9c FIR: distinguish anonymous object as enum entry when scoping
so that `this` reference with the enum entry name as label can be
resolved
2020-08-02 18:06:15 +03:00
Jinseong Jeon 52631b7abd FIR2IR: make local storage track scopes, including anonymous init 2020-08-02 18:05:09 +03:00
Ilmir Usmanov 4d21a496fe Minor. Update tests 2020-07-31 14:33:52 +02:00
Ilmir Usmanov fa8c6deb18 Support restricted suspend lambdas in JVM_IR
#KT-40135 Fixed
2020-07-30 20:40:37 +02:00
Ilmir Usmanov 2c205410fa Check whether the field is indeed being initialized
in checkFieldInExactlyOnceLambdaInitialization
 #KT-40691 Fixed
2020-07-30 19:04:54 +02:00
Jinseong Jeon bff36e0199 FIR2IR: convert annotations on FirTypeRef 2020-07-30 11:25:36 +03:00
Alexander Gorshenev 9a717e9ecf Don't copy default value parameters for fake overrides 2020-07-29 22:15:10 +03:00
Dmitry Petrov dae358c792 JVM: KT-40664 disable optimization for 'ULong in range of UInt' case 2020-07-29 20:33:17 +03:00
Dmitry Petrov f2493d0950 JVM: KT-40665 more exact check for intrinsified range 'contains' 2020-07-29 20:33:17 +03:00
Ilmir Usmanov 60875f96b4 Do not take LVT into account when calculating liveness of variables 2020-07-29 00:01:09 +02:00
Dmitry Petrov 980b91d082 JVM: generate 'Deprecated' on method as runtime-visible annotation
We generate @java.lang.Deprecated annotation on methods of $DefaultImpls
classes in compatibility mode. This annotation has RUNTIME retention and
should be visible.

Also, get rid of representing annotations as Class'es (yes we know that
these annotations are in compiler CLASSPATH, but we should not rely on
such classes and associated information).
2020-07-28 18:19:20 +03:00
Dmitry Petrov 4fdccb3b35 JVM_IR: don't generate repeated ElementType values in @Target 2020-07-28 18:19:20 +03:00
Jinseong Jeon da6e96f4f1 FIR2IR: don't declare dispatch receiver for local functions 2020-07-28 13:43:10 +03:00
Jinseong Jeon 5a3367e09c FIR: initial support of suspend conversion for function reference 2020-07-28 13:37:05 +03:00
Dmitry Petrov 89a0b3e944 Check class source in bytecode listing tests 2020-07-27 19:13:37 +03:00
Steven Schäfer 9d63412b3e JVM IR: Produce correct generic signatures for special bridge methods 2020-07-27 17:02:24 +02:00
Zalim Bashorov 635869f15a Rewrite className helper to fix tests on android
Since android tests preprocess test data and
(at least) replace package for files and fix package usages
it's preferred to use fqnames explicitly
instead of assembly them from parts, as it was before.
2020-07-25 15:28:36 +03:00
Dmitry Petrov 0741781462 Compare inner class access flags in bytecode listing tests 2020-07-23 19:13:28 +03:00
Jinseong Jeon 7872b21914 FIR: handle object invoke via type alias 2020-07-23 09:34:42 +03:00
Dmitry Petrov 1272162a7f JVM_IR: generate "safe" names for functions in init blocks 2020-07-22 19:49:48 +03:00
Jinseong Jeon e1abaa9b51 FIR: special visibility handling for monitor{Enter|Exit} 2020-07-22 12:16:32 +03:00
Pavel Punegov eecb43d4c9 Ignore test in Native backend 2020-07-21 11:26:57 +03:00
Dmitry Petrov 2e31f95554 Update testData 2020-07-20 20:04:32 +03:00