Commit Graph

6615 Commits

Author SHA1 Message Date
Anton Bannykh 6edf138460 JS IR: muted newly failing tests 2018-06-21 13:27:17 +03:00
Anton Bannykh 04a2ffc0c1 JS IR: unmute tests 2018-06-21 13:27:17 +03:00
Anton Bannykh 9039b75c25 JS IR: unmute tests 2018-06-21 13:27:17 +03:00
Dmitry Petrov d546fca876 Enable JS_IR back-end on passing 'when' tests 2018-06-21 12:32:00 +03:00
Dmitry Petrov c312fddb45 Ignore some 'when' subject variable tests in JS_IR be 2018-06-20 14:06:34 +03:00
Dmitry Petrov a4b5d74ae3 Generate debug information for 'when' subject variable
NB debugger tests currently don't support language version or individual
language feature settings.
2018-06-20 14:06:34 +03:00
Dmitry Petrov a7492e91c9 Check that subject expression is evaluated only once 2018-06-20 14:06:34 +03:00
Dmitry Petrov 6194cfc782 Additional IEEE754-related tests for subject variable in 'when' 2018-06-20 14:06:34 +03:00
Dmitry Petrov 34b76a3718 Support subject variable in specialized code generators for 'when' 2018-06-20 14:06:34 +03:00
Dmitry Petrov 6949610dcb 'val' in 'when': IEEE754 equality 2018-06-20 14:06:34 +03:00
Dmitry Petrov d6894091a9 Support 'when' with subject variable in JVM BE 2018-06-20 14:06:34 +03:00
Mikhail Zarechenskiy fcacdc1fc5 Fix bridge methods generation when inline class types are used 2018-06-19 20:09:35 +03:00
Mikhail Zarechenskiy f326fd66be Propagate KotlinType into if expression codegen for inline classes 2018-06-19 19:54:22 +03:00
Roman Artemev f69bd54d6c [JS IR BE] Update test data 2018-06-19 17:09:31 +03:00
Alexander Udalov e689733f69 Revert "Map Kotlin TYPE target to Java TYPE_USE in bytecode"
This reverts commit d122406dca.

See KT-23857

 #KT-24952 Fixed
2018-06-19 12:08:18 +02:00
Alexander Udalov 863639c9ab Revert changes to data class equals/hashCode (KT-12330)
This looked like a small and useful change, but caused so many issues
(KT-24474, KT-24790, 30b9caea, and another unreported one -- see the
test update in this commit) that it didn't pay off after all. The
optimization is not that critical for now, as it's only relevant for
data classes where component types have trivial equals/hashCode
implementation, which is not very often

 #KT-12330 Declined
2018-06-19 12:05:55 +02:00
Mikhail Zarechenskiy 6431934c13 Fix signature mapping for built-in methods inside erased inline class 2018-06-18 18:55:18 +03:00
Mikhail Zarechenskiy 8503194e0d Temporarily mute test for JS target 2018-06-18 18:36:36 +03:00
Anton Bannykh b551afb202 JS IR: minor fix for callable ref translation
The caching variable has to have no initializers so that there is no
dependence on evaluation order.
2018-06-18 13:15:19 +03:00
Anton Bannykh 43e3314255 JS IR: Remove inline functions with reified type parameters
Otherwise we cannot handle type casts
2018-06-18 13:15:19 +03:00
Anton Bannykh 3808d77bf4 JS IR: inliner 2018-06-18 13:15:19 +03:00
Anton Bannykh d938c91711 JS IR: top-level initializer lowering 2018-06-18 13:15:19 +03:00
Mikhail Zarechenskiy c5160a6a95 Don't use methods from super interface if call was on inline class type
Some methods (like `size` from kotlin.collections.Collection) have
 special rules for mapping and overriding. For example, when we call
 `size`, normally there will be `INVOKEVIRTUAL size()` in the bytecode,
 but for inline classes it should be `INVOKESTATIC ...$Erased.getSize()`
2018-06-18 12:35:31 +03:00
Mikhail Zarechenskiy 246d5e294c Fix bytecode optimisations for consequent boxing 2018-06-18 11:52:37 +03:00
Mikhail Zarechenskiy 01d9be65bc Perform bytecode optimisations for inline classes
#KT-23742 Fixed
2018-06-18 11:52:36 +03:00
Ilmir Usmanov 192f311128 Minor. Ignore test is JS_IR. 2018-06-15 15:43:56 +03:00
Roman Artemev 6ac4fd2e5f [JS IR BE] Update test data 2018-06-14 19:54:30 +03:00
Anton Bannykh 05123c13f8 [JS IR BE] mute ranges' tests 2018-06-14 18:17:43 +03:00
Alexander Udalov 5d76e463d3 Fix exception from reflection on local delegated properties
The problem was that in JvmSerializerExtension.writeLocalProperties, we
only serialized metadata for local properties, but indices generated in
MemberCodegen.generatePropertyMetadataArrayFieldIfNeeded were among all
delegated properties in the class (not only local). This behaved
incorrectly as long as there was a local and a non-local delegated
property in the same class. For example, if there were 5 non-local
properties and then one local, that local property would get the index 5
and the synthetic signature "<v#5>". But there would only be one
Property entry in the metadata, and so reflection would fail here trying
to load the 5th element of the list which contains only one element.

Now, the index for a local delegated property is computed only as the
number of _local_ delegated properties above it in the class, i.e. the
first local delegated property gets index 0 (and synthetic signature
"<v#0>"), the next one -- index 1, and so on.

 #KT-23413 Fixed
2018-06-14 11:07:26 +02:00
Alexander Udalov 813d7fcb6a Fix bytecode for equals/hashCode of data classes once again
#KT-24790 Fixed
2018-06-13 16:06:20 +02:00
Ilmir Usmanov 6b777356e8 Add test with java reflection 2018-06-13 15:08:32 +03:00
Ilmir Usmanov de7aa23119 Make private inline suspend functions effectively inline-only 2018-06-13 15:08:26 +03:00
Ilmir Usmanov 8a5ae16947 Generate separate methods for inline and noinline uses of inline suspend functions
Previously, inline suspend functions were effectively inline only,
but ordinary inline functions can be used as noinline.
To fix the issue, I generate two functions: one for inline with suffix
$$forInline and without state machine; and the other one without any
suffix and state machine for direct calls.
This change does not affect effectively inline only suspend functions,
i.e. functions with reified generics, annotated with @InlineOnly
annotation and functions with crossinline parameters.
 #KT-20219: Fixed
2018-06-13 15:08:19 +03:00
Alexander Udalov bb4972b00e Regenerate tests 2018-06-12 14:01:33 +02:00
Anton Bannykh 675d02093d mute new test + regenerate tests 2018-06-09 19:59:19 +03:00
Anton Bannykh 5fdc304a51 JS_IR: mute coroutine tests 2018-06-09 19:15:38 +03:00
Anton Bannykh 96355e2732 JS IR: mute codegen box tests automatically 2018-06-09 19:15:38 +03:00
Yan Zhulanow 5f43808cfd Revert "Debugger: Fix breakpoints and stepping for inline-only function lambda arguments (#KT-23064)" 2018-06-08 19:37:20 +03:00
Mikhail Zarechenskiy d29f3fc3c5 Add test to check work of inline classes with callable references 2018-06-08 19:14:41 +03:00
Mikhael Bogdanov a0060dd25b Generate synthetic method for @JvmDefault properties in DefaultImpls 2018-06-08 10:08:23 +02:00
Mikhail Zarechenskiy fb1fbf1473 Temporary mute tests on unsigned types for JS backend 2018-06-04 18:37:47 +03:00
Mikhail Zarechenskiy cc19e4cd73 Refactoring: Move blackbox tests about unsigned types to new directory 2018-06-04 18:37:44 +03:00
Mikhail Zarechenskiy 5b5d9dd5a0 Allow unsigned integers overflow values of corresponding signed numbers 2018-06-04 18:37:40 +03:00
Mikhail Zarechenskiy 7d5fdb660d Treat number with unsigned literal as UByte & UShort & UInt & ULong 2018-06-04 18:37:36 +03:00
Mikhail Zarechenskiy 656f6cbded Support constant evaluation of unsigned type constructors
#KT-23816 In Progress
2018-06-04 18:37:34 +03:00
Mikhail Zarechenskiy e5958d228a Introduce WITH_UNSIGNED directive to use unsigned types in tests 2018-06-04 18:19:30 +03:00
Stanislav Erokhin 8f0b073c08 [NI] Prototype for SAM-conversion.
Supported:
- conversion in resolution parts. Also sam-with-receiver is supported automatically
- separate flag for kotlin function with java SAM as parameters

TODO:
- fix overload conflict error when function type is the same byte origin types is ordered
- consider case when parameter type is T, T <:> Runnable
- support vararg of Runnable

[NI] Turn off synthetic scope with SAM adapter functions if NI enabled
2018-06-04 12:21:56 +03:00
Alexander Udalov b5007c417d Minor, restructure reflection tests a little
To allow their usage in https://github.com/udalov/kotlin-obfuscation-test-app
2018-05-30 13:03:10 +02:00
Mikhael Bogdanov ad717d5335 Support properties in compatibility mode 2018-05-29 15:08:07 +02:00
Mikhael Bogdanov 020573ef3c Don't generate compatibility suffix twice for properties 2018-05-29 09:29:48 +02:00