Commit Graph

85458 Commits

Author SHA1 Message Date
Ilya Goncharov ecefda58fb [JS IR] Add separate key to enable extensions in external interfaces 2021-09-01 13:47:12 +00:00
Svyatoslav Scherbina 751914ca4d [Gradle, Native] Make useEmbeddableCompilerJar input of compile tasks
to make the tasks not up-to-date when switching the flag
2021-09-01 13:43:29 +00:00
Svyatoslav Scherbina e65f2e465e [Gradle] Fix switching in-process to Native embeddable compiler jar
Compiler runner used incorrect cache key for isolated classloader:
it didn't take the actually used compiler jar into account,
only the K/N home dir.

Fix this by using the entire classpath as a key.
2021-09-01 13:43:28 +00:00
Svyatoslav Scherbina 1c052ad448 [Gradle, Native] When running tool in-process, log the actual classpath
When running tool in-process, log the actual classpath extracted from
the classloader, not the one that was intended.
This helps to detect the cases when these two don't match.
2021-09-01 13:43:28 +00:00
Svyatoslav Scherbina 71af22dba0 [Gradle] Support Native embeddable compiler jar in subplugins
Apply generic (backend-agnostic) compiler plugin artifact instead of
Native-specific one when Native embeddable compiler jar is used
(with `kotlin.native.useEmbeddableCompilerJar=true` project property).
2021-09-01 13:43:28 +00:00
Svyatoslav Scherbina 0b4dfd58fc [Gradle] Don't apply scripting gradle subplugin to Native compilations
It doesn't support Native anyway, but applying it blocks using
the generic compiler plugin artifact for Native.
2021-09-01 13:43:27 +00:00
Svyatoslav Scherbina 7c52077e40 [Gradle] Rename kotlin.native.[shaded -> useEmbeddableCompilerJar]
Also move it to PropertiesProvider.
2021-09-01 13:43:27 +00:00
Svyatoslav Scherbina f049c4a630 [Gradle, Native, IT] Allow checking compiler classpath 2021-09-01 13:43:26 +00:00
Svyatoslav Scherbina 0fd4884149 [Gradle] Partially revert "enable to work with embedded k/n compiler"
This partially reverts commit 2baf344f5f,
removing support for K/N embeddable compiler jar from subplugins.
More migration-friendly implementation is to be added instead.
2021-09-01 13:43:26 +00:00
Dmitriy Novozhilov e766339c81 Add config for compiler test helper plugin
This config stores list of directories with testdata, so test plugin
  helper will work for .kt files in them
2021-09-01 16:14:22 +03:00
sebastian.sellmair 0553f0f8de Bump Kotlin/Native version to 1.6.20-dev-320
Bump done to anticipate new 'kotlinx.cinterop.UnsafeNumber' annotation
2021-09-01 12:40:30 +00:00
Alexander Udalov 473ed2e410 Fix JVM target and language version info in CLI and Gradle 2021-09-01 14:32:53 +02:00
Leonid Startsev 1932546a90 Support instantiation of annotations in JS
#KT-47700 Fixed
2021-09-01 11:13:55 +00:00
Hung Nguyen a342c81a9f KT-45777: Take snapshots and compute changes for Java classes
Create `JavaClassDescriptor`s for Java classes
Ignore anonymous and synthetic classes
as they can't impact recompilation.
Clean up handling of local and anonymous classes

Bug: KT-45777
Test: New JavaClassDescriptorCreatorTest
2021-09-01 13:29:17 +03:00
Pavel Kunyavskiy 98e4d67900 [K/N] Add opt-in flag to use debug info from native libs
Unfortunately, llvm removes full debug info from module on any error.
Different version debug info in bitcode is not always compatible, also
it adds this debug info additional requirements on generated debug info.

So this feature is quite unstable and shouldn't be enabled by default,
although it has almost no downsides when worked correctly.
2021-09-01 08:35:21 +00:00
Pavel Kunyavskiy 18f1610442 [K/N] Enable debug info in runtime build 2021-09-01 08:35:20 +00:00
Pavel Kunyavskiy 9f6df5f54b [K/N] Disable debug info for old-style global initializers 2021-09-01 08:35:20 +00:00
Pavel Kunyavskiy 5529713ebe [K/N] Fix debug info in lazy initializers 2021-09-01 08:35:20 +00:00
Pavel Kunyavskiy 7f988bd442 [K/N] Refactor function generation to make it more debug-info friendly 2021-09-01 08:35:19 +00:00
Dmitriy Dolovov b506704a2b [Native][tests] Fix failing 'runtime_basic_init' test
This test should have it's own test data file.

Previously it used 'hello3.kt' test data file shared with 'hello3' test which uses golden data. This caused a conflict.
2021-09-01 10:14:17 +03:00
Dmitriy Dolovov ab5314059d [Native][tests] Fix conditions for @InputFile properties 2021-09-01 10:14:12 +03:00
Dmitriy Dolovov bf82db5ee2 [Native][tests] Move input data outside of Gradle build file 2021-09-01 10:14:06 +03:00
Dmitriy Dolovov 1a863106e6 [Native][tests] Move golden data outside of Gradle build file 2021-09-01 10:14:01 +03:00
Dmitriy Dolovov c2e2d3a43e [Native][tests] workers5 - remove redundant test annotations 2021-09-01 10:13:55 +03:00
Dmitriy Dolovov 51f30ed995 [Native][tests] localDelegatedPropertyLink - don't use golden data 2021-09-01 10:13:50 +03:00
Dmitriy Novozhilov f85c137360 [FIR] Don't fail on serialization of annotations which are not lays on classpath 2021-09-01 10:01:37 +03:00
Alexander Shabalin ed0b65e19c [K/N] A bit more on the new MM 2021-09-01 06:54:09 +00:00
Ivan Gavrilovic f0f5e11e72 MPP Gradle - Stop using convention mapping for archive name (#4529)
The "archiveFile" property is deprecated on the jar task, and
archiveFileName is used in this commit. Also, this fixes an
issue in Gradle where convention mapping is incorrectly
deserialized from configuraiton cache.

Original issue: https://issuetracker.google.com/193558867
Test: testJvmWithJavaConfigurationCache
2021-09-01 09:01:52 +03:00
Leonid Startsev 3102e9f614 Support properties from other modules in 'declaresDefaultValue'
Add box test using new test infra
Move serialization tests to misc compiler tests

Fixes https://github.com/Kotlin/kotlinx.serialization/issues/1602
Fixes https://github.com/Kotlin/kotlinx.serialization/issues/1481
2021-08-31 20:36:25 +00:00
Alexander Udalov ffe0d9de70 Psi2ir: do not sort descriptors for fake override generation
Descriptors are already supposed to be sorted in scopes. The problem is
that rendering descriptors for sorting takes a lot of time (~1.5% of
total compilation time of intellij with JVM IR), and simple heuristics,
like comparing by names first, don't fully help with it.

 #KT-48233
2021-08-31 20:25:59 +02:00
Alexander Udalov cc52832943 JVM IR: fix incorrect type of IrCheckNotNull intrinsic
It is not correct to assume that arg0 has been generated to have the
same IrType as the whole expression.

The reason it only backfired in throwing exceptions probably has to do
with the fact that visitThrow might be the only place in
ExpressionCodegen right now which uses the IrType from PromisedValue to
make a decision on whether to generate checkcast.

It seems suspicious that ExpressionCodegen.visitFieldAccess/visitCall
return PromisedValue whose IrType mentions type parameters which are
declared outside of the call site, but that should probably be
investigated separately.

 #KT-48440 Fixed
2021-08-31 18:45:23 +02:00
Svyatoslav Scherbina 1d5501c047 kotlin-native/NEW_MM.md: add known issue 2021-08-31 15:57:01 +00:00
Mikhail Glukhikh c175039afb Add test for JVM_RECORD_NOT_LAST_VARARG_PARAMETER 2021-08-31 18:28:59 +03:00
Mikhail Glukhikh 881b15a677 FIR: use typeWithStarProjections for protected visibility check 2021-08-31 17:32:02 +03:00
Mikhail Glukhikh a14a00809f FIR: use lookup tag instead of class id in visibility checker 2021-08-31 17:31:59 +03:00
Mikhail Glukhikh 08e498f1f2 FIR: add proper receiver check for protected visibility #KT-48378 Fixed 2021-08-31 17:31:57 +03:00
Dmitry Petrov 1c1b9547c1 JVM_IR KT-48435 use Java-like counter loop when possible 2021-08-31 16:39:25 +03:00
Sergey Bogolepov d4c91c96d3 [K/N] Fix objc_acr_contract test in two_stage mode 2021-08-31 12:52:42 +00:00
Denis.Zharkov c23de2dae8 FIR: Unignore test on StrictJavaNullabilityAssertions
^KT-48302 Fixed
2021-08-31 15:41:18 +03:00
Denis.Zharkov 4a9d4ed9fe Enable ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated since 1.7
^KT-36770 Fixed
2021-08-31 15:41:17 +03:00
Denis.Zharkov d91155558b Rename LF: DefinitelyNotNullTypeParameters -> DefinitelyNonNullableTypes 2021-08-31 15:41:17 +03:00
Denis.Zharkov 0e7d51b04d Prohibit using definitely-non-nullable types as arguments for reified parameters
^KT-26245 In Progress
2021-08-31 15:41:16 +03:00
Denis.Zharkov 62bef48f9d Adjust test data to changed rendering: T!! -> T & Any
^KT-26245 In Progress
2021-08-31 15:41:15 +03:00
Denis.Zharkov dc79d8641b Change rendering for definitely non-nullable types from T!! to T & Any
^KT-26245 In Progress
2021-08-31 15:41:14 +03:00
Denis.Zharkov 9e6af52e1f Enable DefinitelyNotNullTypeParameters since 1.7
^KT-26245 In Progress
2021-08-31 15:41:13 +03:00
Denis.Zharkov c1b5d5551f Drop support for T!! syntactic structure
^KT-26245 In Progress
2021-08-31 15:41:13 +03:00
Denis.Zharkov 302eacbf59 Support new form of definitely non-nullable types: T & Any
^KT-26245 In Progress
2021-08-31 15:41:11 +03:00
Denis.Zharkov cdd8d1c163 Add AND (&) token 2021-08-31 15:41:09 +03:00
Alexander Shabalin f265cd49ea [K/N] Feedback section for the new MM migration guide 2021-08-31 12:30:54 +00:00
Alexander Udalov 04c5bbdcf8 JVM IR: change generation scheme of property $delegate methods
Generate $delegate method as instance method in
PropertyReferenceDelegationLowering, and remove dispatch receiver later
in MakePropertyDelegateMethodsStatic. The method needs to be static to
be non-overridable (see delegateMethodIsNonOverridable.kt), and public
to be accessible in reflection.

Otherwise we generated incorrect IR where a static function accessed an
instance field of the containing class, which failed in multiple places
including LocalDeclarationsLowering.

 #KT-48350 Fixed
2021-08-31 14:07:22 +02:00