Commit Graph

45393 Commits

Author SHA1 Message Date
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
strangepleasures cf01d2970f [SLC] [KAPT] KT-61916 Fix generation of annotations in annotation arguments 2023-09-14 13:21:07 +00:00
Artem Kobzar 878452bd2b [K/JS] Implement file merging for clashed file during per-file compilation 2023-09-14 13:14:15 +00:00
Kirill Rakhman 0d628c9e59 [FIR] Inline FirExpression.coneTypeSafe und use resolvedType
The call-sites don't actually need to handle unresolved expressions,
they only need safe-casts to ConeClassLikeType or
ConeIntegerLiteralType.

#KT-61367
2023-09-14 10:03:03 +00:00
Kirill Rakhman a4fff7c7c0 [FIR] Inline FirExpression.coneTypeUnsafe
#KT-61367
2023-09-14 10:03:03 +00:00
Kirill Rakhman 126f2c9440 [FIR] Skip published visibility computation for local functions
This fixes an exception caused by annotations being unresolved during
 status computation.

#KT-61367
2023-09-14 10:03:02 +00:00
Kirill Rakhman f0112040fc [FIR AA] Unmute passing test 2023-09-14 10:03:02 +00:00
Kirill Rakhman 6d8091f0ff [FIR] Add workaround for unresolved array literal type #KT-61843
#KT-61367
2023-09-14 10:03:02 +00:00
Kirill Rakhman 462687ed66 [FIR] Don't resolve call in annotation arguments phase if receiver type isn't resolved
This prevents exceptions from being thrown during resolution of red code
because FirExpression.resolvedType is called but during annotation
arguments phase we don't have return types for implicitly typed
declarations.

#KT-61367
2023-09-14 10:03:02 +00:00
Kirill Rakhman 66b911c923 [FIR] Migrate compiler.fir to use resolvedType where applicable
#KT-61367
2023-09-14 10:03:02 +00:00
Kirill Rakhman 1c6776b2b4 [FIR] Introduce extension FirExpression.isResolved that requires no opt-in
#KT-61367
2023-09-14 10:03:02 +00:00
Kirill Rakhman b9b99366e7 [FIR] Use resolvedType instead of coneTypeOrNull in java.deserialization
#KT-61367
2023-09-14 10:03:02 +00:00
Kirill Rakhman b1565d547c [FIR] Use resolvedType instead of coneTypeOrNull in FIR2IR
#KT-61367
2023-09-14 10:03:02 +00:00
Kirill Rakhman c3abe28049 [FIR] Use resolvedType instead of coneTypeOrNull in checkers
#KT-61367
2023-09-14 10:03:02 +00:00
Kirill Rakhman e8731f3f31 [FIR] Use resolvedType instead of coneTypeOrNull in tests
#KT-61367
2023-09-14 10:03:02 +00:00
Kirill Rakhman 5d6affc38d [FIR] Update FIR utilities
#KT-61367
2023-09-14 10:03:02 +00:00
Kirill Rakhman a49fdeb05b [FIR] Update manual implementations of FirExpression
#KT-61367
2023-09-14 10:03:02 +00:00
Kirill Rakhman 68bc2be4c9 [FIR] Regenerate FIR types
#KT-61367
2023-09-14 10:03:02 +00:00
Kirill Rakhman 6ec419edb7 [FIR] Update FIR schema to add opt-in to FirExpression.coneTypeOrNull
#KT-61367
2023-09-14 10:03:01 +00:00
Dmitriy Dolovov b3cb8870e0 [IR][JS] Always drop expect declarations prior IR serialization
^KT-61136
2023-09-14 09:13:39 +00:00
Ivan Kylchik ede6eb0b34 [IR] Print exception's class in error message from interpreter 2023-09-14 08:47:06 +00:00
Ivan Kylchik 2df5b48474 [IR] Report error from IR interpreter on field recursive initialization
#KT-59890
#KT-61802 Fixed
2023-09-14 08:47:06 +00:00
Dmitriy Dolovov 98b3bdb175 [K1] Rename analysis flag expectActualLinker
Rename analysis flag `expectActualLinker` to `skipExpectedActualDeclarationChecker`
to better reflect its semantics. This flag isn't used on IDE plugin side, so no
additional changes in `intellij` repo are needed.

^KT-61136
2023-09-14 07:32:18 +00:00
Dmitrii Gridin 31b36ee766 [LL FIR] introduce lazyResolveRecursively API
FirFile after KT-56683 has its own phases and resolution logic,
so we should have a separate API for lazy resolution for FirFile and for
the entire file

^KT-61296 Fixed
2023-09-13 20:26:50 +00:00
Timofey Solonin 53584cdd49 Don't emit CAST_NEVER_SUCCEEDS when casting to a forward declaration type
^KT-58929
2023-09-13 17:49:12 +00:00
Timofey Solonin 28f90b3ea8 Add CAST_NEVER_SUCCEEDS diagnostic to forwardDeclarations.kt
Add safe as casts to forwardDeclarations.kt

^KT-58929
2023-09-13 17:49:12 +00:00
Sergej Jaskiewicz 14e23a7d84 [K/N] Cache FqNames computed from ClassIds in KonanMangler 2023-09-13 14:25:13 +00:00
Sergej Jaskiewicz 9eba17d631 [K/N] Move Native-specific mangle constants to more suitable places
They shouldn't be mixed with target-independent constants.
2023-09-13 14:25:12 +00:00
Sergej Jaskiewicz 08a9e7eae9 [IR] Outline the main logic in annotation-related helpers
Prefer smaller inline functions, because otherwise if they become
hot spots, they will complicate performance analysis, and actually
might make everything slower because of low inlining threshold in
HotSpot.
2023-09-13 14:25:11 +00:00
Sergej Jaskiewicz 157ab48fde [K/N] Delete unused methods in ObjCInterop.kt 2023-09-13 14:25:11 +00:00
Sergej Jaskiewicz e3b5dc509c [K/N] De-duplicate code for mangling objc interop function names
Extract the duplicated functionality to the
`ObjCFunctionNameMangleComputer` class.
2023-09-13 14:25:11 +00:00
Sergej Jaskiewicz 0fd4f10f6c [K/N] Avoid magic strings in KonanMangler 2023-09-13 14:25:10 +00:00