Commit Graph

59618 Commits

Author SHA1 Message Date
Vladimir Dolzhenko 1b075340f8 Fixed dependencies for performance tests 2019-12-01 09:35:32 +01:00
Vladimir Dolzhenko f8a6217fb5 Fix compilation for 183 after adding support incremental analysis of comment and kdoc
Relates to #KT-35189
2019-11-30 18:50:44 +01:00
Alexander Gorshenev a923e0d130 Only allow version triples for klib metadata and ir versions 2019-11-30 18:37:38 +03:00
Alexander Gorshenev b0f077ff4b Plumbing KlibMetadataVersion and KlibIrVersion values to klib manifest 2019-11-30 18:37:38 +03:00
Alexander Udalov bf12f7eee0 JVM IR: do not lower trimIndent/trimMargin if API version is too high
We cannot be sure that we won't change behavior of these functions in
some corner cases, so only perform this optimization if the API version
specified by the user is not greater than the compiler's own stdlib
version it was compiled against. This is the same as the similar code in
the old backend in IntrinsicMethods.
2019-11-29 19:39:55 +01:00
Ilya Gorbunov 555d503ff9 Improve indexOf sample to showcase return value handling
Remove sample reference from indexOf(Char) overload: both overloads are on
the same page, and showing the sample for indexOf(String) under indexOf(Char)
is redundant and misleading.
2019-11-29 21:34:49 +03:00
Burak Eregar e30d87ee01 KT-20357: Add samples for indexOf 2019-11-29 21:34:49 +03:00
Vladimir Dolzhenko a6f829f267 Add secondary ctors to incremental analysis
Relates to #KT-35121
2019-11-29 18:30:01 +01:00
Kerooker c16b89d770 Fix XorWowRandom documentation
This commit changes XorWowRandom.kt documentation to include a HTTPS link instead of a HTTP link, for security purposes.

This commit also changes the same documentation to reflect the real cycles from the `xorwow` algorithm:

    Simple and very fast (125 million/sec), the elements in its cycle of 2^192 − 2^32 easily pass all the tests in Diehard.

 Marsaglia, G. 2003. Xorshift RNGs. J. Statis. Soft. 8, 14, p. 5

 At last, this commit explicits which part of the code is the implementation of the mentioned algorithm.

 Closes KT-35175
2019-11-29 19:31:55 +03:00
pyos 3e67ff097e JVM_IR: keep offsets of const val reads when inlining them 2019-11-29 16:49:52 +01:00
pyos e4b1599457 JVM_IR: do not erase constant non-static field initializers...
...unless in 1.4 mode.
2019-11-29 16:49:52 +01:00
pyos fc6b03b08f JVM_IR: move const initialization handling to lowering
Had to edit some bytecodeText tests to account for the fact that JVM_IR
no longer generates explicit initializations for ConstantValue fields,
but NoConstantValueAttributeForNonConstVals is not the default yet.
2019-11-29 16:49:52 +01:00
pyos 2ebe269448 IR: refactor InitializersLoweringBase and descendants 2019-11-29 16:49:51 +01:00
Mikhail Glukhikh a6f8859a49 FIR Java: generate accessors only in override Kotlin case, make them non-synthetic 2019-11-29 18:11:27 +03:00
Mikhail Glukhikh 5275b4d0fc Move possibleGetterNamesByPropertyName to FirSyntheticPropertiesScope 2019-11-29 18:11:26 +03:00
Mikhail Glukhikh d15dae6ac6 FIR: use SyntheticPropertySymbol & synthetic scope instead of FirAccessorSymbol
Before this commit, we used FirAccessorSymbol to emulate synthetic properties.
These symbols were generated in Java use-site scope.
Now, we use synthetic scope instead which is above MemberScopeTowerLevel.
This is more performance-friendly and does not require override matching.
However, accessor symbols should be used in situation when Java accessor
overrides Kotlin property which is broken in this commit
(that's why MapEntry test is corrupted here).
Also, we should not create synthetics for pure Kotlin accessors
(that's why javaAccessorConversion test is corrupted here).
2019-11-29 18:11:25 +03:00
Mikhail Glukhikh ae62ccb76d [FIR TEST]: add test with synthetic on Java getter overridden in Kotlin 2019-11-29 18:11:24 +03:00
Mikhail Glukhikh 88e260269f FIR resolve: consider SYNTHETIC_RESOLVED as tower-stopper 2019-11-29 18:11:23 +03:00
Mikhail Glukhikh 8bcae80877 [FIR TEST]: add test with Map.Entry-based J/K hierarchy 2019-11-29 18:11:22 +03:00
Mikhail Glukhikh 8a601b5a0e FIR accessors: add protection against special names 2019-11-29 18:11:21 +03:00
Mikhail Glukhikh b48a4ace57 FIR accessor symbols: check all possible getter name variants 2019-11-29 18:11:21 +03:00
Mikhail Glukhikh ed6238db4b FIR accessor symbols: support 'is' prefix 2019-11-29 18:11:20 +03:00
Mikhail Glukhikh eb90bd0e89 FIR: correctly process accessor symbols in derived classes 2019-11-29 18:11:19 +03:00
Mikhail Glukhikh f1eb0dff1f FIR: disable synthetic scope, make accessor symbols synthetic
Before this commit, we had two methods to do generally the same synthetic thing.
It's an attempt to keep only one of them.
Accessor symbols are generated in Java use-site member scopes,
at this place we know better whether we are in Java class or not.
However, we have to do this at every use-site level, which is relatively slow.
Also we could encounter problems when accessor function is overridden in Kotlin,
and accessor symbol can still contain reference to Java accessor.
2019-11-29 18:09:07 +03:00
Simon Ogorodnik 2f9c94bd9e [FIR] Fix Definitely Not Null type substitution 2019-11-29 18:04:49 +03:00
Simon Ogorodnik e5f60253f7 [FIR] Improve path usages in generator, provide default output 2019-11-29 18:04:48 +03:00
Simon Ogorodnik 5eb5d8e515 [FIR] Separate generated tree files from non-generated sources 2019-11-29 18:04:47 +03:00
Vladimir Dolzhenko 95129939d4 Add secondary ctors to incremental analysis
#KT-35121 Fixed
2019-11-29 15:45:09 +01:00
Vladimir Dolzhenko f709377735 Support incremental analysis of comment and kdoc
#KT-35189 Fixed
2019-11-29 15:44:58 +01:00
Dmitry Borodin 664d69b752 Add flatMap sample KT-20357 2019-11-29 17:35:06 +03:00
Vladimir Dolzhenko 29b25e3901 Reworked resolve references in background thread in PlainTextPasteImportResolver
Relates to #KT-16774
2019-11-29 15:27:20 +01:00
Dmitry Gridin 37371edb8c Auto-import: add quickfix for overloaded generic function
#KT-34667 Fixed
2019-11-29 21:09:24 +07:00
Dmitry Gridin 4b98430058 Formatter: fix line break after package & file annotation
#KT-23957 Fixed
2019-11-29 21:09:04 +07:00
Dat Trieu f334ad2ffc KT-20357: Add samples for associate* functions (#2798)
* KT-20357: Add samples for functions related to associate

* KT-20357: Use same fib function for both samples

* KT-20357: Use examples with duplicate keys and simplify examples with primitives

* KT-20357: Use primitive samples for all arrays

* KT-20357: Use String splitting example to better illustrate the use for associate over associateBy with a valueSelector
2019-11-29 16:54:02 +03:00
Mikhael Bogdanov d2e5432b2d Minor. Update test data 2019-11-29 13:49:13 +01:00
Ilya Chernikov b3c5362003 [NI] Fix diagnostic reporting for missing type parameter info
#KT-31975 fixed
2019-11-29 13:44:42 +01:00
Ilya Chernikov 7dd9ed7e38 [NI] Fix loosing type annotations on extension functions
#KT-32138 fixed
2019-11-29 13:44:41 +01:00
Mads Ager 467e6e3d97 JVM_IR: Fix field initialization in secondary enum constructors. 2019-11-29 13:40:18 +01:00
Mads Ager 8cd6dc0cd9 JVM_IR: Use IrInlineReferenceLocator for inline local var lowering. 2019-11-29 13:38:34 +01:00
Mads Ager e2a1cb1077 JVM_IR: Generate fake inlining local variables for debugging. 2019-11-29 13:38:34 +01:00
pyos fa8cb7b6e0 PSI2IR: support NewInference + SamConversionPerArgument
except for SAM conversions of varargs (which aren't implemented in the
non-IR JVM backend either btw)
2019-11-29 15:25:32 +03:00
Mikhael Bogdanov cf6f823d29 Use descriptor from resolved call to inline accessors
In case of inline it should be same descriptor (except of fake override), In general case getter could be synthetic accessor and in such case it's not inline
2019-11-29 13:15:42 +01:00
Mikhael Bogdanov 320c5f6f00 Cast dispatch receiver to actual declaration owner though inline
Otherwise corrupted frame information is generated in bytecode

 #KT-29242 Fixed
2019-11-29 13:15:42 +01:00
Ilya Goncharov 25dea2ccce [Gradle, JS] Add description of separator of java inner classes 2019-11-29 15:09:36 +03:00
Ilya Goncharov 8d123d209a [Gradle, JS] Add description of hack on our side to avoid IDEA run only JVM tests by gutters 2019-11-29 15:09:36 +03:00
Ilya Goncharov d02bcb30e3 [Gradle, JS] Move classNameOnlyRegExp to class level 2019-11-29 15:09:36 +03:00
Ilya Goncharov 38bd738724 [Gradle, JS] Add comments 2019-11-29 15:09:36 +03:00
Ilya Goncharov 418c0496f1 [Gradle, JS] Fix regex on method
- Find method declaration like not containing dot
2019-11-29 15:09:36 +03:00
Ilya Goncharov 3e1fe0af92 [Gradle, JS] Add exact filter by class name only 2019-11-29 15:09:36 +03:00
Ilya Goncharov 0037e74d3e [Gradle, JS] Fix StartsWith filter 2019-11-29 15:09:35 +03:00