Commit Graph

94886 Commits

Author SHA1 Message Date
Sergey Bogolepov 5c1641430c [K/N] Bump Xcode version in README.md 2022-09-17 07:51:34 +03:00
Sergey Bogolepov 183686659e [K/N] Bump Xcode SDK versions 2022-09-17 07:51:34 +03:00
Sergey Bogolepov 8bf7a17508 [K/N] Update Xcode version to 14-RC 2022-09-17 07:51:34 +03:00
Sergey Bogolepov 95e83d064d [K/N] Bump Xcode major version to 14 2022-09-17 07:51:34 +03:00
Abduqodiri Qurbonzoda dce62275c6 Fix daemon-common-new compile 2022-09-17 01:06:56 +00:00
Abduqodiri Qurbonzoda f2b0c30cba Remove Experimental and UseExperimental from compiler OptIn usage checkers 2022-09-17 01:06:56 +00:00
Alexander Likhachev bc684b8d36 [Gradle] Add missing kotlin-multiplatform tasks descriptions
#KT-31573 Fixed
2022-09-16 23:33:35 +02:00
Mads Ager b7a7fce34e Add suspend lambda annotations to invokeSuspend.
For non-suspend lambdas annotations are carried over to the
invoke method so that tooling can find the annotation there.
It seems reasonable that annotations are carried over to
the invokeSuspend method on suspend lambdas as well so that
similar tooling can be built and work for suspend lambdas.
2022-09-16 23:21:18 +02:00
Simon Ogorodnik 8bdb8ba232 K2: Fix type-alias expansion during suspend function type serialization
When suspend function type is serialized, there is special logic that
adds Continuation parameter, before doing so, type-aliases has to be
expanded, attributes for resulting type should also derive from
expanded type

KT-53193, KT-54062
2022-09-16 20:42:03 +00:00
Sergey Bogolepov 3f406044a6 [K/N] Tests for DefFile.excludeFilter property 2022-09-16 19:22:38 +00:00
Sergey Bogolepov b4b27e9bc6 [K/N] KT-54001
Add a new DefFile.excludeFilter property that excludes headers
from interop library by given glob.

This change is required to properly support platform libs from Xcode 14
without breaking ABI.
2022-09-16 19:22:38 +00:00
Alexander Likhachev 6bc9c43952 [Gradle] Cover SingleAction hierarchy by KDoc 2022-09-16 17:15:35 +00:00
Alexander Likhachev 3d45bcf08d [Gradle] Cover KT-50598 by tests 2022-09-16 17:15:35 +00:00
Alexander Likhachev a20fbf867f [Gradle] Recreate KotlinPluginInMultipleProjectsHolder on each build
#KT-50598 Fixed
2022-09-16 17:15:34 +00:00
Johan Bay 4b92d2e76c Add OnSuspendForGC hook to GCImpl::ThreadData
Co-authored-by: Johan Bay <jobay@google.com>

Merge-request: KOTLIN-MR-506
Merged-by: Alexander Shabalin <alexander.shabalin@jetbrains.com>
2022-09-16 14:43:54 +00:00
Leonid Startsev c8647841dc Added documentation for MagicApiIntrinsics.voidMagicApiCall
Remove mavenLocal() from repos
2022-09-16 14:34:30 +00:00
Leonid Startsev 69c00785f2 Support plugin-defined instrinsics that can be non-typeOf operation types. 2022-09-16 14:34:30 +00:00
Leonid Startsev 033538161e Determine more precise conditions when to enable serialization intrinsic
Disable it if we do not have required `noCompiledSerializer` function in
runtime. Leave it enabled in tests.

Rollback some changes for old backend as it is unsupported now.
2022-09-16 14:34:30 +00:00
Leonid Startsev 637e8c7d8a Provide feature-flag to disable intrinsics in serialization plugin 2022-09-16 14:34:29 +00:00
Leonid Startsev ad2adadb36 Remove OperationType.PLUGIN_DEFINED type:
instead, plugins should emit the code similar to the TYPE_OF one with
a special call to MagicApiIntrinsics.voidMagicApiCall directly afterwards.

This is required because old compiler need to correctly inline code
rewritten by plugin.
2022-09-16 14:34:29 +00:00
Leonid Startsev 763303fe97 Refactor extensions for plugin intrinsics entry points
so platform-specific parts won't have unsafe downcasts.
2022-09-16 14:34:29 +00:00
Leonid Startsev eae588abea Improve line numbers handling in serialization intrinsic
Fix nullable serializers on top-level & method with incorrect receiver

Improve handling of different runtime versions
2022-09-16 14:34:29 +00:00
Leonid Startsev aac9a06474 Also support intrinsification for SerializersModule.serializer<T>()
method that fallbacks to module.getContextual().
2022-09-16 14:34:28 +00:00
Leonid Startsev a59f5f407b Introduce support for plugin-defined intrinsics in JVM IR backend:
Add intrinsic for kotlinx.serialization.serializer<T>() function.

Plugin intrinsic for old backend is removed because it is too hard
and unjustifiable to unify them.
2022-09-16 14:34:28 +00:00
Leonid Startsev f9edbd825a Introduce support for plugin-defined intrinsics in old JVM backend:
(Old is created first because all intrinsics emit bytecode anyway)

Provide intrinsic for serializer<T>() function so it won't
invoke typeOf() construction and KType->KSerializer conversion
making it fast and truly reflectionless

Add support for recalculating stack size in plugin-defined intrinsics
since it is needed for correct work:
Unify method for recalculating stack size with existing typeOf intrinsic

Add testdata for IR for future intrinsic in IR
2022-09-16 14:34:28 +00:00
Igor Yakovlev 842f94443a [WASM] Kotlin gradle plugin support Apple ARM for binaryen and D8 extensions 2022-09-16 14:22:55 +00:00
Sergey Bogolepov a88ef04671 [K/N] Turn back red code.
For some reason build is failing during publication
with the previous change. Will deal with it later.
2022-09-16 13:25:41 +00:00
Sergey Bogolepov 6de5671db8 Revert "Revert "[K/N] Convert StubGenerator build script to Kotlin""
This reverts commit b53d6d0d7e.
2022-09-16 13:25:41 +00:00
Mads Ager 9e6a01081c Remove one more dependency on android extensions project in integration tests. 2022-09-16 15:03:01 +02:00
Mads Ager b2dc2ed0be Update android projects used in AGP integration tests. 2022-09-16 15:03:01 +02:00
Mads Ager 294395f4cc Rebase bytecode text expectations for parcel part of android-extensions. 2022-09-16 15:03:01 +02:00
Mads Ager 2d720a09c3 Add layout lib system properties so that parcel tests run.
This is for the parcel part of deprecated android extensions.
So this will be removed soon, but it is still there and the
tests should run.
2022-09-16 15:03:01 +02:00
Mads Ager ff84c19eff Make kotlin-android-extensions always cause a compilation error.
kotlin-android-extensions are deprecated and have been scheduled
for removal in 1.8.0.

https://android-developers.googleblog.com/2022/02/discontinuing-kotlin-synthetics-for-views.html
2022-09-16 15:03:01 +02:00
Pavel Kunyavskiy 7293dd6d65 [K/N] Require small binaries for all watchos targets 2022-09-16 12:24:11 +00:00
Alexander Korepanov 46afb46a6d [JS IR] Add IC test for local inline function
^KT-50739
2022-09-16 12:14:35 +02:00
Ilya Goncharov bf8681296b [Gradle, JS] IR by default and report warnings for using legacy compiler
- just legacy - report warning about deprecation
- both - report warning about deprecation of legacy
- no compiler explicitly chosen - error about explicit setting compiler

warn from cli legacy compiler

nowarn flag - kotlin.js.compiler.nowarn

KT-42326
KT-53074
2022-09-16 09:48:41 +00:00
Nikolay Krasko b53d6d0d7e Revert "[K/N] Convert StubGenerator build script to Kotlin"
This reverts commit ddc2eb79c3.
2022-09-16 11:25:18 +02:00
pyos ecdd80769e FIR: do not read a Java nested class if the outer class is Kotlin
Example: if C is a Kotlin class and there is an import of C.Companion.f,
a call to f will need to check if it is a constructor, for which
it will attempt to load C.Companion.f as a Java class. This involves
loading all outer classes, including C itself, as BinaryJavaClass - see
KotlinCliJavaFileManagerImpl - despite the fact that C and C.Companion
have both already been loaded from their Metadata annotations as Kotlin
classes, wasting cycles and polluting caches.

Thus the theoretical motivation for this change is to marginally speed
up FIR.

The real motivation is that with the -Xemit-jvm-type-annotations option,
kotlinc sometimes generates invalid annotations, and reading them with
BinaryJavaClass throws an exception (the Kotlin metadata however is
valid):

    // MODULE: lib
    // FILE: C.kt
    // The constructor has an argument of type
    //   List<? extends Function1<? super String, Integer>>
    // and a ParameterName type annotation with path
    //   TYPE_ARGUMENT(0), TYPE_ARGUMENT(0)
    // which is missing a WILDCARD between the two TYPE_ARGUMENTs
    class C(val x: List<(name: String) -> Int>) {
      companion object {
        fun foo() {}
      }
    }
    // MODULE: main(lib)
    // FILE: main.kt
    import C.Companion.f

    fun bar() = foo() // crashes FIR

The parameter annotation should obviously be fixed too, but invalid
bytecode may already exist in the wild. Also, did I mention that this
change marginally speeds up FIR?
2022-09-16 08:44:15 +00:00
Yahor Berdnikau 928e0e7fb8 Set default stdlib dependency to kotlin-stdlib-jdk8
^KT-53830 Fixed
2022-09-16 07:42:15 +00:00
Alexander Korepanov 47bbd5e8c1 [JS IR] Add work around in EnumEntriesList for JS IR to avoid name clashes
JS IR generates bridges with type checks for special class methods,
 however if parent and child type parameters are same,
 the JS signature for the generated brige will be clashed with
 the JS signature of original method.

 This patch changes type parameter name of EnumEntriesList to avoid the clash.

^KT-54011 Fixed
2022-09-16 07:19:20 +00:00
Alexander Korepanov 639af77b91 [JS IR] Invalidate IC cache after modifying language settings
^KT-54010 Fixed
2022-09-16 07:19:20 +00:00
Alexander Korepanov dd7d669464 [JS IR] Use jsOutputName for module naming when IC is enabled
^KT-53986 Fixed
2022-09-16 07:19:20 +00:00
Alexander Korepanov ef05a0d9ed [JS IR] Disable JS IR IC infrastructure when WASM is enabled 2022-09-16 07:19:19 +00:00
Alexander Korepanov 1003e4f1e1 [JS IR] Remove unused function 2022-09-16 07:19:19 +00:00
Alexander Korepanov e38f1494fc [JS IR] Enable JS IR IC by default
^KT-53112 Fixed
2022-09-16 07:19:19 +00:00
Mikhail Glukhikh a70c4f15d6 K2: make not implemented checker more close to K1 logic
#KT-54049 Fixed
2022-09-16 07:15:43 +00:00
Mikhail Glukhikh fe38089205 FE: add test reproducing KT-54049 2022-09-16 07:15:43 +00:00
Mikhail Glukhikh b86722c523 FE: delay ForbidSuperDelegationToAbstractFakeOverride to 1.9
Related to KT-53953, KT-49017
2022-09-16 07:15:43 +00:00
Mikhail Glukhikh c4a48927d2 K1: report ABSTRACT_SUPER_CALL(_WARNING) also for 2+ steps to intersection
#KT-53953 Fixed
2022-09-16 07:15:43 +00:00
Mikhail Glukhikh 3e5d5bcaa7 FE: add test reproducing KT-53953 2022-09-16 07:15:42 +00:00