Commit Graph

25035 Commits

Author SHA1 Message Date
Ilmir Usmanov ca421e0aa5 Do not generate empty bodies for suspend functions 2019-06-25 16:30:01 +03:00
Ilmir Usmanov 95a65ba94d Restore order of lowerings 2019-06-25 16:30:01 +03:00
Ilmir Usmanov 60cbf0696d Do not generate tests with experimental coroutines on JVM_IR backend
Enable working tests.
2019-06-25 16:30:01 +03:00
Ilmir Usmanov 0628783308 Move coroutines-related stuff to AddContinuationLowering 2019-06-25 16:30:00 +03:00
Ilmir Usmanov 8306c28117 Generate continuation class for suspend lambdas
generate state-machine for coroutines.
2019-06-25 16:30:00 +03:00
Ilmir Usmanov f369324520 Generate continuation class for named functions
TODO: Generate label and result for suspend lambdas
2019-06-25 16:30:00 +03:00
Ilmir Usmanov 379390c472 Introduce add continuation pass, which transforms each suspend function
and call to have additional continuation parameter.
2019-06-25 16:30:00 +03:00
Alexander Gorshenev 76088cdf00 Bind WrappedVariableDescriptorWithAccessors in IR deserializer 2019-06-25 15:18:04 +03:00
Mikhail Zarechenskiy 48f25385ac [NI] Don't use old common supertype calculator in NI 2019-06-25 14:09:45 +03:00
Mikhail Zarechenskiy 60a0cf1fcc [NI] Fix exception: don't try to compute type depth on null type
#KT-32184 Fixed
2019-06-25 14:09:42 +03:00
Mikhail Zarechenskiy a26cf86af7 [NI] Fix exception: callable reference is used with an unresolved LHS
#KT-32187 Fixed
2019-06-25 14:09:38 +03:00
Mikhail Zarechenskiy bc0773b219 [NI] Capture receiver of invoke-based call
#KT-32133 Fixed
2019-06-25 14:09:34 +03:00
pyos 54d1df3147 JVM_IR: fix unbound function references 2019-06-25 12:29:23 +02:00
Nikolay Krasko 674badc692 Register mock injection language manager in compiler
In 192 it's important to have service registered since
https://github.com/JetBrains/intellij-community/commit/f204718c885034bc2fa4be4b281ff4bbd5fa4ef4

Caused by: java.lang.IllegalArgumentException: Argument for @NotNull parameter 'value' of com/intellij/openapi/util/UserDataHolderBase.putUserDataIfAbsent must not be null
	at com.intellij.openapi.util.UserDataHolderBase.$$$reportNull$$$0(UserDataHolderBase.java)
	at com.intellij.openapi.util.UserDataHolderBase.putUserDataIfAbsent(UserDataHolderBase.java)
	at com.intellij.openapi.util.NotNullLazyKey.getValue(NotNullLazyKey.java:41)
	at com.intellij.lang.injection.InjectedLanguageManager.getInstance(InjectedLanguageManager.java:41)
	at com.intellij.psi.impl.PsiCachedValue.isVeryPhysical(PsiCachedValue.java:74)
	at com.intellij.psi.impl.PsiCachedValue.anyChangeImpliesPsiCounterChange(PsiCachedValue.java:57)

Reproduced with Fir2IrTextTestGenerated
2019-06-25 11:49:00 +03:00
Nikolay Krasko ebcf306ecc Update proguard rules for 192 idea 2019-06-25 11:48:59 +03:00
Nikolay Krasko 5119979571 Fix compile warnings with 192.5118.30 in backward compatible way 2019-06-25 11:48:59 +03:00
Nikolay Krasko beb1bc09d4 Update to 192.5118.30 2019-06-25 11:48:59 +03:00
Nikolay Krasko 96f0f444ad Remove dependency to IconLoader from compiler 2019-06-25 11:48:58 +03:00
Roman Artemev 544443f113 [JS IR BE] Initialize module dependencies in the correct order 2019-06-24 20:14:19 +03:00
Simon Ogorodnik 9d4fbf8cbd FIR: reuse scopeSession in call resolver & implicit typed ref resolution 2019-06-24 18:51:15 +03:00
Simon Ogorodnik bc7c822b74 FIR resolve: stop visiting receiver hierarchy during call completion 2019-06-24 18:51:14 +03:00
Mikhail Glukhikh 046c82ab60 FIR: remove unused utility function 2019-06-24 18:51:13 +03:00
Simon Ogorodnik 0e60af95bf Optimization: make every FIR node extend FirPureAbstractElement 2019-06-24 18:51:12 +03:00
Mikhail Glukhikh d41c50d6cf FIR: support type inference for assignments, fix related lambda inference 2019-06-24 18:51:03 +03:00
Mikhail Glukhikh 48cea4b800 FIR: take expected type into account during inference
NB: this commit provokes some inference problems,
which are fixed by next commit about type inference for assignments
2019-06-24 18:42:52 +03:00
Mikhail Glukhikh 1e1f4d4472 ConeTypeContext: handle "recursive type alias" situation 2019-06-24 18:42:51 +03:00
Mikhail Glukhikh 152abbfb4c ConeTypeContext: handle star projection more correctly
See substitutionSupertypePolicy & testInnerTP in FIR smoke diagnostics
2019-06-24 18:42:29 +03:00
pyos 6a21285aed JVM_IR: do not generate two nullary constructors
when the primary constructor with @JvmOverloads has default values for
all arguments.
2019-06-24 14:58:45 +02:00
Mikhail Glukhikh ac730a693a FIR: don't count implicit built-in type as a kind of implicit type
Before this commit, implicit Unit type for function with body and
without type, implicit Boolean type for conditions etc. were 'implicit'
types and resolved types together.
Sometimes this could lead to hard-to-find issues in FIR resolve, because
'implicit' types are usually handled there as 'necessary to resolve'
which is wrong for such effectively-resolved types.
2019-06-24 10:13:26 +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
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
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 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