Commit Graph

2511 Commits

Author SHA1 Message Date
Mikhael Bogdanov 2808e45b89 Enable test in js, native 2017-07-05 11:15:38 +02:00
Alexander Udalov d97fa604e1 Write metadata for suspend function into anonymous coroutine classes
To render nice Kotlin types in toString() of continuation
2017-07-04 19:41:48 +03:00
Dmitry Petrov 16505daeea Fix 'equals' for NotNullBasicValue
NotNullBasicValues were merged incorrectly sometimes,
which caused problems with INSTANCEOF checks.

 #KT-18779 Fixed
2017-07-04 12:19:10 +03:00
Mikhael Bogdanov 8121c1d3c4 Update test to support js-backend 2017-07-04 10:12:42 +02:00
Mikhael Bogdanov 8666b95dd2 Delete local variables on default mask expantion
#KT-18792 Fixed
2017-07-03 17:01:06 +02:00
Mikhael Bogdanov 01e2f8e32c Preventively allocate slots for additional default parameters
Otherwise they are corrupted by inline
2017-07-03 17:01:06 +02:00
Mikhael Bogdanov 49252f6eec Properly process primitive receiver on inlining bound callable references
#KT-18728 Fixed
2017-07-03 10:51:51 +02:00
Mikhael Bogdanov 4f914fafca Calculate default mask shift properly
#KT-18689 Fixed
2017-06-29 14:57:42 +02:00
Mikhael Bogdanov 69457ef3f1 Generate optimized hashCode for primitive type with jvmTarget 1.8+
#KT-7571 Fixed
2017-06-28 13:44:07 +02:00
Igor Chevdar d7e4350d42 Ignored/fixed some tests for Kotlin/Native 2017-06-28 12:54:32 +03:00
Denis Zharkov 3dc4f8a2ff Do not write generics for $suspendImpl synthetic method
#KT-18252 Fixed
2017-06-28 10:25:08 +03:00
Dmitry Petrov d5e02f069a Fast version for POP backward propagation (without SourceInterpreter) 2017-06-27 14:28:42 +03:00
Dmitry Petrov a84c2a6f31 Improve string concatentation & string templates code generation
Reuse StringBuilder instances for nested subexpressions.
(NB StringBuilder instance for string template with a string
concatenation inside an expression entry, such as `"${"a" + "b"}"`,
will not be reused, although that doesn't seem to be a real-life issue).

 #KT-18558 Fixed Target versions 1.1.4
 #KT-13682 Fixed Target versions 1.1.4

Join adjacent strings literals, escaped strings, and constant values
(in a language version that supports const val inlining).
Use StringBuilder#append(char) for single-character constants
(e.g., " " in "$a $b").

 #KT-17280 Fixed Target versions 1.1.4
 #KT-15235 Fixed Target versions 1.1.4
2017-06-27 14:28:42 +03:00
Alexander Udalov 233b63469a Fix IllegalAccessException on private annotation in reflection
#KT-14094 Fixed
2017-06-21 15:43:00 +03:00
Alexander Udalov 6388c1885c Fix KCallable.call for protected members from base class
Class.getMethod does not return protected methods from super class, so
we invoke getDeclaredMethod on each super class manually instead

 #KT-18480 Fixed
2017-06-21 15:42:59 +03:00
Alexander Udalov 8ef3531c48 Add kotlin.Any to KClass.superclasses if it's absent
#KT-18476 Fixed
2017-06-20 14:39:48 +03:00
Alexander Udalov 90f2ea87a6 Fix exception on callBy of callable with more than 32 parameters
The previous condition that checked if we'd skipped any optional
parameters didn't work when number of parameters > 32 because the number
of bit masks in that case was more than one

 #KT-18404 Fixed
2017-06-20 14:39:47 +03:00
Dmitry Petrov 786ac46fa6 Do not store nulls for captured variables going out of scope
These values can't be read after going out of scope.
JVM implementation can take care of such object references on its own.
Ref objects for captured variables are not different from any other
objects stored in local variables, so there's really no reason to
nullify these references explicitly.

 #KT-18478 Fixed Target versions 1.1.4
2017-06-20 13:31:36 +03:00
Alexey Andreev d3a5201ecc Intrinsify String?.plus in JS BE
See KT-8020
2017-06-20 10:40:21 +03:00
Alexey Andreev 4252d9786b Fix translation of interface with non-abstract methods in JS BE
Fix additional case of generic interfaces in KT-18187
2017-06-08 13:51:18 +03:00
Dmitry Petrov 08885e273b Support additional intrinsics in null check elimination
1. checkExpressionValueIsNotNull implies checked value is non-null

2. throwNpe never returns

 #KT-18162 Fixed Target versions 1.1.4
 #KT-18164 Fixed Target versions 1.1.4
2017-05-31 16:48:14 +03:00
Dmitry Petrov d559212d70 Optimize out trivial INSTANCEOF checks
#KT-18157 Fixed Target versions 1.1.4
2017-05-31 16:48:14 +03:00
Alexey Andreev e6b0cc64bd Fix copying of non-abstract functions of interfaces in JS BE
Fix copying of non-abstract functions of interfaces to implementing
classes when implementing class inherits interface via 2+ paths.

See KT-18187
2017-05-31 11:21:13 +03:00
Dmitry Petrov 17d2472511 Do not patch generic signature for methods with special bridges
Somewhat awkward solution for KT-18189.
2017-05-31 10:18:48 +03:00
Dmitry Petrov fd00a6fbe8 Generate generic signatures for special bridges
#KT-12408 Fixed Target versions 1.1.4
2017-05-31 10:18:48 +03:00
Dmitry Petrov 48a60e6f39 Dump generic signatures in bytecode listing tests if required
Add '// WITH_SIGNATURES' to test file if generic signatures should be
dumped.
2017-05-31 10:18:48 +03:00
Alexey Andreev 24c0a1e7ce Fix translation of delegated functions with default params in JS BE
See KT-17285
2017-05-29 15:30:28 +03:00
Alexey Andreev 383e273fed In LightAnalysisModeTestGenerated skip tests ignored in JVM
When a test is marked as ignored in JVM BE (i.e. IGNORE_BACKEND: JVM)
it's ignored in LightAnalysisModeTestGenerated. This means that
this tests is expected to fail. However, often tests that fail
in JVM blackbox tests, don't fail in LAMTG, therefore it's reasonable
to skip these tests in LAMTG at all.
2017-05-29 15:30:27 +03:00
Denis Zharkov 2c98bd053a Fix super calls to suspend functions in abstract classes 2017-05-29 10:58:18 +03:00
Alexey Andreev dde50a34db Fix comparison of boolean values in JS BE
See KT-16984
2017-05-26 18:26:08 +03:00
Mikhael Bogdanov 3f7bf8467a Process non-aload0 outer access in constructor during inline
#KT-17972 Fixed
2017-05-26 09:24:10 +02:00
Mikhail Zarechenskiy d0e26c6527 Support underscores in non local destructuring declarations 2017-05-25 16:46:06 +03:00
Mikhail Zarechenskiy 47f2386212 Generate non-local destructuring declarations as properties
#KT-5620 Fixed
 #KT-15810 Fixed
2017-05-25 16:46:05 +03:00
Alexey Andreev 0e31c14a86 Implement inlining of default parameters in JS BE
Fix KT-17910
2017-05-25 14:38:53 +03:00
Dmitry Petrov 7600b6de52 Allow top-level type aliases in scripts 2017-05-24 11:20:22 +03:00
Denis Zharkov 52b2e632df Simplify generated code for rangeTo/concat intrinsics
The main reason is avoiding complicated operations like
dup + dup_x2 + pop2 for instances obtained by NEW instruction.

Otherwise it leads to problems in performRefinedTypeAnalysis
because code there has a sensible assumption that NEW instances
can be only dupped or stored into a local (rare cases)

 #KT-17457 Fixed
2017-05-22 14:51:04 +03:00
Dmitry Petrov 39aa97eebf Use Intrinsics#compare when specializing compareTo for ints 2017-05-22 11:57:20 +03:00
Dmitry Petrov e1b41eee15 Specialize Comparable#compareTo for boxed primitives
Support Comparable#compareTo for boxed primitive in redundant
boxing/unboxing analysis, along with CHECKCAST to java.lang.Comparable.

Note that we can do that for Float and Double, too, because
Float#compareTo(Float) and Double#compareTo(Double) are delegated to
Float#compare(float, float) and Double#compare(double, double),
respectively.

Fuse specialized comparison for integers with conditional jumps
if possible (both for Comparable#compareTo and Intrinsics#areEqual).

 #KT-11959 Fixed
2017-05-22 11:57:20 +03:00
Mikhael Bogdanov 47fec6c9d5 Wrap captured local delegated property into Delegate
#KT-16864 Fixed
2017-05-19 09:53:19 +02:00
Mikhael Bogdanov 511c9f86b1 Add new test on receiver clash during default lambda inlining 2017-05-18 18:18:15 +02:00
Mikhael Bogdanov ec23df1d29 Extract callable reference tests to separate directory 2017-05-18 18:18:15 +02:00
Mikhael Bogdanov f4a388cf71 Add new tests for default lambda inlining 2017-05-18 18:18:14 +02:00
Alexander Udalov 52237ce77f Fix KClass.java intrinsic for stack values of type Unit
#KT-17692 Fixed
2017-05-18 13:29:04 +03:00
Denis Zharkov 49453ca705 Avoid dependency on coroutine-related public API changes
These changes has been introduced in c3a032ea0b
to support new scheme for named functions

At the same time they can be avoided by generating some additional
code/accessors in the anonymous classes for coroutine state

Now we cannot simply remove introduced API because of bootstrap problems

 #KT-17898 Fixed
2017-05-18 12:42:12 +03:00
Mikhael Bogdanov d9dc2bd443 Minor. Fix review remarks 2017-05-17 10:20:04 +02:00
Mikhael Bogdanov fd561c6cb9 Support default bound callable reference inlining
#KT-6884 Fixed
2017-05-17 10:20:03 +02:00
Mikhael Bogdanov 05d2aa700b Support default property reference inlining 2017-05-17 10:19:55 +02:00
Mikhael Bogdanov a96fada230 Switch tests for default lambda inlining on language level 1.2 2017-05-17 10:19:55 +02:00
Mikhael Bogdanov 0ac23c789e Add diagnostics for default lambda inlining 2017-05-17 10:19:54 +02:00
Mikhael Bogdanov 6730fa2bbf Support default inline lambda reification 2017-05-17 10:19:51 +02:00