Commit Graph

2125 Commits

Author SHA1 Message Date
Igor Chevdar 9d911247fa [K/N] Wrap continuation with ContinuationImpl on callable references
#KT-55869
2023-01-25 15:55:16 +00:00
Sergey Bogolepov 60900b72b7 [K/N] Fix compilation of metadata klibs 2023-01-24 15:26:06 +00:00
Vladimir Sukharev db53b83822 [K/N] Improve native README for MacOS aarch64
Merge-request: KT-MR-8428
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-01-24 10:34:09 +00:00
Roman Efremov 5bd76dbf0b Temporarily comment failing Enum.entries resolve in K/N C interop
See KT-53929
2023-01-23 12:53:07 +01:00
Roman Efremov 14b4cdc7c4 Write "hasEnumEntries" flag into metadata when feature enabled
^KT-53929 Fixed
2023-01-23 12:53:04 +01:00
Vladimir Sukharev 195ecbac2e Serialize native klib extensions to pass most ObjCExport and CInterop tests.
Merge-request: KT-MR-8398
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-01-23 11:34:47 +00:00
Sergey Bogolepov 576e8ba127 [K/N] Port to the new driver 2023-01-23 09:11:33 +00:00
Mark Mann 47f6cb663e Native: add flag that disables ObjC method name mangling for methods in different Kotlin Interfaces (#5070) 2023-01-20 21:27:44 +01:00
Troels Bjerre Lund 7854b01473 [K/N] custom-alloc: handle finalizers
This commit adds finalizers to the custom allocator. Compared to the
existing solution:

* The finalizer queue is replaced by an AtomicStack<ExtraObjectData>.
* All objects with finalizers get meta objects attached. This was not
  previously the case for CleanerImpl, but is now needed to link objects
  together in the finalization queue.
* The finalizer queue is built during SweepExtraObjects, instead of
  during regular sweeping.
* Cleaners are executed by the finalizer thread, and no longer by a
  separate worker thread.

Co-authored-by: Troels Lund <troels@google.com>

Merge-request: KOTLIN-MR-592
Merged-by: Alexander Shabalin <alexander.shabalin@jetbrains.com>
2023-01-20 16:47:06 +00:00
Sergey Bogolepov c22285f824 [IR] Remove unused Ir.irModule property
It is required for the Native backend refactoring
where `Context` does not contain a reference for any
particular IrModuleFragment.
2023-01-20 13:33:06 +00:00
Sergey Bogolepov 3355f04fa1 [IR] Drop all usages of Ir.irModule 2023-01-20 13:33:06 +00:00
Sergej Jaskiewicz 1f76d39e66 [IR] Make IrTypeArgument a sealed interface 2023-01-20 10:58:28 +00:00
Pavel Kunyavskiy 0560b2b068 [K/N] Don't generate initializer function when it is empty 2023-01-19 16:41:47 +00:00
Nikita Bobko 887547c445 Drop MetadataComparisonTest & drop build-tools -> util-klib dependency
Review: https://jetbrains.team/p/kt/reviews/8360

MetadataComparisonTest was the only one in build-tools module who
depended on util-klib, that's why we can drop build-tools -> util-klib
dependency

MetadataComparisonTest is no longer needed, that's why we can drop it.

The dependency drop is a one step forward in dropping
`kotlin.srcDir("../compiler/util-klib/src")` line in
`buildSrc/build.gradle.kts`. Adding source roots in `buildSrc` is hacky
and can lead to frustrations (e.g. KT-55874). That's why it's desirable
to drop buildSrc -> util-klib hacky dependency.

Unfortunatelly, I couldn't drop buildSrc -> util-klib dependency,
because:
1. buildSrc depends on kotlin-native/shared/src/library/kotlin +
   buildSrc depends on kotlin-native/tools/kotlin-native-gradle-plugin +
   maybe smth else
2. kotlin-native/shared/src/library/kotlin depends on util-klib +
   kotlin-native/tools/kotlin-native-gradle-plugin depends on util-klib +
   maybe smth else
2023-01-19 12:55:56 +00:00
Alexander Shabalin 9a2cb2609f [K/N] Extract LlvmLink out of CompileToBitcode ^KT-53776
Merge-request: KT-MR-8120
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2023-01-18 21:41:17 +00:00
Sergey Bogolepov 8e37a07af2 [K/N] Show warning when compiling for a deprecated target 2023-01-18 16:17:13 +00:00
Pavel Kunyavskiy 2843c0ad1e [K/N] Fix cleaning stack-local primitive array
^KT-55984
2023-01-18 11:52:43 +00:00
Pavel Kunyavskiy fbc39fcab1 [K/N] Make a reproducer test for KT-55938
^KT-55938
2023-01-18 08:29:51 +01:00
Mads Ager e5417e8381 [K/N] Deal with external ObjC companion objects in cache builds.
^KT-55938 Fixed
2023-01-18 08:29:51 +01:00
Sergej Jaskiewicz 150b8061e9 [K/N] Fix FunctionReferenceLowering for bound refs to generic functions
4a2a77d9b9 introduced a regression
where for bound references to functions generic over their receiver
the generated class was also generic even if the function reference
itself only contained concrete types. This is fixed here.
2023-01-17 18:41:08 +00:00
Sergey Bogolepov 9bffec268a [K/N] Add a trivial test-case for KT-40426 2023-01-17 17:54:28 +00:00
Sergey Bogolepov d0778d78b5 [K/N] Fix KT-40426 2023-01-17 17:54:27 +00:00
Mikhail Glukhikh 7a61578e08 Language version 2.0: fix compiler messages and minor details 2023-01-16 18:16:48 +01:00
Mikhail Glukhikh 52ab565cc6 Move LANGUAGE_TO_METADATA_VERSION to compiler:frontend.common.jvm 2023-01-16 18:14:52 +01:00
Sergey Bogolepov 8120025076 [K/N] Add a test for KT-55653 2023-01-16 13:26:09 +00:00
Sergey Bogolepov c3a250e57a [K/N] Fix KT-55653 2023-01-16 13:26:09 +00:00
Sergey Bogolepov 3ade4fbedc [K/N] Add backend.native test for objcClassesIncludingCategories 2023-01-16 13:26:08 +00:00
Sergey Bogolepov 72637f19dc [K/N][cinterop] Generate members of included categories as class members
This way inheritors of such class would be able to override category
members the same way they can in Objective-C. Also, API surface of
interop libraries should become a little more stable.
2023-01-16 13:26:07 +00:00
Sergey Bogolepov 898dd02d29 [K/N][cinterop] Indexer unit-tests of objcClassesIncludingCategories 2023-01-16 13:26:07 +00:00
Sergey Bogolepov eded880225 [K/N][cinterop] Add location to ObjCCategory
To avoid adding unnecessary included categories to index, we need
to track their location. Also, we can't just implement TypeDeclaration
interface because category is not a type. Thus, we extract `location`
property from TypeDeclaration to LocatableDeclaration and implement it
in ObjCCategory.
2023-01-16 13:26:06 +00:00
Sergey Bogolepov fe8e18cb33 [K/N][cinterop] Improve Imports interface
Extracting `isImported(headerId: HeaderId): Boolean` method allows
mocking this interface in tests
2023-01-16 13:26:06 +00:00
Sergey Bogolepov 2f0bdfc5e2 [K/N] Add objcClassesIncludingCategories cinterop property
It allows to list Objective-C classes that should include
corresponding categories from the same file.
The current implementation is super-simple and slow, but
it is OK since it is not intended to be a general-purpose
solution for now.
2023-01-16 13:26:05 +00:00
Pavel Kunyavskiy 6ab00a65dd [K/N] Support volatile intrinsics on globals
Also, make intrinsics signature more consistent with other intrinsics,
e.g. with isInitialized on lateinit field.

^KT-54944
2023-01-16 08:34:24 +00:00
Pavel Kunyavskiy 49d286e4e8 [K/N] Wrap volatile boolean to byte
^KT-54944
2023-01-16 08:34:23 +00:00
Pavel Kunyavskiy a11f6fd9cb [K/N] Support of aligned fields
For now only alignment by at most 8 is supported for instance fields.

^KT-54944
2023-01-16 08:34:21 +00:00
Pavel Kunyavskiy 6da66649e7 [K/N] Hack for make 64-bit atomics working on mips
^KT-54944
2023-01-16 08:34:21 +00:00
Pavel Kunyavskiy 9dea349752 [K/N] Support of @Volatile annotation
^KT-54944
2023-01-16 08:34:20 +00:00
Svyatoslav Scherbina 623e7317bb K2: fix signature computation for Objective-C constructors 2023-01-14 10:12:31 +00:00
Svyatoslav Scherbina 676d65e71c K2: fix fake override IR serialization for subclasses of Obj-C classes 2023-01-14 10:12:31 +00:00
Artem Daugel-Dauge 0d1e7e83b5 [K/N, CLI] Pass through errors from Gradle to Xcode
^KT-55650

Merge-request: KT-MR-8245
Merged-by: Artem Daugel-Dauge <Artem.Daugel-Dauge@jetbrains.com>
2023-01-13 20:54:05 +00:00
Pavel Kunyavskiy 5674722742 [K/N] Fix crash on exporting cached suspend function
^KT-55736
2023-01-13 16:28:53 +00:00
Aleksei.Glushko 20e80401b2 [K/N] Hide throwable constructor frames from stack traces.
Merge-request: KT-MR-8242
Merged-by: Alexey Glushko <aleksei.glushko@jetbrains.com>
2023-01-13 14:14:40 +00:00
Mikhail Glukhikh ecc81098a6 Unbind FIR mangler from use-site session (by Simon Ogorodnik) 2023-01-13 12:56:01 +00:00
Mikhail Glukhikh 890e3d1c10 FIR2IR/MPP: use single SymbolTable during MPP compilation 2023-01-13 12:56:00 +00:00
Ivan Kochurkin f17e1314f6 [FIR2IR] Implement tables merging in Fir2Ir classes and SymbolTable
- Pass dependent (usually common code) components to further FIR2IR converters
- Don't reinitialize builtin
2023-01-13 12:55:57 +00:00
Ivan Kochurkin 5d273ce839 [FIR & FIR2IR] Prepare test and CLI infrastructure to support MPP
- Move out getAnalyzerServices from FirFrontendFacade to TestSetupUtils
- Simplify DependencyListForCliModule. Now it takes BinaryModuleData as input
- FirOutArtifact contains several FirOutputArtifactPart
- Simplify FirFrontendFacade
2023-01-13 12:55:57 +00:00
Vladimir Sukharev c0961e91b8 [K2/N] KT-55598: Run special backend checks in K2/Native pipeline
Merge-request: KT-MR-8204
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-01-13 09:57:11 +00:00
Mads Ager 6b01886334 [K/N] Avoid string copying when setting up bridge debug info.
The name of the function was copied at least 4 times. This reduces
a 56 seconds codegen phase in a non-optimized build by 2 seconds.
2023-01-13 09:28:31 +00:00
Vladimir Sukharev 45de88abae [K/N][KT-39120] Build platform libraries with -fmodules
Merge-request: KT-MR-8175
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-01-13 07:33:42 +00:00
Igor Chevdar df778b8a6e [K/N] Pass transitive dependencies for forked caching compilation 2023-01-12 19:59:37 +00:00