Commit Graph

79 Commits

Author SHA1 Message Date
pyos 76c34a07b2 JVM: use 1 as a synthetic line number for @InlineOnly lambdas
The source path already marks it as synthetic.
2020-05-25 20:03:56 +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 d17a18f96d JVM: do not write trivial SMAPs to classes outside inline funs
where trivial == those that map the file to itself.
2020-05-25 20:03:56 +02:00
pyos 86b28b95ca JVM: keep call site markers when inlining lambdas into objects
A follow-up for KT-35006:

    fun f() = foo {
        bar()
    }
    inline fun foo(crossinline x: () -> Unit) = { x() }()
    inline fun bar() = TODO()

does not provide the option to navigate to bar's call site at all.
2020-05-19 18:33:27 +02:00
pyos 5feadd56ef JVM: parse KotlinDebug when regenerating anonymous objects 2020-05-19 18:33:27 +02:00
pyos 1fe7ef6521 JVM: separate the two kinds of source mappers
* a writing source mapper has `mapLineNumber(line, file, class)` that
   inserts a new SMAP entry and returns a fake line number from it;
 * a copying source mapper has `mapLineNumber(line)` that uses an
   existing SMAP to resolve the line number and call the former method
   on a different source mapper;
 * those two types are disjoint.
2020-05-19 18:33:27 +02:00
Mikhail Bogdanov 461c368ee0 Minor. Unmute test 2020-04-16 13:49:48 +02:00
Kristoffer Andersen 7ec4c9990a [JVM] Improve debug step behavior around lambdas.
- Add tests to clarify problematic behavior
- Avoid line numbers on return instructions of lambdas without explicit returns
2020-04-15 14:33:49 +02:00
Mikhail Bogdanov 1772f20d48 Minor. Add smap test for multifile facade 2020-04-08 07:26:55 +02:00
pyos 9334327bbf JVM_IR: unmute two more tests fixed by #3106 2020-04-08 07:04:16 +02:00
pyos b3e124ad66 Add a test where classes call inline functions from each other 2020-04-08 07:04:16 +02:00
Mads Ager 03fb49bb38 [JVM_IR] Improve debugging behavior of inline functions
Specifically, this commit improves the stepping behavior of the IR
backend around functions with defaults.

  - Improved line numbers in the default handler itself for better
    stepping when inlined.

  - Improved source information on default arguments

  - Improved test coverage of stepping behavior in old and IR backends.

Improves the stepping behaviour around inline methods with default
arguments. In particular, we now accurately step through the
evaluation of default arguments, but do _not_ spuriously show the exit
from the $default handler.
2020-04-07 16:52:45 +02:00
pyos e98bdc6f8e JVM: preserve call site markers when inlining lambdas
and default functions into their own stubs.

Fixes #KT-35006
2020-03-31 16:06:57 +02:00
pyos 9d21800d8f JVM: fix SMAP range extension logic
If `mapLineNumber` was called in non-monotonic order, e.g. N then N+2
then N+1, the first two calls created a range that spans [N; N+2] but
the third call did not reuse it.
2020-03-31 16:06:57 +02:00
pyos be37e7135a Add a test for SMAPs with interleaved files 2020-03-25 14:03:32 +01:00
pyos 4558d48481 JVM: add a language feature to omit *E between SMAP strata
Fixes #KT-37704
2020-03-25 10:33:59 +01:00
Jinseong Jeon 2352b1fec5 JVM_IR: use fresh source map when generating lambda body for inline. 2020-03-19 08:28:38 +01:00
Zalim Bashorov 179ec41a6b [JS BEs] Generate tests for whole "codegen/boxInline" 2020-03-12 17:22:33 +03:00
Ilmir Usmanov 22de20e7e5 JVM_IR: Generate PUBLIC constructor for suspend lambda
if the lambda is inside inline function.
2020-03-02 14:03:35 +01:00
Ilmir Usmanov 6ede10c1ca JVM_IR: Minor. Add test for SMAP of inner object/lambda of inline suspend function 2020-01-20 16:00:36 +01:00
Steven Schäfer 0da4b06074 psi2ir: Fix return insertion
We should only insert a return statement at the end of a lambda or
function if the final statement is used as an expression (slice
USED_AS_RESULT_OF_LAMBDA and USED_AS_EXPRESSION).
2019-10-31 11:13:44 +03:00
pyos d3992826e4 JVM_IR: discard parameter annotations in anonymous object constructors 2019-10-14 14:54:44 +02:00
pyos 06c00f4d9e Unmute some JVM_IR inlining tests 2019-10-08 17:19:41 +02:00
Georgy Bronnikov 7ede26e8f4 IrCompileKotlinAgainstInlineKotlin tests 2019-09-06 09:19:57 +03:00
Mikhael Bogdanov 1eda42cb88 JVM_IR. Generate SMAP information for anonymous classes
#KT-28092 Fixed
2019-08-08 12:02:50 +02:00
Steven Schäfer efb938a7c8 (Un)mute tests 2019-07-31 11:18:44 +02:00
Mikhael Bogdanov ec6904afd1 Minor. Fix test data 2019-05-06 17:34:02 +02:00
pyos 90f11211d3 JVM_IR: wrap performInline in enterIntoInlining/exitFromInliningOf 2019-05-06 16:23:28 +02:00
Mikhael Bogdanov eb1bfac83f Minor. Fix test data 2019-04-08 16:23:00 +02:00
Mikhael Bogdanov 2a3a9bb5fc Support properties reificaton 2019-04-08 13:10:25 +02:00
Alexander Udalov e2106d4d08 Do not assert that function is inline in MemberDescriptor.isInlineOnly
This is a more accurate fix of the problem described in 946acd2416
2019-02-26 11:16:01 +01:00
Alexander Udalov 946acd2416 Minor, ignore test for JVM_IR
It started to fail with AssertionError in inlineOnly.kt after
d267f1e875 because "$annotations" methods have annotations from the
corresponding property (which can include InlineOnly), but are never
inline. The test will be unmuted as soon as we stop using wrapped
descriptors in the IR backend to determine access flags which should be
generated on a declaration in the bytecode
2019-02-20 10:56:14 +01:00
Mikhael Bogdanov 1217d3591b Specify JVM target backend for test with '::class.java' usage 2018-12-21 16:09:04 +01:00
Alexander Udalov 9b6a52ccba Remove LANGUAGE_VERSION from boxInline tests 2018-12-20 12:53:22 +01:00
Mikhael Bogdanov 623f31a178 Remove redundant tests 2018-11-29 12:02:05 +01:00
Mikhael Bogdanov a789fd92fe Properly parse smap information
#KT-23369 Fixed
2018-09-19 12:14:07 +02:00
Mikhael Bogdanov 357359b1dd Unmute ir-tests after CR support 2018-08-09 14:22:50 +03:00
Mikhael Bogdanov 06b16a6459 Unmute ir-tests after prev commit 2018-08-09 14:22:46 +03:00
Mikhael Bogdanov 6c65507f29 Mute inline tests 2018-08-02 13:19:25 +02:00
Mikhael Bogdanov b1693acfcd Unmute smap test in ir 2018-06-28 17:12:09 +02:00
Mikhael Bogdanov e149cbe852 Mute failed jvm ir tests 2018-06-28 12:26:41 +02:00
Yan Zhulanow 5f43808cfd Revert "Debugger: Fix breakpoints and stepping for inline-only function lambda arguments (#KT-23064)" 2018-06-08 19:37:20 +03:00
Ilya Gorbunov bea94d1d59 Update line numbers of inlined stdlib functions after updating copyright
This should not be needed, see KT-23862
2018-04-26 21:57:50 +03:00
Ilmir Usmanov 3cceb13d04 Update inliner test after changing bootstrap compiler 2018-04-23 21:52:00 +03:00
Yan Zhulanow 95684b9ecb Minor: Fix codegen tests for smap 2018-04-09 19:45:49 +03:00
Yan Zhulanow eec9c6bffa Debugger: Fix breakpoints and stepping for inline-only function lambda arguments (#KT-23064) 2018-04-02 19:14:14 +03:00
Mikhael Bogdanov b65dcf27ee Provide test source mapping data for separate and non-separate compilation
Compilation in same module or in separate ones
2017-12-21 12:52:28 +01:00
Mikhael Bogdanov f4f7c83eeb Copy nested objects of default lambda during inline 2017-12-21 12:52:28 +01:00
Mikhael Bogdanov 3513f1a86a Properly process default lambda source mapping
#KT-21827 Fixed
2017-12-21 12:52:27 +01:00
Mikhael Bogdanov ff676c050f Properly generate inner classes when compiling source for inline
KT-19175: Compiler generates different bytecode when classes are compiled separately or together

 #KT-19175 Fixed
2017-07-26 20:31:14 +02:00