Commit Graph

538 Commits

Author SHA1 Message Date
Georgy Bronnikov b154f74b99 JVM_IR: avoid descriptors when tracking inline properties
Preparing to use wrapped properties in InlineCodegen.

Original commit: 8e24256f95
2020-07-02 12:46:58 +03:00
Denis Zharkov 50725dcde2 Fix incremental compilation for calls to inner classes from supertypes
The problem became actual after bba1c88c8e634b707bb39522129d226add3fa90d

Original commit: 3ce980fd88
2020-07-01 06:55:52 +03:00
Dmitry Petrov e9abd4dbf7 JVM: Generate object and companion object INSTANCE fields as @NotNull
Original commit: e9231b5624
2020-06-22 16:28:00 +03:00
Roman Artemev b11a0d3fc6 [KLIB IC] Add test about incremental kotlin-js-stdlib-klib recompliation
Original commit: cc818025df
2020-06-22 11:30:40 +03:00
Ilya Muradyan 68619252a8 Compare lookups without respect to their order
Original commit: 7526ff9484
2020-06-18 09:51:16 +02:00
Alexander Udalov 83ec05b31d Support new scheme of compilation of OptionalExpectation annotations
Instead of generating these annotation classes as package-private on
JVM, serialize their metadata to the .kotlin_module file, and load it
when compiling dependent multiplatform modules.

The problem with generating them as package-private was that
kotlin-stdlib for JVM would end up declaring symbols from other
platforms, which would include some annotations from package
kotlin.native. But using that package is discouraged by some tools
because it has a Java keyword in its name. In particular, jlink refused
to work with such artifact altogether (KT-21266).

 #KT-38652 Fixed

Original commit: 012ffa2993
2020-05-12 19:28:57 +02:00
Sergey Rostov 59993b1441 JPS: ignore removed java files
#KT-27458 Fixed

Original commit: 800fcc511a
2020-05-12 16:22:48 +03:00
Mikhail Zarechenskiy 76674906e5 Revert "Add option to enable new inference only for IDE analysis"
This reverts commit 36580d46da.

 #KT-37378 Fixed

Original commit: c01a171d4c
2020-05-04 15:14:43 +03:00
Alexey Tsvetkov 6f7fffbffc JPS: remove outputs for additional dirty files for current iteration
JPS does not remove output files for files marked as dirty
for current iteration. This is a problem for adding complementary files
during JPS MPP IC.
If output files are not removed, the compiler might raise an error
for duplicated actual declarations.

Original commit: 06275a201c
2020-04-18 06:05:44 +03:00
Alexey Tsvetkov 334ae8b2b7 Remove dirty output files when expanding IC scope early
Previously IC could go to the next iteration without removing
outputs for the files compiled during the last iteration.
For example, it could happen, when a multifile part is changed
(we add sources for other parts and recompile everything together).

In case of MPP it could lead to compile error, because
the compiler would see the same actual declarations from dirty sources
and dirty outputs from previous iteration (which should have been removed).
That behaviour did not raise an error before a5c976d0f751830704daa8b7386fcc288139c35c
because actual declarations from binaries (e.g. compile classpath) were ignored.

    #KT-35957 Fixed

Original commit: 4ccec5218f
2020-04-18 06:05:44 +03:00
Alexey Tsvetkov c3abb27b31 Add test for KT-35957
Original commit: 2442abadc3
2020-04-18 06:05:44 +03:00
Alexey Tsvetkov 2af9acb32a Minor: move non-JPS MPP IC tests under incremental/mpp dir
Original commit: 876d6d209f
2020-04-18 06:05:44 +03:00
Alexey Tsvetkov da1c48254d Add tests for lookup tracker with JS KLIB compiler
Original commit: 6acf9385bd
2020-04-10 05:35:45 +03:00
pyos 4fe55d228f JVM_IR: delay writes to the source map until generateMethod
`generateMethodNode` should not have any side effects for the output to
be stable under incremental compilation.

Original commit: 9ed73439f8
2020-04-08 07:04:16 +02:00
pyos 5c27cf0c71 JVM_IR: reuse MethodNodes for inline functions in same module
This fixes the weird cases when a class gets overwritten by an imperfect
copy, reduces the number of classes in the output if an inline function
contains an inline call that causes it to have regenerated anonymous
objects, and makes inlining of same module functions a bit faster in
general. On the other hand, this may increase memory footprint a bit
because classes cannot be flushed to the output jar, as the inliner
would not be able to locate classes for anonymous objects if they have
already been unloaded from memory.

Original commit: 82899e6243
2020-04-08 07:04:16 +02:00
Vyacheslav Gerasimov c06a236e36 Always checkout/checkin text files with lf endings
Different line endings on linux/windows prevents gradle from reusing
build cache since endings make task inputs completely different between
systems

Original commit: bcefa68df0
2020-03-18 22:33:15 +03:00
Pavel Kirpichenkov 3c2874763b [JPS-TESTS] Update incremental compilation test for 1.4
Bug fix `NoConstantValueAttributeForNonConstVals` removes constant attribute from non-constant properties.
Code using such properties does not have to be recompiled, since its value is no longer inlined.

Original commit: 6ed1cc5cd8
2020-02-18 18:31:47 +03:00
Pavel Kirpichenkov 78613c8382 [minor] Update build output in test to fit NI
Original commit: 32e1ec8e98
2020-02-18 11:19:19 +03:00
Mikhail Zarechenskiy e42bedfc44 Update test about lookups for SAMs after enabling NI
In NI we don't perform lookup if argument is obviously can't be
 adapted by SAM conversion (and here there is no argument at all)

Original commit: dfe23e770c
2020-02-17 12:38:21 +03:00
Steven Schäfer 11798e296b JVM IR: Implement LookupLocation in IrSourceCompilerForInline
This is used when compiling calls to inline functions with a different
@JvmName for incremental compilation.

Original commit: 76f8109ff6
2020-02-13 14:46:35 +01:00
Ilya Gorbunov 93d5015b46 Migrate tests to release coroutines
where it's not essential to use experimental ones

#KT-36083

Original commit: 30bccc431b
2020-01-29 09:12:41 +03:00
Alexey Tsvetkov 9a820cde31 Add IC scope expansion tests
#KT-13677
  #KT-28233

Original commit: c912f76d6f
2020-01-21 16:36:36 +03:00
Alexey Tsvetkov d0f1feadf0 Remove some unneeded gradle specific IC logs
They stoped being different from JPS logs for some time

Original commit: b979be701e
2020-01-21 16:36:36 +03:00
Alexey Tsvetkov d45f2e625b Recompile all dirty files in case of error
Original commit: ef83431618
2020-01-21 16:36:36 +03:00
Alexey Tsvetkov 14b4f22484 Expand compilation scope for IC before backend is run
Sometimes IC raises compilation errors when rebuild succeeds.
This happens because IC uses serialized decriptors
for non-dirty files. Serialized descriptors can be different
from source file descriptors. For example, a source file
may contain an implicit return type or an implicit visibility
for overridden methods, but serialized descriptors always
contain explicit return types & methods' visibilities.

These problems can be solved by expanding a scope of incremental compilation
just after the analysis, but before error reporting & code generation.
In other words, we need to compare descriptors before error reporting and code generation.
If there are new dirty files, current round of IC must be aborted,
next round must be performed with new dirty files.

This commit implements IC scope expansion for JS Klib compiler

    #KT-13677
    #KT-28233

Original commit: 2d598d50d7
2020-01-21 16:36:36 +03:00
pyos 4e55addc99 JVM_IR: keep offsets of const val reads when inlining them
Original commit: 3e67ff097e
2019-11-29 16:49:52 +01:00
Pavel Kirpichenkov 96dcadf178 Add frontend checks for missing dependency supertypes
Call checker and declaration checker are used in order to preserve backward compatibility.
Attempt to use classifier usage checker was not good enouth,
since not all errors found with it would actually be reported before.
For example types and constructor calls don't cause supertypes to resolve,
so missing supertypes would not lead to errors in case they are the only use of class name.

Updated tests failing due to missing Java dependencies in superclasses.

Original commit: 8c52bb4212
2019-11-18 12:06:41 +03:00
Roman Artemev 427bea1108 [IC] Unmute IC klib tests
Original commit: 3e3cb8734b
2019-11-08 14:14:59 +03:00
Nikolay Krasko f8d8f666c9 Mute IncrementalJsKlibCompilerRunnerTestGenerated tests (KT-34538)
#KT-34538 Fixed

Original commit: ebf5e4b590
2019-10-23 12:49:49 +03:00
Pavel Kirpichenkov 49d1c448d5 Clearify diagnostic messages that involve internal visibilities
KT-7354 Fixed

Visibility.displayText is deprecated with warning.
Diagnostics for java visibilities changed.

Original commit: 0a1b3a8455
2019-09-16 19:00:43 +03:00
Ilmir Usmanov 7af34497fb JVM_IR: Minor. Unmute tests
Original commit: 1951ff8054
2019-09-16 16:49:24 +03:00
Alexey Tsvetkov 9ed811485b Add test logs specific for IC with JS IR
Incremental inline will be handled during lowerings,
after all klibs are generated

Original commit: 8e6a80bed7
2019-08-15 15:11:52 +03:00
Alexander Udalov 1f92f41338 JVM IR: generate correct metadata for multi-file classes
Original commit: f01b0f6467
2019-08-05 21:27:21 +02:00
Alexander Udalov 84ccc672c5 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.

Original commit: 4be0e00071
2019-08-05 21:27:21 +02:00
Alexander Udalov d15ecc1500 JVM IR: generate tests on incremental compilation
Original commit: 73a671af7c
2019-08-05 21:27:21 +02:00
Alexey Tsvetkov 144652dbaa Fix IC test for multifile part with property
Our JPS and Gradle plugins handle
recompilation of multifile classes differently.

JPS plugin delegates handling to the JPS itself,
which tracks dependencies via bytecode,
and marks classes as dirty when they are affected.
So in JPS other parts of multifile classes are recompiled only
when a part's signature is changed.

In Gradle plugin we handle recompilation ourselves in
simpler way: any change in any part leads to a recompilation
of all parts of the same multifile class.

In future we should improve our Gradle plugin, but for now
I'm changing the test so that both JPS and Gradle tests
recompile all parts.

Also the dummy function is added to make sure that we
don't blindly recompile everything when a part is changed.

Original commit: 7f1d30058a
2019-05-29 10:23:19 +02:00
Alexey Tsvetkov 4beeb8d657 Add test for KT-31131
Original commit: 56d5846ef1
2019-05-29 10:23:18 +02:00
Alexey Tsvetkov b5741d3120 Do not expose paths with placeholders in JS IC caches
#KT-31310 Fixed

Original commit: 209a5d8464
2019-05-16 04:01:26 +03:00
Mikhail Zarechenskiy 36580d46da Add option to enable new inference only for IDE analysis
#KT-30453 Fixed

Original commit: a3247b1b92
2019-05-06 14:36:05 +03:00
Alexey Tsvetkov 78ec448ca3 Test JPS Kotlin caches don't change when project root is different
Original commit: f66d95545d
2019-04-22 15:27:57 +03:00
Alexey Tsvetkov d7b2901448 Always run codegen when IC is enabled
We may need to run code generation when no source files are specified
for incremental compilation (to update caches & metadata)

Original commit: 97d3d38374
2019-03-25 16:39:47 +03:00
Yaroslav Russkih 1a65bb03f7 Use https everywhere - documentation and samples
Original commit: 9ac52fad17
2019-02-19 21:35:36 +01:00
Anton Bannykh add12dd77f JS: add incremental test for local declarations change
Original commit: 21cbc7b018
2019-02-14 15:14:28 +03:00
Sergey Rostov e9aeb9459b JPS: exclude source roots from other targets
Previously `findJavaRootDescriptor` was return source root for random
module. This cause build errors for mpp (same file may appear in
multiple source roots of common and platform modules)

#KT-28988 Fixed

Original commit: 75e59fdc46
2019-01-11 12:53:11 +03:00
Sergey Rostov 5af4857473 JPS: remove cache version from test data
Original commit: b3985d2735
2019-01-10 08:50:38 +03:00
Sergey Rostov 1624559845 JPS: report about unsupported targets once
Report about unsupported targets once per target type, show presentable
chunks list and don't show more then 5 chunks.

Example: "Native is not yet supported in IDEA internal build system.
Please use Gradle to build a, b, c, d, e and 10 other  (enable 'Delegate
IDE build/run actions to Gradle' in Settings)."

#KT-26980 Fixed
#KT-28316 Fixed

Original commit: 62b0b3e4e9
2018-11-28 11:08:57 +03:00
Sergey Rostov c075d6a911 JPS: Test for "Cyclically dependent modules should have same compiler"
KT-27285

Original commit: c06b000e8d
2018-11-28 10:46:57 +03:00
Sergey Rostov 37185c22d0 JPS: support KotlinResourceSourceRootType
Implementation is similar to KotlinSourceRootProvider.
This workaround is required since ResourcesTarget.computeRootDescriptors
supports only JavaResourceRoots.

#KT-27622 Fixed

Original commit: dcc47fd8ef
2018-11-26 09:29:49 +03:00
Sergey Rostov cfb54fa15c JPS, tests, minor: rename test files in modules for better readability
Original commit: 1301333e37
2018-11-26 09:29:38 +03:00
Sergey Rostov 71003b4e75 JPS, tests: update removeAndRestoreCompanion[WithImplicitUsages] test data
src/A.kt is affected by removed classes

Original commit: 32bd4d5936
2018-11-26 09:29:38 +03:00