Commit Graph

90 Commits

Author SHA1 Message Date
Mads Ager 41aa0a7c7f [FIR] Fix line number differences between psi2ir and fir2ir. 2021-11-01 15:43:13 +03:00
Ivan Kylchik f4bbcdc013 [TESTS] Move global directives outside file scope 2021-10-25 00:14:19 +03:00
Dmitry Petrov 851980e36f JVM_IR KT-45103 optimize direct invoke for lambdas and callable refs 2021-05-18 22:20:12 +03:00
pyos e6d923f65c FIR: rename HIDDEN to INVISIBLE_REFERENCE
Some of them should be INVISIBLE_MEMBER though
2021-04-21 16:18:21 +03:00
Dmitriy Novozhilov 49c2bfe637 [Test] Enable SMAP dump handler in boxInline tests 2021-02-02 17:53:53 +03:00
Dmitriy Novozhilov 64a300bfcd [TD] Update testdata according to previous commit 2021-02-02 17:53:52 +03:00
Dmitriy Novozhilov 8973e3f362 [TD] Update fir directives in boxInline tests 2021-02-02 17:50:07 +03:00
Dmitriy Novozhilov 6a2796b067 [Test] Fix source maps in testdata according to KT-37704 2021-01-28 13:19:29 +03:00
Mikhael Bogdanov de00f72fa3 Generate linenumber for inline call site in case of implicit iterator/hasNext/next calls in for loop
Otherwise -1 is generated in smap
2021-01-21 12:04:09 +01:00
Mikhael Bogdanov 91717cdcdd Perform inline checks in IR tests 2021-01-20 15:23:09 +01:00
Alexander Udalov 9e357354fb Add JVM/JVM_IR mixed compilation tests for compileKotlinAgainstKotlin/boxInline 2020-09-07 19:41:37 +02:00
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