Tianyu Geng
684ef871ee
FIR: unify common special names scattered around the code base
2021-08-06 22:57:17 +03:00
Dmitry Petrov
bd71fbe982
JVM_IR KT-34594 strip fake variable initialization during inlining
2021-08-03 20:41:31 +03:00
Ilmir Usmanov
cbe0de6111
Extend local variable ranges
...
when it is safe. Otherwise, they will not be visible in
debugger as soon as they become dead.
#KT-47749 Fixed
2021-08-03 08:00:51 +00:00
Dmitriy Novozhilov
199ec60742
[JVM] Reduce number of param slots for string concatenation
...
With paramSlot = 200 those tests fails on JDKs which are newer than JDK 9
- testConcatDynamic200Long
- testConcatDynamicIndy200Long()
2021-08-01 22:23:48 +03:00
Dmitry Petrov
ebf837c135
JVM_IR disable IR and bytecode validation by default
2021-07-30 20:21:41 +03:00
Mikhael Bogdanov
a919aab3ab
Update metadata related logic after switch to 1.6
2021-07-29 19:45:53 +02:00
Dmitry Petrov
ce79fc77c9
JVM minor cleanup in bytecode analyzers
2021-07-28 19:53:39 +03:00
Dmitry Petrov
4267852030
JVM cleanup bytecode analyzers
2021-07-28 08:04:55 +03:00
Mads Ager
c0f5d09759
Copy locals in addition to instructions when inlining finally blocks
...
^KT-46448 Fixed
2021-07-23 09:11:48 +02:00
Dmitry Petrov
6c734289be
JVM skip methods without NEW insns in UninitializedStoresProcessor
2021-07-22 21:29:41 +03:00
Dmitry Petrov
eff7c375ce
Minor HackedFixStackMethodAnalyzerBase -> FastStackAnalyzer
2021-07-22 21:29:41 +03:00
Dmitry Petrov
aef9701661
JVM use new stack state analyzer in non-local returns preprocessing
2021-07-22 21:29:40 +03:00
Dmitry Petrov
cf2b4dd277
JVM don't use SPBs in FixStack method analyzer (we don't merge)
2021-07-22 21:29:40 +03:00
Dmitry Petrov
ca84aa4f2c
JVM don't optimize if there are too many data on exception edges
2021-07-22 21:29:39 +03:00
Dmitry Petrov
c1a5ce6e61
JVM skip redundant boxing optimization in methods without boxing
2021-07-22 21:29:38 +03:00
Alexander Udalov
9ebd665c96
Report error on annotated type inside typeOf on JVM
...
Since it's not feasible to support annotated types in 1.6, we're making
this an explicit error in 1.6, so that typeOf can become stable and this
feature can be supported in the future without breaking changes to the
existing code.
Note that extension function types are a special case of annotated
types. A separate error is created for them just because the message
"annotated types are not supported" would be confusing, since such types
don't have explicit annotations in the source code.
#KT-29919
2021-07-22 15:54:48 +02:00
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