Dmitry Petrov
d99d25e51e
JVM use SPBs in fix stack analyzer
2021-07-10 19:25:25 +03:00
Dmitry Petrov
38f45d2969
JVM update licence for InstructionLivenessAnalyzer.kt
2021-07-10 19:25:24 +03:00
Dmitry Petrov
68560c60f3
JVM use FastMethodAnalyzer when possible
2021-07-10 19:25:22 +03:00
Dmitry Petrov
c54e680021
JVM FastMethodAnalyzer: prune some exception edges
2021-07-10 19:25:21 +03:00
Dmitry Petrov
07b89c6b4b
JVM FastMethodAnalyzer
2021-07-10 19:25:20 +03:00
Alexander Udalov
ddfa94e7e9
Support Nothing type in typeOf
...
The proper support will come in KT-15518, but that would be a breaking
change even for stable Kotlin without kotlin-reflect. Before that issue
is fixed, represent Nothing in types with the Void class, and use a flag
in the no-reflect implementation to remember that it's not actually the
Void class itself.
#KT-39166 Fixed
2021-07-09 14:40:05 +02:00
Alexander Udalov
02774fae0c
Report error on non-reified type parameter with recursive bound in typeOf
...
Instead of throwing an exception.
#KT-40173
2021-07-09 14:31:52 +02:00
Alexander Udalov
438ce57183
Report error on typeOf<suspend ...>()
...
Otherwise an invalid type is constructed which causes kotlin-reflect to
crash, and stdlib implementation to render the type incorrectly. The
reason is that suspend functional types are not properly supported in
reflection. Once they are supported, this error can be removed.
#KT-47562
2021-07-09 14:31:52 +02:00
Dmitry Petrov
24fcadb869
JVM don't run CCE on methods without optimizable conditional jumps
2021-07-08 22:11:59 +03:00
pyos
50797dba8d
JVM: do not use crossinline flag when inlining assertions
...
Crossinline lambdas *can* be inlined into objects, but don't *have* to;
the correct place should be determined from the context, not from the
parameter.
2021-07-07 16:48:01 +02:00
pyos
e64cda61d5
JVM_IR: do not generate $assertionsDisabled twice during inlining
2021-07-07 16:48:01 +02:00
Alexander Udalov
0cb905a4b1
Support mutable collection types in typeOf
...
flexibleTypes_1_6.kt is fixed for JVM IR in a subsequent commit.
#KT-35877 Fixed
2021-07-01 19:33:55 +02:00
Alexander Udalov
6e975b3498
Support flexible types internally in typeOf
...
#KT-45066 Fixed
2021-07-01 19:33:55 +02:00
Mikhael Bogdanov
5f62b72c82
Properly process big types
2021-06-26 06:10:16 +02:00
Mikhael Bogdanov
0fd1f549a9
Properly process special symbols during indy-with-constants concatenation
...
#KT-47320 Fixed
2021-06-26 06:10:16 +02:00
Dmitry Petrov
c77884f067
Refactor SAM type handling, replace non-approximated arguments with *
2021-06-22 21:13:56 +03:00
Victor Petukhov
4aeabb6b0f
Use upper bound aware type approximator for intersection types inside sam types in contravariant positions to build proper types in terms of subtyping
2021-06-22 21:13:55 +03:00
pyos
ee4d9a89ea
JVM_IR: read inline fun bytecode to detect unused property references
...
I.e. optimize `$$delegatedProperties` in the same way as the old
backend. This is more reliable than trying to match bytecode.
2021-06-21 16:19:23 +03:00
pyos
aa47191de4
JVM: hide ExpressionCodegen in finally block generation during inlining
2021-06-16 12:13:32 +02:00
pyos
108bd01698
JVM: refine the stack spilling around inline calls
...
Not all suspend functions need it - only those with suspension points.
2021-06-16 12:13:32 +02:00
pyos
b136acb185
JVM: move callSiteFile to InlineCallSiteInfo
2021-06-16 12:13:32 +02:00
pyos
6c1a5e1211
JVM: make inline function argument processing a bit shorter
2021-06-16 12:13:32 +02:00
pyos
392e4fba42
JVM: fix inlining of default lambdas of signature (Result) -> Any
...
They have no `invoke` bridge, and the overridden invoke expectes a boxed
`Result` as an argument.
2021-06-16 12:13:32 +02:00
pyos
a0a14d9e25
JVM: remove descriptors from SourceCompilerForInline
...
Printing the call site source on errors isn't really useful anyway - the
old backend points to a specific PsiElement, and JVM_IR wraps the
exception in FunctionCodegen (and printing the source never worked with
JVM_IR anyway).
2021-06-16 12:13:32 +02:00
pyos
32ad747632
JVM: load default lambda method nodes immediately
...
The ones that are not needed are filtered out before DefaultLambda is
even constructed anyway, and this way we need fewer lateinit vars.
2021-06-16 12:13:32 +02:00
pyos
1e953eaf01
JVM: remove contextKind from SourceCompilerForInline
...
Guess what? It's only useful for the old backend's type mapper!
2021-06-16 12:13:32 +02:00
pyos
1109348b6d
JVM: remove lookupLocation from SourceCompilerForInline
2021-06-16 12:13:32 +02:00
pyos
b6e9f64e18
JVM: remove functionDescriptor from InlineCodegen
2021-06-16 12:13:32 +02:00
pyos
d89e2d9f08
JVM: split inline intrinsics into "needed by JVM_IR" and "not"
...
or, alternatively, "suspend" and "not".
2021-06-16 12:13:32 +02:00
pyos
eb4d831d27
JVM_IR: implement typeOf<T> as a codegen intrinsic
...
rather than a fake inline function.
Also, generate more correct instructions for typeOf. Not sure how that
even worked before - `aconst(Boolean)` isn't even valid.
2021-06-16 12:13:32 +02:00
pyos
7dbf08ae1c
JVM: move loadCompiledInlineFunction out of InlineCodegen
2021-06-16 12:13:32 +02:00
pyos
8307367f90
JVM: don't thread callDefault through the inliner
...
It's only used by the old backend, and should be given to
PsiSourceCompilerForInline by PsiInlineCodegen.
2021-06-16 12:13:32 +02:00
pyos
d4485bc475
JVM: remove unused methodOwner from InlineCodegen
2021-06-11 15:03:13 +02:00
pyos
ed26e97df8
JVM: refactor loading of inline functions from binaries
...
The IR path no longer does any descriptor unwrapping or old-style type
mapping.
2021-06-11 15:03:13 +02:00
pyos
7bcd738bb1
JVM: inline createInlineMethodNode into InlineCodegenForDefaultBody
...
Most of it is unused, since there we know the target function will also
need to be compiled from source.
2021-06-11 15:03:13 +02:00
pyos
4c7eb815fc
JVM: remove some FunctionDescriptors from SourceCompilerForInline
2021-06-11 15:03:13 +02:00
pyos
a24ad233ee
JVM: move PsiSourceCompilerForInline to a separate file
2021-06-11 15:03:13 +02:00
pyos
955b9260d1
JVM: move more old backend code out of InlineCodegen
2021-06-11 15:03:13 +02:00
pyos
043452fb62
JVM: make handling of captured params for default lambdas shorter
2021-06-11 15:03:13 +02:00
pyos
4cae880b44
JVM: remove unused DefaultLambda.parameterOffsetsInDefault
2021-06-11 15:03:13 +02:00
pyos
8a3af851d9
JVM: pregenerate inline lambda bodies as early as possible
...
Which in JVM_IR is immediately in `genValueAndPut`, but for the old
backend needs to be delayed until `genCallInner` for some reason.
2021-06-11 15:03:13 +02:00
pyos
90412ade8a
JVM: remove second parameter of putClosureParametersOnStack
...
Only used by the old backend.
2021-06-11 15:03:13 +02:00
pyos
d4c8a033b1
JVM: remove BaseExpressionCodegen.pushClosureOnStack
...
It's only used by the old backend
2021-06-11 15:03:13 +02:00
pyos
b6c3c9942d
JVM: move activeLambda to PsiInlineCodegen
2021-06-11 15:03:13 +02:00
pyos
7333abf50d
JVM: purge redundant val BaseExpressionCodegen.v
2021-06-11 15:03:13 +02:00
Dmitry Petrov
dbb933e6a6
JVM use instruction liveness analysis instead of DFA in DCE
2021-06-09 17:04:47 +03:00
Dmitry Petrov
7a43c2de79
JVM remove dead code during constant condition elimination
...
This avoids an extra call to 'analyze', which is rather costly.
Update debugger testData: Constant condition
elimination now performs DCE more consistently.
2021-06-03 00:08:27 +03:00
Dmitry Petrov
1fd94d1bc2
JVM Minor: cleanup RedundantNullCheckMethodTransformer
2021-06-03 00:08:25 +03:00
Alexander Udalov
bcf47ddc94
Move optional annotation utilities to module 'resolution'
...
To avoid depending on a heavy module 'frontend' in parts of the compiler
where checking for optional annotations is needed, such as in
'ir.serialization.common'.
2021-06-01 20:28:22 +02:00
Dmitry Petrov
9091ca7b51
JVM_IR KT-46864 handle "unused" LDC instructions properly
2021-05-31 21:12:35 +03:00