Dmitry Petrov
46d2e52543
JVM Minor: move uninitialized value check to stack recovery
2021-07-20 19:51:04 +03:00
Dmitry Petrov
e72d24960d
JVM we don't merge frames in stack normalization
2021-07-20 19:51:03 +03:00
Dmitry Petrov
91afa3335c
JVM represent uninitialized values explicitly in stack normalization
2021-07-20 19:51:02 +03:00
Dmitry Petrov
35b4a9d4cc
JVM treat all variable loads as "initialized" in stack normalization
2021-07-20 19:51:00 +03:00
Dmitry Petrov
c8b705fd2d
JVM update license for HackedFixStackMethodAnalyzerBase.kt
2021-07-20 19:50:59 +03:00
Dmitry Petrov
8763235053
JVM specially hacked method analyzer for FixStack
2021-07-20 19:50:58 +03:00
Dmitry Petrov
3ecd612ce7
JVM FixStackValue & FixStackInterpreter
2021-07-20 19:50:57 +03:00
Dmitriy Novozhilov
85c7f386eb
Add Kotlin 1.7 language version
2021-07-20 13:33:41 +03:00
Ilmir Usmanov
e870a200c4
Merge consequent LVT records
...
that is, if LVT record starts where previous one ends, merge them.
#KT-47749 Fixed
2021-07-19 22:07:16 +00:00
Ilmir Usmanov
5ae01c8b2a
Do not duplicate $result in LVT
...
#KT-47749
2021-07-19 22:07:16 +00:00
Ilmir Usmanov
b4d356c5bd
Split LVT record for known nulls
...
Since they are not spilled, the logic for splitting LVT records, that
is applied for spilled variables, was not applied for known nulls.
Fix that by applying the logic to them.
#KT-47749
2021-07-19 22:07:15 +00:00
Mads Ager
83dddd73b0
Always add a local variable for its live ranges.
...
There used to be code that extended a previous range instead.
However, that does not work as that extension could have the
local cover code where it does not exists. Since we no longer
extend the range of locals, we should always introduce a new
one even if there was another one for a previous range.
2021-07-19 22:07:14 +00:00
Dmitry Petrov
e276dec4de
JVM don't merge local values in FixStackAnalyzer
...
We care only about stacks there.
This yields about 10-15% in a pathological case such as KT-41510.
2021-07-19 19:24:57 +03:00
Dmitry Petrov
b98322c1b4
JVM don't optimize methods with too many TCBs
2021-07-15 20:18:18 +03:00
Dmitry Petrov
d65d66c03a
JVM reserve 2 slots for node predecessors/successors in CFG
2021-07-15 20:18:15 +03:00
Dmitry Petrov
6c2d93bb8b
JVM traverse nodes in reverse order in 'findSafelyReachableReturns'
2021-07-15 20:18:13 +03:00
Mikhail Glukhikh
113d2653aa
Drop deprecated -Xexperimental flag from compiler and tests
2021-07-14 21:18:23 +03:00
pyos
07cb3a5ff8
JVM: do not reify methods of objects in lambdas
...
All type parameters used in them are not from the inline function
anyway.
2021-07-14 10:11:05 +02:00
pyos
717cf2066a
JVM: remove more redundant properties from LambdaInfo
2021-07-14 10:11:05 +02:00
pyos
c1c56ca388
JVM: refactor extraction of default inline lambdas a bit more
2021-07-14 10:11:05 +02:00
pyos
91cf1a1a4d
JVM: remove a redundant DefaultLambda field
...
and add a comment explaining one branch of the inliner... Better than
nothing, I guess?
2021-07-14 10:11:05 +02:00
pyos
100d2d629c
JVM: inline default lambda coercions from bridge invoke
...
The type of the default lambda may be a subtype of the parameter type,
so we can't really generate our own coercions at all as we don't know
the precise Kotlin type of the `invoke` method.
2021-07-14 10:11:05 +02:00
pyos
d0b9c4ae6b
JVM: generalize getMethodNode
...
to allow matching by arbitrary predicates.
2021-07-14 10:11:05 +02:00
pyos
664bb055c8
JVM_IR: support codegen of property delegate methods
...
The purpose of a property-related method is now determined by its
origin; codegen no longer assumes all methods with Property metadata
source are `getX$annotations`.
2021-07-12 22:38:43 +02:00
Dmitry Petrov
804db3ce91
JVM KT-47613 custom control flow analyzer for CFG builder
2021-07-11 20:16:09 +03:00
Dmitry Petrov
fe71435104
JVM KT-47613 traverse nodes backwards in backward analysis
2021-07-11 20:16:09 +03:00
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