Commit Graph

28 Commits

Author SHA1 Message Date
Alexander Udalov 1588b07472 Tests: unmute light analysis tests passing with JVM_IR 2023-06-22 17:10:51 +02:00
Steven Schäfer 7d59c7689c JVM IR: Avoid direct invokes in callable reference tests
Due to the direct invoke optimization, most callable reference tests
were not generating callable references/lambdas.
2022-07-14 23:24:18 +02:00
Ivan Kylchik c7435ba760 Replace all occurrences of WITH_RUNTIME with WITH_STDLIB
We are going to deprecate `WITH_RUNTIME` directive. The main reason
behind this change is that `WITH_STDLIB` directive better describes
its meaning, specifically it will add kotlin stdlib to test's classpath.
2021-11-17 15:26:38 +03:00
Mikhael Bogdanov 1c612376dd Disable some android box test 2021-01-28 18:30:48 +01:00
Alexander Udalov 1b39a235d8 JVM IR: sort multifile part names in metadata 2020-10-13 16:40:53 +02:00
Alexander Udalov bb1a12e28e JVM IR: use correct owner for callable references in optimized multifile classes
The owner should always be the facade class, because the part class is
package-private and will be inaccessible from other package.

Note that in the old backend, function references already do have the
facade as the owner correctly, but property references don't, this is
reported as KT-37972.
2020-04-03 15:37:56 +02:00
Mikhail Glukhikh 2308e5bb7c FIR2IR: in case of use-site generic type use call from original class 2020-02-28 15:29:02 +03:00
Juan Chen 9dd8eda1c9 [FIR]: fix library methods in packages
Library methods such as 'listOf' are resolved
to have the package fragments as their parents,
but JVM expects their containing file classes as parents.
This fix generates those file classes and
uses them as parent replacements for such library methods.
2020-02-20 14:24:02 +03:00
Juan Chen 04e8cba857 [FIR] fixed overridden symbols of "invoke" in KFunction
IR expects overridden symbols of "invoke" in KFunction to be "invoke"
in the corresponding Function classes.
Before this commit we don't set overriddenSymbol, now we do.
2020-02-11 16:09:21 +03:00
Juan Chen 7249d2f889 [FIR] Fix translation of invokes & add return expressions for lambdas
* fixed NoSuchMethod caused by mismatched signatures of the "invoke" method generated for lambda arguments
* added test cases in invoke.kt for KFunction and anonymous functions
* added a transformer to wrap the last expression in the bodies of lambdas with return
2020-02-06 12:44:14 +03:00
Mikhail Glukhikh f3d0a976b2 Disable recently added FIR black box tests 2019-11-19 11:00:10 +03:00
Mark Punzalan 9df2f69f09 [FIR] Disable failing blackbox codegen tests for FIR. 2019-11-19 11:00:09 +03:00
Alexander Udalov 0daab88f97 JVM IR: make RemoveInlinedDeclarations a final module phase
Code in inline lambdas can call multifile part members. These calls are
replaced in GenerateMultifileFacades with the call to the facade member.
Previously this didn't happen though because the lambda body was removed
before the GenerateMultifileFacades phase, which led to
IllegalAccessError in the -Xmultifile-parts-inherit mode (because the
part class is package private in another package).
2019-11-18 18:58:41 +01:00
Alexander Udalov f47b67781d JVM IR: fix containing declaration for top level members in wrapped descriptors
In addition to fixing getContainingDeclaration, change origin of
multifile facades to FILE_CLASS since the corresponding class descriptor
should also be skipped when computing containing declaration. This fixes
the problem with internal function calls in -Xmultifile-parts-inherit
mode (previously we incorrectly mangled the function name in
MethodSignatureMapper), and also fixes coroutine intrinsic calls when
compiling kotlin-stdlib with JVM IR. In the latter case, all intrinsics
(such as isBuiltInSuspendCoroutineUninterceptedOrReturn) are present in
sources, and were previously not detected as intrinsics by the code in
`generateInlineIntrinsic` because the FQ name didn't match: it had an
additional component for the file class name.
2019-11-18 18:58:41 +01:00
Alexander Udalov 4be0e00071 JVM IR: support multi-file classes
Without the `-Xmultifile-parts-inherit` mode for now.

This is implemented as follows: FileClassLowering collects information
about multifile parts and the corresponding facades, which a later
GenerateMultifileFacades phase uses to generate new IrFile instances and
add it to the module fragment that's being compiled.

Note that GenerateMultifileFacades is in the end of lowering phases
because delegates in the facade should be generated for all additional
functions generated by certain lowerings (default arguments,
JvmOverloads, etc.). If GenerateMultifileFacades was right after
FileClassLowering, they would still be generated, but we'd then process
them in lowerings mentioned above, which would result in duplicated
logic in the bytecode. There's a new bytecode text test which checks
that this doesn't happen for functions with default arguments.
2019-08-05 21:27:21 +02:00
Alexander Udalov e72388895b JVM IR: invoke codegen after lowering all files in the module
Inspired by discussion in #2316
2019-05-30 13:28:31 +02:00
pyos b23f2a4dbb JVM_IR: set ConstantValue on static final primitive fields 2019-04-18 09:16:32 +02:00
pyos 8c55376f0c Unmute almost all JVM_IR tests that use property references 2019-03-19 12:00:29 +01:00
Alexander Udalov a2f4efbc2a Report error on state in multi-file class with -Xmultifile-parts-inherit
Simplify MultifileClassPartCodegen, remove related tests and change some
tests to use const val instead of val because backing fields for const
properties are stored in the facade, not parts

 #KT-23701 Fixed
2019-01-25 15:57:13 +01:00
Alexander Udalov 6b5a16884c Refactor inheritMultifileParts to be a JVM analysis flag
Instead of a JVMConfigurationKeys key. This will allow to use it in a
checker in 'frontend.java'
2019-01-25 15:57:13 +01:00
Georgy Bronnikov 376eef05f5 JVM_IR. Accessor lowering 2018-10-15 21:52:50 +03:00
Mikhael Bogdanov e149cbe852 Mute failed jvm ir tests 2018-06-28 12:26:41 +02:00
Yan Zhulanow c50881fd02 Refactoring: Extract light analysis tests from box tests 2017-03-21 20:49:34 +03:00
Ilya Matveev a5e4e0284e Mute some box tests for native backend
This patch mutes the following test categories:
   * Tests with java dependencies (System class,
     java stdlib, jvm-oriented annotations etc).
   * Coroutines tests.
   * Reflection tests.
   * Tests with an inheritance from the standard
     collections.
2017-03-10 19:59:37 +03:00
Dmitry Petrov 27bf51c73f All multifile class tests should have 'TARGET_BACKEND: JVM' directive. 2017-03-09 17:22:28 +03:00
Zalim Bashorov 596f3364c6 Automatically mute failed tests 2016-11-09 21:41:12 +03:00
Dmitry Petrov 06101dba52 KT-13961 REDECLARATION not reported on private-in-file 'foo' vs public 'foo' in different file
Private-in-file declarations conflict with public overload-equivalent declarations
in other files in the same package.

Move functions for grouping possible redeclarations to OverloadResolver
(since they are used only there).

Refactor redeclarations / conflicting overloads reporting.
2016-10-03 11:50:29 +03:00
Dmitry Petrov db58ebc4b2 KT-11410: Class hierarchy for parts/facade of multi-file class.
Preserve static initialization semantics for parts by introducing a special "clinit trigger" class.
Insert "static initialization trigger" call to every method of a part class, remove this call on inline.
Always mangle names for private functions in multifile class parts to avoid resolution clashes on inheritance.

NB in codegen tests initializers for all non-const vals are wrapped in 'run { ... }',
so that the initializer is not a constant expression, and some static initialization code should be generated.
2016-04-01 10:13:22 +03:00