Ivan Kylchik
96a2da4906
[JVM] Split mergeControlFlowEdge into full and fast versions
...
This is needed because for `FastStackAnalyzer` we actually
will use only `fast` version, that can potentially improve overall
performance.
2023-10-12 13:04:43 +00:00
Ivan Kylchik
07c7792693
[JVM] Drop toArray call where iterator can be used
2023-10-12 13:04:43 +00:00
Ivan Kylchik
2387fe302c
[JVM] Use reference comparison for objects defined in StrictBasicValue
2023-10-12 13:04:43 +00:00
Ivan Kylchik
c1c04376cf
[JVM] Replace open functions in FastAnalyzer with constructor args
2023-10-12 13:04:43 +00:00
Ivan Kylchik
99655cfa15
[JVM] Make newFrame constructor's parameter for FastAnalyzer
2023-10-12 13:04:43 +00:00
Ivan Kylchik
cfe38470af
[JVM] Use composition instead of inheritance in FixStackAnalyzer
...
This way we will be able to pass `createFrame` argument
directly to `FastAnalyzer`.
2023-10-12 13:04:43 +00:00
Ivan Kylchik
2327800a95
[JVM] Make BoxingInterpreter an abstract class instead of open
...
This way, it is a little bit easier to fit the semantics of this
class in the head.
2023-10-12 13:04:43 +00:00
Ivan Kylchik
38dd75c6c8
[JVM] Drop boxingInterpreter constructor parameter from BoxingFrame
2023-10-12 13:04:43 +00:00
Ivan Kylchik
6d57cbe23c
[JVM] Reorganize positions of methods in FastAnalyzer
2023-10-12 13:04:43 +00:00
Ivan Kylchik
895afc736d
[JVM] Drop I : Interpreter<V> type parameter from FastAnalyzer
2023-10-12 13:04:43 +00:00
Ivan Kylchik
87c46db3d5
[JVM] Drop getFrame and setFrame methods from FastAnalyzer
2023-10-12 13:04:43 +00:00
Ivan Kylchik
f7f253d2bf
[JVM] Move isTcbStart computation in FastAnalyzer
2023-10-12 13:04:43 +00:00
Ivan Kylchik
53d9b3c54f
[JVM] Combine all mergeControlFlowEdge methods
...
This is just a refactoring commit. All fast analyzers are doing the
same thing in `mergeControlFlowEdge`, so we extract it in common
`FastAnalyzer`. The only exception is `FastStackAnalyzer`.
There was no `isMergeNode` check, but this is an optimization
that allows us to reuse a frame and not copy it.
2023-10-12 13:04:42 +00:00
Ivan Kylchik
68e4a7a318
[JVM] Combine all analyzeInstruction methods
2023-10-12 13:04:42 +00:00
Ivan Kylchik
58473b94a7
[JVM] Reuse visitNopInsn method in all Fast...Analyzer classes
2023-10-12 13:04:42 +00:00
Ivan Kylchik
ed95ebc585
[JVM] Move visit...Insn methods in FastAnalyzer
...
They are actually the same.
2023-10-12 13:04:42 +00:00
Ivan Kylchik
7845e6bb0a
[JVM] Drop visitControlFlowExceptionEdge method from FastStackAnalyzer
...
There is no class that overrides this method.
Also replaced `newValue` call with `newExceptionValue`. Under the hood,
`newExceptionValue` still calls `newValue` if the interpreter doesn't
redefine it. And it kind of makes sense to call `newExceptionValue`
here because we are handling try-catch block.
2023-10-12 13:04:42 +00:00
Ivan Kylchik
e9019e9fb3
[JVM] Drop StoreLoadInterpreter class
2023-10-12 13:04:42 +00:00
Ivan Kylchik
364faa9506
[JVM] Drop StoreLoadValue interface
2023-10-12 13:04:42 +00:00
Ilya Kirillov
f11cb277cd
Remove obsolete @OptIn(ExperimentalStdlibApi::class) annotations
...
They were added when `buildList`, `buildMap` and `buildSet` were experimental.
^KT-62510
2023-10-12 10:41:00 +00:00
Alexander Udalov
9943c7078c
JVM: add more flags to JvmBackendConfig
...
And use them instead of CompilerConfiguration, to reduce dependencies of
backend on the whole compiler (as opposed to just backend)
configuration.
2023-10-02 14:58:24 +00:00
Alexander Udalov
72b5123fc8
JVM: reduce usages of GenerationState in favor of JvmBackendConfig
...
To help in decoupling JVM IR from the old JVM backend.
2023-10-02 14:58:23 +00:00
Dmitriy Novozhilov
9e5ee3afa0
[FE] Add isLocal name to ClassId constructor calls where it needed
2023-09-21 12:40:44 +00:00
Nikolay Lunyak
ec9cb8beb6
[FIR] Rename JvmNames -> JvmStandardClassIds
...
This is more consistent with the code of
the common compiler checkers.
It would be nice to refactor the contents
of this object further, but it's out
of scope of the current branch.
^KT-54596
2023-09-19 22:14:09 +00:00
Nikolay Lunyak
986f1624ec
[FIR] Remove jvm-specific annotations from common compiler code
...
^KT-54596 Fixed
2023-09-19 22:14:09 +00:00
Ilmir Usmanov
f16ea9dfbb
JVM: Reduce number of comparison on bytecode analysis merge
...
operations. Since these methods are hot - they are call on each branch,
even such primitive optimizations should give measurable speedup.
2023-09-14 15:35:51 +00:00
Ilmir Usmanov
5e2d3737f5
JVM: Do not traverse all suspension point when looking for end label
...
when extending local variable range.
2023-09-14 15:35:51 +00:00
Ivan Kylchik
95872bd13c
[JVM] Reuse findMergeNodes in FastStoreLoadAnalyzer
2023-09-14 15:02:03 +00:00
Ivan Kylchik
617e7d1a36
[JVM] Store VarInsnNode in StoreData instead of AbstractInsnNode
...
This way we can avoid some casts.
2023-09-14 15:02:03 +00:00
Ivan Kylchik
140ccccae3
[Minor] Drop unused method from CompositeMethodTransformer
2023-09-14 15:02:03 +00:00
Ivan Kylchik
f9868f757b
[JVM] Simplify StoreLoadInterpreter and StoreLoadFrame
2023-09-14 15:02:03 +00:00
Ivan Kylchik
0e9d884b0b
[JVM] Slightly rewrite mergeControlFlowEdge in FastStackAnalyzer
...
This change is supposed to show how similar
`mergeControlFlowEdge` methods are, and maybe
we should combine them.
2023-09-14 15:02:03 +00:00
Ivan Kylchik
6f8e243f0b
[JVM] Avoid inheritance from FastMethodAnalyzer
...
This way it is easier to analyze code.
2023-09-14 15:02:03 +00:00
Ivan Kylchik
5f27e1a6b2
[JVM] Make FixStackAnalyzer inherit FastStackAnalyzer
2023-09-14 15:02:02 +00:00
Ivan Kylchik
f49f6656b9
[JVM] Move private extension methods into FixStackFrame
2023-09-14 15:02:02 +00:00
Ivan Kylchik
2c4c3a73b8
[JVM] Move initLocals method into FastAnalyzer
2023-09-14 15:02:02 +00:00
Ivan Kylchik
83c75c1edf
[JVM] Unify initLocals method in Fast...Analyzer classes
2023-09-14 15:02:02 +00:00
Ivan Kylchik
02d8a62cb0
[JVM] Fully move analyze method into FastAnalyzer
2023-09-14 15:02:02 +00:00
Ivan Kylchik
abe727fdd7
[JVM] Extract common code from Fast...Analyzer into analyzeInner
2023-09-14 15:02:02 +00:00
Ivan Kylchik
e0dd3a33c0
[JVM] Extract unique code in Fast...Analyzer into analyzeInstruction
2023-09-14 15:02:02 +00:00
Ivan Kylchik
bf53268453
[JVM] Move computeExceptionHandlers into base FastAnalyzer
2023-09-14 15:02:02 +00:00
Ivan Kylchik
98cc2c839f
[JVM] Create base FastAnalyzer class for all Fast...Analyzer
2023-09-14 15:02:02 +00:00
Ivan Kylchik
7853256c02
[JVM] Drop some excess toArray calls on instructions
2023-09-14 15:02:02 +00:00
Ivan Kylchik
d8e682ab30
[JVM] Drop insnsArray from Fast...Analyzer classes
...
We are using useless `toArray` can that we can avoid.
2023-09-14 15:02:02 +00:00
Ivan Kylchik
5cd96831dc
[Native] Move isRestrictedSuspendFunction from IrUtils2
...
This function is also helpful for JVM backend.
2023-09-05 11:21:50 +00:00
Iaroslav Postovalov
059046a2b1
[JVM] Micro-optimize method signature mapping
...
This commit optimizes functions related to method signature mapping on
the JVM backend. The most significant change is avoiding re-allocations
in StringBuilder when building internal names. The commit also includes
minor optimizations, such as removing redundant allocations of strings
and other objects.
2023-09-01 20:26:17 +00:00
Alexander Udalov
dc2deea04c
JVM: remove unnecessary check in StrictBasicValue.equals
...
Types are already checked for equality several lines below.
2023-08-30 15:35:43 +00:00
Alexander Udalov
12bbdebed2
JVM IR: support value classes only when feature is enabled
...
Remove NeedsToVisit because it doesn't really help with performance, and
it significantly increases code complexity.
2023-08-30 15:35:43 +00:00
strangepleasures
ece40ca775
Lazy evaluation of an error prefix in MethodInliner (performance optimization)
2023-08-30 09:51:54 +00:00
Vladislav Grechko
f11c96cba2
Use handwritten tokenizer for SMAP parsing
...
SMAP parsing is a hot spot. Handwritten tokenization significantly boosts the performance.
See ^KT-61527
2023-08-29 21:28:50 +00:00