Commit Graph

39095 Commits

Author SHA1 Message Date
baratynskiy be41364fdd AbstractCompileJavaAgainstKotlinTest: java -> kt 2017-05-17 17:42:04 +03:00
Denis Zharkov 63c5d85cf4 Optimize memory footprint for generated protobuf code
The problem was that an overload of CodedOutputStream.newInstance
without size uses 4000 as a default value, thus allocating
a 4k-sized byte array.
At the same time the array remained effectively unused
in the most cases since it only used for storing data
for unknown fields.

Because such arrays are being created for each read of
protobuf message, during compilation of IntelliJ project
it was producing 25% of redundant memory traffic.

Of course these arrays were all in the young gen, but still
they have some effect on GC
2017-05-17 14:34:11 +03:00
Denis Zharkov 692840860e Use allScope when resolving classifiers of binary classes
Otherwise it might lead to the problems when reading class files
from the source scope (e.g. a groovy file or an already compiled java file)

Note that it may be reproduced only with Maven because in JPS
and Gradle we reading source java files even when they're shouldn't be
recompiled, while in Maven we read class files in the case

 #KT-17897 Fixed
2017-05-17 14:33:23 +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 8a083a41d5 Clean code after transformation 2017-05-17 10:20:02 +02:00
Mikhael Bogdanov eca359f176 Convert RegeneratedLambdaFieldRemapper to Kotlin 2017-05-17 10:20:01 +02:00
Mikhael Bogdanov fe4668c315 Rename RegeneratedLambdaFieldRemapper.java to RegeneratedLambdaFieldRemapper.kt 2017-05-17 10:20:01 +02:00
Mikhael Bogdanov 77af888b6f Code clean after convertion 2017-05-17 10:20:00 +02:00
Mikhael Bogdanov 5b947ac27e Convert FieldRemapper to Kotlin 2017-05-17 10:19:59 +02:00
Mikhael Bogdanov f795f2777c Rename FieldRemapper.java to FieldRemapper.kt 2017-05-17 10:19:58 +02:00
Mikhael Bogdanov e86e128c8a Code clean after convertion 2017-05-17 10:19:58 +02:00
Mikhael Bogdanov fcd76e6dec Convert InlinedLambdaRemapper to Kotlin 2017-05-17 10:19:57 +02:00
Mikhael Bogdanov d1fdfd484b Rename InlinedLambdaRemapper.java to InlinedLambdaRemapper.kt 2017-05-17 10:19:56 +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 81c2e1dd8c Code clean after convertion 2017-05-17 10:19:53 +02:00
Mikhael Bogdanov 6373c3115a Convert LocalVarRemapper to Kotlin 2017-05-17 10:19:52 +02:00
Mikhael Bogdanov c6189076cc Rename LocalVarRemapper.java to LocalVarRemapper.kt 2017-05-17 10:19:51 +02:00
Mikhael Bogdanov 6730fa2bbf Support default inline lambda reification 2017-05-17 10:19:51 +02:00
Mikhael Bogdanov 9e8495dc3d Clean code 2017-05-17 10:19:50 +02:00
Mikhael Bogdanov 45bfb2075d Move reifiedTypeInliner to root context 2017-05-17 10:19:49 +02:00
Mikhael Bogdanov da13ea4a8a Move all InliningContext's to one place 2017-05-17 10:19:48 +02:00
Mikhael Bogdanov 9fdd4c647a Clean code. Add LambdaInfo to InliningContext 2017-05-17 10:19:48 +02:00
Mikhael Bogdanov 9dae183e3a Convert RootInliningContext.java to Kotlin 2017-05-17 10:19:47 +02:00
Mikhael Bogdanov 8b2164e2b8 Code clean after transformation 2017-05-17 10:19:46 +02:00
Mikhael Bogdanov fcbd27fdc4 Convert InliningContext.java to Kotlin 2017-05-17 10:19:45 +02:00
Mikhael Bogdanov 04cf5d49d6 Rename InliningContext.java to InliningContext.kt 2017-05-17 10:19:45 +02:00
Mikhael Bogdanov 309051bd21 Obtain reification marker on default lambda extraction.
Add reification tests.
2017-05-17 10:19:44 +02:00
Mikhael Bogdanov 47c5e64ba5 Sort smap data by output file name 2017-05-17 10:19:43 +02:00
Mikhael Bogdanov 3e50203283 Add source mapping tests for default lambda inlining 2017-05-17 10:19:42 +02:00
Pavel V. Talanov 21b32b9de5 IDE Performance: skip resolver construction for non-relevant modules
Querying non-existent packages does not trigger module resolver computation
2017-05-16 22:15:07 +03:00
Pavel V. Talanov 55721e4f16 Test not creating resolvers for modules that have no relevant packages 2017-05-16 22:15:06 +03:00
Pavel V. Talanov 77e611b2e7 Minor: refactor PerModulePackageCacheService 2017-05-16 22:15:05 +03:00
Pavel V. Talanov f750d08350 Light classes: test extending Number and CharSequence 2017-05-16 22:01:06 +03:00
Pavel V. Talanov 1c5e7c4726 Make sure java completion doesn't suggest classes from builtIns
Fix an undesirable sideeffect of previous changes
2017-05-16 22:01:05 +03:00
Pavel V. Talanov 798c80ed07 Use wrappers around java.util.* to emulate kotlin.collection.* behaviour
Backend: If kotlin class extends kotlin.collection.List
    write it as it's super interface (light class mode only)
IDE: Provide wrapper classes to java resolve
    that try to emulate backend behaviour

For example if kotlin class implements kotlin.collections.Map,
    we provide a superinterface that has abstract 'getEntries' method
    and 'entrySet' method that is considered default.
In reality all those methods are generated in the class itself.

In IDE supporting this case without hacks is not feasible performance-wise
    since kotlin.collection.* may not be an immediate supertype and we need
    to compute all supertypes just to calculate own methods of the class
2017-05-16 22:01:03 +03:00
Pavel V. Talanov c56f74cc81 Do not generate bridge and stub methods in light class mode 2017-05-16 22:01:02 +03:00
Pavel V. Talanov 4bdfb8c646 Jvm backend: specify declaration origin of generated methods
Allow to distinguish collection stub methods and augmented kotlin api methods
2017-05-16 22:01:01 +03:00
Pavel V. Talanov eb3c20d630 Refactor constructing KOTLIN_MARKER_INTERFACES map 2017-05-16 22:01:00 +03:00
Pavel V. Talanov 1a04960ff0 J2K class map: expose classes having mutable/readonly kotlin equivalents
Refactor JavaToKotlinClassMap a little bit
2017-05-16 22:00:59 +03:00
Pavel V. Talanov 40561dabed J2K JavaToKotlinClassMap 2017-05-16 22:00:58 +03:00
Pavel V. Talanov 6701eb70fb Light classes, minor: introduce cannotModify() utility 2017-05-16 22:00:57 +03:00
Mikhail Glukhikh 51af18608f AbstractLocalInspectionTest: add LANGUAGE_VERSION support
Related to KT-17164
2017-05-16 20:44:12 +03:00
Mikhail Glukhikh 9990550429 Introduce inspection "replace arrayOf with literal" #KT-17164 Fixed 2017-05-16 20:44:11 +03:00
Zalim Bashorov fb9d88315a Don't print unnecessary empty line separators when generate tests 2017-05-16 19:42:47 +03:00
Gaetan Zoritchak c00918c9f8 KT-17853: Kotlin.js switched parameters of Math.atan2
https://youtrack.jetbrains.com/issue/KT-17853
The current exposition of the JavaScript [Math object] switched the parameters names. 
The correct version is `atan2(y,x)`.
2017-05-16 17:41:43 +02:00
Sergey Igushkin 74288ff8ae Fix main and test compilation tasks having different module name in
free compiler args.
2017-05-16 17:35:45 +03:00
Dmitry Petrov 899ad7bb53 Generate for-in-indices as a precondition loop
Precondition loops are better optimized by HotSpot
(and, quite likely, by ART).
Also, we generate more compact bytecode that way.

KT-17903 Generate 'for-in-indices' as a precondition loop
2017-05-16 17:28:43 +03:00