Commit Graph

55723 Commits

Author SHA1 Message Date
Toshiaki Kameyama 2efbc6e914 Explicit this inspection: fix false positive with subclass and extension
#KT-27550 Fixed
2019-06-24 09:34:08 +03:00
Jeffrey van Gogh 1dbe487077 Reduce compiler runtime overhead of MaxStackFrameSizeAndLocalsCalculator
Profiling the compilation of kotlinx.serialization, MaxStackFrameSizeAndLocalsCalculator
causes ~7% of the runtime to be spent in java.lang.Object.hashCode

This is through two uses:
- visitMaxs(..) has a pushed hashSet that causes ~2%
- labelWrappersMap used to attach additional data to asm Labels, causes ~ 5%

visitMaxs can use the existing SmartSet (not to be confused with SmartHashSet)

Analysis of the visitMaxs HashSet creation & sizes:

| What               | Amount |
| calls to visitMaxs | 4416   |
| max pushed	     | 158    |
| median pushed	     | 4      |
| average pushed     | 5.20   |
| stddev pushed	     | 7.66   |
| 90 percentile      | 10     |

Analysis of labelWrappersMap creation & sizes:

| What               | Amount |
| ------------------ | ------ |
| hashtables created | 4006   |
| max entries        | 175    |
| median entries     | 5      |
| average entries    | 6.10   |
| stdev entries      | 8.28   |
| 90 percentile      | 11     |

testing with a non hash based map using an array for keys and an array for values
showed that the cost of MaxStackFrameSizeAndLocalsCalculator became neglible to
the overall running time.

SmartIdentityTable is a Map like structure that uses reference identity for keys.
It uses 2 arrays to store keys & values until the number of entries stored is larger than 10.
At that point it switches to using an IdentityHashMap.

This structure can be used instead of HashMap when reference identity can be used and
the number of entries inserted is small (<= 10) on average, drastically reducing the overhead
of calls to Object.hashCode

Between the two changes, compilation of kotlinx.serialization through kotlinc
commandline decreased from 14 seconds to 11 seconds on my machine
2019-06-21 18:51:22 +02:00
Svyatoslav Kuzmich 0b19a4a32b [JS IR BE] Initial version of member namer 2019-06-21 17:02:01 +03:00
Svyatoslav Kuzmich 3e10de9cd1 [JS IR BE] Fixup property accessors 2019-06-21 17:02:01 +03:00
Svyatoslav Kuzmich 84d48b8c7b [IR BE] Don't override private declarations 2019-06-21 17:02:01 +03:00
Svyatoslav Kuzmich 7796d084e1 [JS IR BE] Generate fileds for all properties 2019-06-21 17:02:01 +03:00
Svyatoslav Kuzmich 14ec30dd5a [JS IR BE] Lower property accessors in PrimitiveCompanionLowering 2019-06-21 17:02:01 +03:00
Svyatoslav Kuzmich 19b0bb8d0f [JS IR BE] Minor codegen refactoring 2019-06-21 17:02:01 +03:00
Dmitry Petrov 79d4b46d2b KT-32044 Fix unsigned integer coercion in loop intrinsics 2019-06-21 16:30:23 +03:00
Dmitry Petrov 0b580b2741 Refactor: SimpleBoundedValue, AbstractBoundedValue -> BoundedValue class 2019-06-21 16:30:22 +03:00
victor.petukhov bfeb9537ee Exclude functional types for the warning reporting about implicitly inferred a type parameter to Nothing 2019-06-21 15:52:01 +03:00
Dmitry Gridin 66795db042 PackageDirectoryMismatchInspection: fix visibility in editor
#KT-31816 Fixed
2019-06-21 18:40:31 +07:00
Dmitry Gridin 59325900df KotlinInvalidBundleOrPropertyInspection: fix false positive for a bundle with several properties files
#KT-31359 Fixed
2019-06-21 18:40:31 +07:00
Dmitry Gridin d9808b70b6 LeakingThisInspection: fix false positives for enum class
#KT-25905 Fixed
2019-06-21 18:40:31 +07:00
Vladimir Dolzhenko efd004c997 Add j2k, nj2k performance tests 2019-06-21 13:04:08 +02:00
Mikhail Zarechenskiy fe0282809e [NI] Skip fake call for descriptor from object in builder-inference
This call have interesting rules for resolution, see
 `KtQualifiedExpression.elementChain` function and it's usages:
 resolution results for such call can be omitted and be replaced with
 some other information, while diagnostics will be reported from
 builder-inference.

 To mitigate this problem, we'll just skip this call from builder-inference
 as such calls can't have type parameters anyway

 #KT-32094 Fixed
2019-06-21 11:56:09 +03:00
Mikhail Zarechenskiy bebdf6fcef [NI] Added test for KT-32094 2019-06-21 11:52:44 +03:00
Mikhail Zarechenskiy f3e4c9cdb3 [NI] Don't avoid Nothing-like constraints if Nothing was in initial type
#KT-32081 Fixed
 #KT-32951 Fixed
2019-06-21 11:52:39 +03:00
Mikhail Glukhikh 4b2175c8f8 FIR: do not resolve constructors / initializers in implicit type mode 2019-06-20 23:43:04 +03:00
Georgy Bronnikov 48b0cac92e Update tests 2019-06-20 22:37:56 +03:00
pyos 8cca74c932 JVM_IR: support vararg & defaults in function references 2019-06-20 22:37:56 +03:00
pyos b45e8c7021 JVM_IR: make CallableReferenceLowering a bit shorter 2019-06-20 22:37:56 +03:00
Denis Zharkov 6d63214d1b Optimize AbstractTypeChecker::collectAllSupertypesWithGivenTypeConstructor
Add fast path for a case when subType is a class and super is not
Classes may only have classes supertypes
2019-06-20 15:42:42 +03:00
Denis Zharkov 7a31a14002 Clarify parameter names in AbstractTypeChecker 2019-06-20 15:42:42 +03:00
Denis Zharkov 1a2ccb50c6 Minor. Drop unused functions 2019-06-20 15:42:42 +03:00
Denis Zharkov bf0781d790 FIR: Implement fast path for classes subtyping 2019-06-20 15:42:42 +03:00
Mikhail Glukhikh cafe92639b [FIR] Output total time & set passes in old FE performance test 2019-06-20 15:26:40 +03:00
Mikhail Glukhikh c8003518a5 FIR: set super type reference properly 2019-06-20 15:26:40 +03:00
Mikhail Glukhikh 65d14ff097 FIR: do not try to calculate annotation call type
Annotation type is used instead
2019-06-20 15:26:40 +03:00
Mikhail Glukhikh ca401cb01d FIR2IR: support backing field symbols from FIR, fix test data 2019-06-20 15:26:40 +03:00
Mikhail Glukhikh 54078c4e9c FIR resolve: support inferring property type from getter 2019-06-20 15:26:39 +03:00
Mikhail Glukhikh 16ead49967 FIR: implement backing field references via 'field' synthetic variable 2019-06-20 15:26:39 +03:00
Mikhail Glukhikh 11620d848b FIR resolve: set property accessor return type to initializer type 2019-06-20 15:26:39 +03:00
Mikhail Glukhikh 7e2828c276 FIR: provide error type for property/variable without initializer 2019-06-20 15:26:39 +03:00
Ilya Matveev 65b7da9d0a Gradle: Add a shortcut DSL method for linuxArm64 target
Issue #KT-32034 Fixed
2019-06-20 18:05:25 +07:00
Roman Artemev 88e92be091 [IR] Fix name clash between properties with the same fqn
Promote ABI version
2019-06-20 12:08:55 +03:00
Simon Ogorodnik 2995e9fcac FIR deserializer optimization: avoid calling findKotlinClass twice
This commit influences enum entries deserialization.
In particular, now we don't deserialize enum entry members,
but deserialize its supertype correctly (see test data changes).
2019-06-19 23:04:41 +03:00
Mikhail Glukhikh b3c21d6e14 Optimize FirClassSymbol.hashCode() 2019-06-19 22:54:14 +03:00
Mikhail Glukhikh f4fefa042d Optimization: directly call transformChildren on FirExpression
This is done instead of calling super transformer function,
which does the same after several redirections to other functions.
2019-06-19 22:53:24 +03:00
Mikhail Glukhikh 688c2cf74f Optimization: make FIR expression an abstract class
NB: this commit does significant fir:tree refactoring.
It provides some boost due to faster abstract class dispatching in JVM.
2019-06-19 22:52:44 +03:00
Mikhail Glukhikh dab6fe29b1 Optimization: make property 'FirExpression.resultType' inline 2019-06-19 22:52:20 +03:00
Mikhail Glukhikh f6f879302f Optimization: make FirFunctionCall an abstract class 2019-06-19 22:52:13 +03:00
Mikhail Glukhikh d85ad650d5 Optimization: make FirWrappedArgumentExpression an abstract class 2019-06-19 22:52:04 +03:00
Mikhail Glukhikh b71de954ff Forbid manipulations with FirWrappedArgumentExpression type reference
The type of this expression is bound to the type of wrapped expression,
so it's better not to change it directly.
2019-06-19 22:51:26 +03:00
Mikhail Glukhikh b7da2f2ad8 FIR resolve: check early receivers on kotlin.* only
To provide more stable behaviour, the check introduced in the previous
commit is now applied only to extensions from kotlin.* package.
2019-06-19 22:48:52 +03:00
Mikhail Glukhikh 374b59dee3 FIR resolve: add early explicit receiver type check
Before this commit, explicit extension receiver type check was performed
during found candidates analysis (together with arguments type check etc.)
Now we do it just after candidate is found, and filter the candidate
out if explicit receiver type is inappropriate.

This commit slightly changes resolve semantics,
replacing WRONG_RECEIVER with UNRESOLVED_REFERENCE in certain situations.
However, it provides significant performance boost.
2019-06-19 22:45:15 +03:00
Mikhail Glukhikh d820b6ca52 More accurate messages about types in FirResolveBench 2019-06-19 22:45:14 +03:00
Dmitry Gridin 22a73bc09d ChangeFunctionSignatureFix: fix wrong result
#KT-32001 Fixed
2019-06-19 18:52:53 +07:00
Pavel Punegov 85210d5db0 Update zipTestData: use zip64, add coroutineTestUtil and remove stdlib tests 2019-06-19 14:43:36 +03:00
Natalia Selezneva b2109a2e65 Get rid of bunch file in AbstractScratchRunActionTest 2019-06-19 13:39:32 +03:00