Commit Graph

368 Commits

Author SHA1 Message Date
Alexander Udalov 9970851684 Restore writing bytecode version to metadata for LV < 1.5
#KT-45323 Fixed
2021-03-08 11:18:54 +01:00
Yaroslav Chernyshev 634c8522a1 Fix jvmTarget default divergence between KGP & IDE after change to 1.8 2021-03-02 11:51:11 +03:00
Alexander Udalov f63ffc51ae Remove JvmBytecodeBinaryVersion from the compiler code
Move it to build-common where it's still used in incremental compilation
caches, and simplify a bit. In the future, it'll make sense to remove it
completely and to avoid writing it to caches. In this commit, I don't do
that to prevent the IC cache version to be updated, causing rebuilds for
all JPS projects.

 #KT-41758
2021-02-23 12:45:41 +01:00
Aleksei.Cherepanov d0eeb0535d Add synchronization to MultiClassFiles maps 2021-02-19 23:54:55 +03:00
Aleksei.Cherepanov aa683d3b2a JPS: Fix JvmMultifileClass processing for IR backend
#KT-44644 Fixed
2021-02-19 23:54:53 +03:00
Ivan Gavrilovic 2fce6a4af9 Locate build history when file is outside of root project dir
Support use-cases when the build dir is outside of root project dir.
Many projects set up output dir as <root_project>/../out/<project_name>/build
to be able to clean build dir more easily. This commit adds support
to build history file detection and it tries to find build history
files for artifacts that are:
- under root project dir (a default structure)
- under root project's build dir parent (to support typical custom setup)

Fixes https://youtrack.jetbrains.com/issue/KT-40875

Test: BaseIncrementalCompilationMultiProjectIT
2021-02-02 12:47:07 +03:00
Alexander Udalov f350e9dacb Fix rendering of metadata of multifile facades in classFilesComparison.kt
Multifile facades (class files with header kind MULTIFILE_CLASS) have
the list of their parts in the d1 field (KotlinClassHeader.data), not
some byte-encoded protobuf message which this code was trying to
deserialize previously.
2021-01-28 13:19:27 +03:00
Roman Artemev 350ff8033d [IC KLIB] Replace JS IR build log with KLIB build log for klib compialtion
- fix test data
2021-01-26 19:23:25 +03:00
Roman Artemev 380225e0cb [KLIB IC] Support special klib-build.log in IC test infrastructure 2021-01-26 19:23:23 +03:00
Alexander Udalov 8ae19f5cd7 Fix deprecated Interner/StringInterner usages after update to 202 2021-01-13 19:17:21 +01:00
Dmitriy Novozhilov af94bcebea [IDE] Propagate KotlinFacetSettings version and completely drop isReleaseCoroutines flag
Also this commit removes number of tests related to support
  experimental coroutines
2021-01-12 16:47:55 +03:00
Dmitriy Novozhilov e991c9d476 [CLI] Drop CommonCompilerArguments.coroutinesState 2021-01-12 16:47:54 +03:00
Alexander Udalov 77a9d14f93 Capitalize/decapitalize only ASCII characters across project
Use {de,}capitalizeAsciiOnly and to{Lower,Upper}CaseAsciiOnly where
possible, and stdlib's functions with Locale.US everywhere else.

Otherwise, if the default system locale is Turkish, the capital latin
letter "I" is transformed in toLowerCase to "ı" (see
https://github.com/JetBrains/kotlin/blob/66bc142f92085047a1ca64f9a291f0496e33dd98/libraries/stdlib/jvm/test/text/StringJVMTest.kt#L119),
which for example breaks the codegen for `intArrayOf` in
KT-25400/KT-43405.

Similarly, lower case latin letter "i" is transformed to "İ".

 #KT-13631 Fixed
 #KT-25400 Fixed
 #KT-43405 Fixed
2020-12-28 16:10:30 +01:00
Andrey Uskov 7bdd7ce6b8 Reformat DirtyClassesMap 2020-12-13 20:17:24 +03:00
Andrey Uskov 275a02ce88 Fix synchronization when working with IC caches
IC caches could be modified and read from different threads.
In JPS builder these threads are RMI worker (invoked from Compiler
Daemon) and JPS worker thread. Proper synchronization fixes cases
when caches could become broken.
#KT-42265 Fixed
#KT-42194 Fixed
#KT-42265 Fixed
#KT-42937 Fixed
2020-12-13 20:17:22 +03:00
Andrey Uskov 36f99156fd IC of sealed classes
Supported case then children of sealed classes could be declared
anywhere in a module. If list of classes implementing sealing class
changes the sealed class and all its inheritors should be recompiled
(now sealed class should be compiled together with children in order
to calculate all possible inheritors at compile time) and and
invalidated (as they could have when operators).
2020-12-13 20:17:16 +03:00
Ilya Gorbunov c9bbdf6575 Use NIO Files for creating temp files: build tools 2020-11-20 06:09:36 +03:00
Vyacheslav Gerasimov 8620d26a8a Delete 193 bunch files 2020-11-11 14:28:53 +03:00
Alexey Tsvetkov 36387d97ad Add IC metrics reporting 2020-11-05 23:26:46 +03:00
Alexey Tsvetkov 5bde6457b1 Metrics reporting utils 2020-11-05 23:26:46 +03:00
nataliya.valtman e9669bf5cb fix unstable IncrementalFileToPathConverterTest tests 2020-10-28 12:33:03 +03:00
nataliya.valtman e1a380ec95 KT-34862 use relative path for incremental build cache 2020-10-27 10:45:06 +03:00
Mads Ager 8d791ca98e [IR] Update naming, but not binary format for IrSetValue. 2020-10-06 21:47:29 +02:00
Dmitriy Novozhilov 0d954f1190 Change module :core:compiler.backend.common.jvm to :compiler:backend.common.jvm 2020-09-24 16:51:06 +03:00
Dmitriy Novozhilov 54a5a066e8 Introduce new module for common parts of backend utils
Mainly it needed for abstract jvm type mapper for different type systems:
  IrTypes and ConeKotlinTypes
2020-09-24 16:51:05 +03:00
Dmitriy Novozhilov 8d2e89a9ea Move ProtoEnumFlags to :core:metadata 2020-09-11 10:08:34 +03:00
Dmitriy Novozhilov 6906e0d82d Move common jvm classes from :core:descriptors.jvm to :core:compiler.common.jvm 2020-09-04 11:42:51 +03:00
Dmitriy Novozhilov d1fd1da56f Rename Visibility to DescriptorVisibility 2020-09-04 11:07:42 +03:00
Alexander Udalov a9ddf02556 Replace deprecated usages of max/min with maxOrNull/minOrNull 2020-08-25 20:33:59 +02:00
Alexander Udalov 425b192a5f Fix warnings in build-common/daemon code 2020-08-20 14:58:11 +02:00
Alexander Udalov a21f273570 Fix compiler warnings in compiler code 2020-08-17 21:18:20 +02:00
Nikolay Krasko 21fa2bf98c Switch to 201 platform 2020-06-30 19:53:18 +03:00
Ilya Chernikov 5e33612238 Extract interface from CompilerMessageLocation to ease extension
The CompilerMessageLocation is an implicit part of the binary daemon
protocol so changing it breaks compatibility with older daemons.
This change allows to extend location for non-daemon uses without
breaking the binary protocol.
2020-06-05 21:58:27 +02:00
Yunir Salimzyanov 3b9000cc0c Cleanup 191 extension files (KTI-240) 2020-06-01 18:43:10 +03:00
Leonid Startsev 7c8c5b057f Extensible mechanism for plugin metadata during descriptor serialization
A mechanism that allows kotlinx.serialization plugin to preserve the
correct (program) order of properties after serializing/deserializing
descriptors to kotlin metadata, which is needed for correct and stable
json serialization of class hierarchies in incremental/multi-module scenario.
It uses protobuf extensions.
2020-06-01 17:48:16 +03:00
Vladimir Dolzhenko 599c5dd474 Collect unique subtypes from incremental compilation cache 2020-05-15 10:48:55 +00:00
Vladimir Dolzhenko 2f3ff10204 formatting clean up 2020-05-15 10:48:54 +00:00
Mikhael Bogdanov 9fdb1ff4f8 Call visit method on ClassWriter in IC caching in proper order 2020-05-13 13:45:10 +02:00
Mikhail Bogdanov 3134832396 Call missed visit method on ClassWriter in IC caching
Otherwise ASM fails with error on invalid frames because bytecode version is 0
2020-05-13 06:29:23 +02:00
Alexander Udalov 012ffa2993 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
2020-05-12 19:28:57 +02:00
Mikhail Bogdanov 7d54027f41 Minor. Rename new proto property, JvmFlags.getClassFlags method
Compiler requires this new flag to know where actual interface method body is generated to emit proper method calls
2020-04-09 07:37:33 +02:00
Mikhael Bogdanov ff8eac29a0 New flag in proto 2020-04-09 07:37:31 +02:00
Alexander Udalov fe5104b865 Move package org.jetbrains.kotlin.incremental.js to 'js.config'
This allows to replace dependency on 'js.frontend' with 'js.config', in
'kotlin-build-common' and 'daemon-common'. Also simplify some other
dependencies.
2020-03-28 21:30:05 +01:00
Roman Artemev 6a37955a36 [KLIB] Implement new linker based on IdSignature
- Remove klib dependency on metadata and uniqID
 - Refactored proto format to make it more effective and compact
  -- Use special encoding for some types of data (coordinates, flags, types)
  -- Remove symbols table
  -- Use packed proto list if it is possible
 - Remove extension from metadata
 - Remove special ids for function interfaces
 - Fix klib IO
 - Fix incremental cache
 - General code clean up
2020-02-14 18:22:16 +03:00
Mikhail Zarechenskiy c1db9b6d40 [NI] Fix incremental compilation for SAM adapters
This commit fixes test:
 - JavaUsedInKotlin.SamConversions#testMethodAddedSamAdapter
2020-02-13 11:16:00 +03:00
Nikolay Krasko 9d3d59fccb 201: Remove JpsPersistentHashMap (bunched) 2020-02-11 20:28:00 +03:00
Nikolay Krasko 162c2f3dc9 201: openapi.jar is removed 2020-02-11 20:27:59 +03:00
Alexander Udalov d4170bca6e Regenerate generated files after updating copyright year 2020-01-30 12:41:42 +01:00
Andrey Uskov e1d03e1f3a Open files leak on incremental compilation fixed
#KT-25206 Fixed
2020-01-23 20:47:18 +03:00
Alexey Tsvetkov 2d598d50d7 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
2020-01-21 16:36:36 +03:00