Commit Graph

51 Commits

Author SHA1 Message Date
Dmitriy Dolovov a6064ecda6 [Commonizer] Generate correct TA types for callable descriptors
Issue #KMM-217
2020-04-17 23:08:01 +07:00
LepilkinaElena 4f9364f997 Native specific frontend checker for @ThreadLocal (#3293) 2020-04-16 15:23:06 +03:00
Dmitriy Dolovov 101442ad14 KLIB: Store native targets in manifest 2020-04-10 19:33:27 +07:00
Alexey Tsvetkov 1c38466a22 Pass LookupTracker to deserialized scopes in JS KLIB compiler
Before this change, deserialized scopes were not tracking lookups properly,
because lookup tracker was not passed from compiler configuration correctly.
Because of that, lookups from dependencies were not tracked,
so multi-module IC was not working (chages were passed between modules,
but affected source files were not invalidated).
2020-04-10 05:35:45 +03:00
Ilya Matveev ba6ca67e4f [Commonizer] Support short library names 2020-04-09 13:07:43 +07:00
Dmitriy Dolovov a2e2213d31 Keep KonanTarget.predefinedTargets as Map<String, KonanTarget> 2020-04-01 23:10:47 +07:00
Dmitriy Dolovov 5411b85cb9 Minor. Rename isKonanStdlib() into isNativeStdlib() 2020-04-01 11:47:10 +07:00
Dmitriy Dolovov 31a1f8ff4b Include :native:kotlin-native-utils into kotlin-compiler.jar 2020-04-01 11:46:55 +07:00
Ilya Matveev 172a45a637 Gradle, native: Fix building platform libraries for MIPS
The sysroot for linux_mips doesn't contain one of platform
libs available for Linux (zlib). So we need to put def-files
to the K/N distribution on a per-target basis instead of putting
a single set of def-files for all targets of the same OS.

Corresponding change in the K/N repository:
https://github.com/JetBrains/kotlin-native/pull/4023

This patch take this change into account at the Gradle plugin side.
2020-03-30 17:31:12 +07:00
Alexander Udalov 9e014e462b Do not use CommonPlatforms directly in CommonResolverForModuleFactory
This allows to get rid of dependency of this code on CommonPlatforms,
which depends on all platforms (JVM, JS, Native), and eventually move it
to 'frontend'.
2020-03-28 21:30:03 +01:00
Dmitriy Dolovov c23a11a6fc Refactoring: Clean-up usage of KlibMetadataFactories 2020-03-27 13:12:01 +07:00
Dmitriy Dolovov 36988cf15c Refactoring: Keep predefined K/N targets inside of KonanTarget.Companion 2020-03-27 13:11:46 +07:00
Dmitriy Dolovov 7a19558d54 Refactoring: Put KonanTarget & related classes into separate .kt files 2020-03-27 13:11:35 +07:00
Ilya Matveev 27f5c577c9 Gradle, native: Generate platform libraries at the user side
Since 1.4, a regular K/N distribution will not contain prebuilt
platform libraries, so the libraries must be generated at the
user side.

This patch adds support for such generation to the MPP Gradle
plugin. The generation itself is performed by separate utility
provided by the K/N compiler distribution. The plugin checks
existence of platform libraries for required targets and starts
this utility if some some of these libraries are missing. Building
caches for platform libraries is also performed at this step.

The patch also adds some project properties allowing a user to
workaround potential problems. User will be able to:
  - Use a special distribution with prebuilt platform libraries.
  - Force building platform libraries in the good old sourcecode mode
    in case of some issues with the new metadata mode.

Kotlin/Native counterpart: https://github.com/JetBrains/kotlin-native/pull/3829.

Issue #KT-32931 Fixed
2020-03-24 18:54:11 +07:00
Sergey Bogolepov e919e7b79a [Gradle][Native][Cache] Don't skip metadata-based interop libraries
`resolveSingleFileKlib` by default doesn't support klibs with
non-default ir providers. In case of cache generation for native interop
libraries we need to override this behavior because they have
ir_provider=kotlin.native.cinterop.
2020-03-12 18:11:47 +07:00
Dmitriy Dolovov ed96b81a42 [Commonzer] Fix ISE during commonization, improve interner performance
Issue #MMPP-191
2020-03-06 21:44:58 +07:00
LepilkinaElena 61f5523805 Added Native-specific checker for properties of top level singletons (#3172) 2020-03-06 14:58:09 +03:00
Dmitry Savvinov b8b1dd753c Add builtins_platform property to klib manifest 2020-03-05 17:27:38 +03:00
Kirill Shmakov 03c6f13831 Add fallback value in K/N version computation 2020-03-05 08:35:34 +03:00
LepilkinaElena b031706ea9 Added Native-specific frontend checker for @SharedImmutable (#3091) 2020-03-04 16:45:37 +03:00
Roman Artemev bb43a66716 [Metadata] Add platform dependent type transformer
- Fix forward declaration type construction
2020-02-26 14:55:54 +03:00
Roman Artemev 25a91a217e [KLIB] Fix package for NullFlexibleTypeDeserializer 2020-02-26 14:55:53 +03:00
Dmitriy Dolovov f2b940ffd4 [Commonizer] Apply interner to avoid duplicated CirValueParameterImpl objects 2020-02-18 22:03:55 +07:00
Dmitriy Dolovov 5663dfb772 [Commonizer] Apply interner to avoid duplicated CirSetter objects 2020-02-18 22:03:49 +07:00
Dmitriy Dolovov e54640ddad [Commonizer] Apply interner to avoid duplicated CirGetter objects 2020-02-18 22:03:41 +07:00
Dmitriy Dolovov 39125a75e7 [Commonizer] Apply interner to avoid duplicated CirAnnotation objects 2020-02-18 22:03:35 +07:00
Dmitriy Dolovov c88ea2f2e6 [Commonizer] Apply interner to avoid duplicated CirSimpleType objects 2020-02-18 22:03:16 +07:00
Dmitriy Dolovov 84bc151cb3 Minor. Add toString() to CommonizedClassDescriptor.CommonizedClassTypeConstructor 2020-02-18 22:03:10 +07:00
Dmitriy Dolovov d0e9dc05b5 [Commonizer] Apply interner to avoid duplicated Name objects 2020-02-18 22:03:03 +07:00
Dmitriy Dolovov 47d091702b [Commonizer] Apply interner to avoid duplicated FqName objects 2020-02-18 22:02:57 +07:00
Dmitriy Dolovov adc5a55d65 [Commonizer] Apply interner to avoid duplicated String objects 2020-02-18 22:02:50 +07:00
Dmitriy Dolovov 667e96f971 [Commonizer] Don't keep references to descriptor objects when they are not needed anymore
This is necessary to reduce overall memory consumption.
2020-02-18 22:02:44 +07:00
Dmitriy Dolovov 9a8a1113db [Commonizer] Don't commonize deprecated functions
1. All functions marked with @Deprecated from Kotlin/Native platform libraries
have DeprecationLevel.ERROR, and therefore practically can not be used by
a developer in their code. So, it does not make sence to keep such
declarations in commonized libraries.

2. Commonization of such functions would also require commonization of
annotations with nested annotations as const values (ex:
@Deprecated(level = DeprecationLevel.ERROR), where both @Deprecated
and DeprecationLevel are annotation classes). This is not implemented yet.
2020-02-18 22:02:38 +07:00
Dmitriy Dolovov 11e0f427ac [Commonizer] Refactor CIR to avoid strong refs on descriptors
This is necessary to reduce memory consumption in commonizer while
processing sets of massive libraries.
Ex: ios_x64 (127 libraries) vs ios_arm64 (127 libraries).
2020-02-18 22:02:29 +07: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
Svyatoslav Scherbina 829e5908d0 Allow Native @Throws on override when the same list is specified 2020-02-14 17:10:58 +03:00
Dmitriy Dolovov f98a4e6715 Minor. Text formatted in commonizer CLI 2020-02-11 08:51:47 +07:00
Dmitriy Dolovov d7e82bf899 [Commonizer] Integrate commonizer to the Gradle plugin, p.1
Detect when it's really necessary to run commonizer. Resolve Kotlin/Native
platform dependencies. Add dependencies to the proper Gradle configurations.

Note: The most common source sets such as "commonMain" and "commonTest"
should not be used as Native intermediate source sets.
2020-02-11 08:51:24 +07:00
Dmitriy Dolovov 4ccff3f1b1 [Commonizer] Add extendable uniform multi-task CLI 2020-02-11 08:51:15 +07:00
Dmitriy Dolovov 91fce721b3 [Commonizer] Publish artifact for Kotlin embeddable compiler 2020-02-11 08:51:07 +07:00
Dmitriy Dolovov 4027079b41 [Commonizer] Fix dependencies visible in POM file 2020-02-11 08:51:00 +07:00
Dmitriy Dolovov b711c6d398 Rename :native:kotlin-native-commonizer to :native:kotlin-klib-commonizer 2020-02-11 08:50:50 +07:00
Svyatoslav Scherbina 5eedba3903 Add Native-specific frontend checker for @Throws 2020-02-06 11:00:31 +03:00
Svyatoslav Scherbina e699965ed6 Add infrastructure for Native-specific frontend diagnostics 2020-02-06 11:00:22 +03:00
Svyatoslav Scherbina cd92d3e9b4 Make :native:frontend.native depend on intellij-core 2020-02-06 11:00:16 +03:00
Dmitriy Dolovov 4dbf60eb2c Fix: Load properties in konan Distribution in safe way
Issue #KT-36333
2020-02-04 19:24:42 +07:00
Dmitriy Dolovov f69eef811b Minor: Remove unnecessary IO check 2020-02-04 19:24:36 +07:00
Dmitriy Dolovov 4336096775 Use "tooling" KLIB resolve strategy in IDE and commonizer
Issue #KT-36213
2020-02-01 17:07:02 +07:00
Dmitriy Dolovov 9594b8db42 Rename Kotlin/Native modules for uniformity 2020-01-29 20:30:46 +07:00
Dmitriy Dolovov 25ff33cc3c Update NativePlatformAnalyzerServices from Kotlin/Native repo 2020-01-29 20:30:35 +07:00