Commit Graph

13 Commits

Author SHA1 Message Date
Alexander Udalov 987e8c25dc K2: do not generate line numbers for delegated members
Psi2ir does not generate them, see
https://github.com/JetBrains/kotlin/blob/1.8.20/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/ClassGenerator.kt#L319.

Besides influencing debugger and coverage behavior, it also affects how
conflicting JVM signature diagnostics are reported because they
use offsets to determine which element to report the error on. So after
this change, K1 and K2 behavior is the same in that regard as well.

 #KT-58215 Fixed
2023-05-10 10:32:07 +00:00
Alexander Udalov c53d91bae1 JVM IR: adjust generation of linenumber for try-finally
Do not generate linenumber for the start of the finally block, because
that is usually where the only word 'finally' is located. Instead,
generate linenumber for the first expression inside the finally block.

Not generating this linenumber fixes an issue in code coverage tools
which would consider such finally uncovered. Although this might be
technically considered as designed, it makes more sense to NOT detect it
as uncovered because semantics of the finally block shouldn't really
differ whether it's executed normally or because an exception happened.
It's also beneficial for the tool support to behave like javac, which
doesn't generate the linenumber either.

 #KT-50973 Fixed
2022-02-24 16:33:40 +01:00
Mikhail Glukhikh ac50433e17 Fix failing bytecode text test
In this commit I moved IGNORE_BACKEND_FIR to the end or deleted it
when it was applicable, to preserve correct line numbers
2020-09-29 19:16:42 +03:00
Mark Punzalan 238cc7c257 [FIR] Enable BytecodeText tests for FIR.
143 out of 767 tests (18.6%) are currently failing.
2020-09-29 10:21:21 +03:00
Alexander Udalov 84df996204 JVM IR: fix "step over" for inline function calls in conditions
Reimplement the same hacky approach used in the old backend (see
cc2fe6b0c6).

Previously, the debugger incorrectly stepped into Collections.kt on
"step over" inline function calls from stdlib like 'any'.

Since `if` and `when` expressions are represented the same way in IR,
the behavior is fixed for both of them. It's not the case in the old JVM
backend, where stepping over `when` conditions still suffers from the
same problem, which the newly added test checks.
2020-09-23 15:54:15 +02:00
pyos 25e1fb8502 JVM: map synthetic line numbers through the SMAP
This is necessary so that IDEA does not ignore the line number.
2020-05-25 20:03:56 +02:00
pyos c51c537504 JVM: use precise line bounds when regenerating objects with no SMAPs 2020-05-19 18:33:27 +02:00
pyos deecb6a28e JVM: move synthetic line number generation to the inliner
This makes the behavior of JVM and JVM_IR the same without having to
deal with PSI nodes.
2020-04-28 17:21:07 +02:00
Yan Zhulanow cc2fe6b0c6 Debugger, BE: Generate original line number after inlining if call is used in an if condition
If a part of an 'if' condition is an inline function call, we need to insert the original condition line after it. Otherwise, the debugger will think it is inside the inline function implementation. Obviously, this breaks stepping – instead of the 'if' body, we go on stepping through the inline function.

This commit fixes 'KotlinSteppingTestGenerated.StepOver#testSoInlineLibFun' test.
2020-02-14 17:35:17 +09:00
Ting-Yuan Huang 013ad4b8e4 JVM_IR: defer some branch optimizations to codegen.
Specifically, defer the removal of hand-written "if (true|false)" from
JvmBuiltinOptimizationLowering into codegen so that appropriate debug
info (and a NOP) can be inserted.

Change-Id: Ia11af05ad8b4251946bd3e685fb7c3319f0f433f
2019-03-13 08:48:20 +01:00
Mads Ager 52464fd103 JVM_IR: do not generate line number info for temporary loads.
Loads from compiler-introduces temporary variables to do not
correspond to loads in user code.
2019-01-29 14:25:17 +01:00
Mads Ager 48bd99730d Suppress final failure which relies on line numbers. 2018-12-21 16:20:45 +01:00
Michael Bogdanov 8a9977de72 Fix for KT-6202: Redundant and wrong linenumber after if/else condition
#KT-6202 Fixed
2014-11-05 18:25:36 +03:00