Commit Graph

87184 Commits

Author SHA1 Message Date
Aleksei.Cherepanov 47a1dd27dd Fix after review KT-CR-4441 of cc5382b3
Simplify API of InlineConstTracker
In ConstLowering: Move transformer logic to another class to avoid mutable state. Avoid marking all files in module as module. Support of inner classes.

#KT-46506 Fixed
2021-09-22 01:55:18 +03:00
Alexander Dudinsky c2715d26f1 Fix `NewMultiplatformIT' tests 2021-09-22 00:56:40 +03:00
Ilmir Usmanov 11ba620647 Minor. Add tests with arrays in annotations 2021-09-21 21:07:22 +00:00
Ilmir Usmanov e74e267d16 Inline classes. Use inline class instead of underlying type
in annotations if underlying type is not nullable reference type.
Previously, it worked only for inline classes with primitive
underlying type and nullable reference type.

 #KT-44133
2021-09-21 21:07:22 +00:00
Pavel Kunyavskiy 80fbc262b3 [K/N] Fix libbacktrace compiler options 2021-09-21 20:10:32 +00:00
Georgy Bronnikov 64e2911b58 JVM_IR: special case for raw types in DescriptorMangleComputer 2021-09-21 21:16:02 +03:00
Kristoffer Andersen 247cbffbac [EE-IR] Fragment Compiler Entrypoint in IR Backend
This commit introduces a new entrypoint for the IR backend, and starts
the work of accomodating the evaluator in psi2ir.

The evaluator expects a certain class and method structure of the
compiled fragment, but PSI is only supplied for the actual fragment.

So, to that end, this commit introduces a new "front end" of psi2ir
that "synthesizes" the module, class and method structure around the
fragment before calling into the existing psi2ir pipeline to obtain
the IR for the fragment.

The primary complication so far is handling the captured variables of
the fragment: they are mapped to parameters of the method surrounding
the fragment, and passed as arguments on evaluation. Hence, the IR
translation of the fragment needs to remap captured variables to the
appropriate parameter, in essentially all places they can be referred
to in the fragment (and hence in psi2ir). This commit introduces a
decorated symbol table that intercepts symbol look-ups and remaps as
appropriate.

Other cases that dispatches based on descriptor (see
`CallGenerator.kt`) needs other metadata to generate correct code.

It also introduces a shim in DeserializedContainerSource in the psi2ir
pipeline to facilitate facade class generation for the code that is
being debugged (which are generated as "external ir declarations").

Finally, in passing we resolve a small leftover from previous
refactoring that left an asssertion re. allowing IR to _assign_ to
parameters of methods.
2021-09-21 18:18:30 +02:00
pyos 783c3d1500 JVM_IR: resolve fake overrides of inline delegated property operators
before checking whether they use the KProperty parameter. (Otherwise the
body is empty and the check always says that the parameter is unused.)

^KT-48825 Fixed
2021-09-21 18:08:22 +02:00
pyos e9d5d9da48 JVM_IR: optimize property accesses in inline lambdas and private funs 2021-09-21 16:41:30 +02:00
Steven Schäfer fc013c6b9f Parcelize: Add an intrinsic to access Parcelable CREATOR fields
Fixes KT-19853.

The CREATOR field is a static field on a Parcelable class which is not
visible from Kotlin since the necessary metadata would have to be in a
Companion object which may not exist.

This commit adds a [parcelableCreator] function to kotlinx.parcelize,
which is optimized to a direct field access whenever possible.
2021-09-21 15:09:39 +02:00
Steven Schäfer 897c09bf8d Parcelize: Use the class loader of the Parcelable class for reading
In `readBundle`, `readPersistableBundle`, and `readValue`.
2021-09-21 15:09:04 +02:00
Abduqodiri Qurbonzoda 08eaac7e56 Revert "Restore default parameter values in JS collection constructors"
This reverts commit 0f972f24
2021-09-21 12:11:25 +00:00
Abduqodiri Qurbonzoda 261d0c2783 Promote collection builders to stable #KT-47421 2021-09-21 11:25:28 +00:00
Mikhael Bogdanov 72ab6d5e7e Add test for obsolete (fixed in IR) KT-42967
#KT-42967 Fixed
2021-09-21 12:41:07 +02:00
Ilya Matveev f93d5604aa [K/N] Warn if the inferred main package of a framework is root 2021-09-21 09:26:54 +00:00
Ilya Matveev bfe336b0db [K/N] Add an option to specify a bundle ID of a produced framework 2021-09-21 09:26:54 +00:00
Ilya Matveev 0dd41eea19 [K/N] Add test for framework's bundle ID 2021-09-21 09:26:52 +00:00
Ilya Matveev 88d8d5199b [K/N] Allow looking for klib dependencies among included libraries 2021-09-21 09:26:51 +00:00
Ilya Matveev 8b52411292 [K/N] Allow running compiler with exported libs and without sources 2021-09-21 09:26:51 +00:00
Andrey Uskov 4ad828f80f [JPS] Improved processing of broken caches
If serialized metadata version has evidently incorrect size the module
should be marked for rebuild prior to reading serialized version.

#KT-42194 Fixed
2021-09-21 10:41:12 +03:00
Dmitry Gridin 5d56bd545e [light classes] methods: fix PluginException: Incorrect CachedValue use
^KTIJ-6085 Fixed
2021-09-21 02:42:41 +00:00
Nikolay Krasko 495cd2db94 Add security policy file
KTI-630
2021-09-21 03:49:47 +03:00
Roman Golyshev 1e91c66d19 [FIR IDE] Fix Always false condition in FirReferenceResolveHelper 2021-09-21 01:29:06 +03:00
Roman Golyshev 39116853d2 [FIR IDE] Implement pointers for JavaField and SyntheticJavaProperty symbols 2021-09-21 01:29:05 +03:00
Ilmir Usmanov b0088fd06d Minor. Ignore test on JS_IR 2021-09-20 21:29:58 +00:00
Ilmir Usmanov 91491eef06 Fixup end label of local variable if it is before start label
In that case, put end label to next label after start label.
2021-09-20 21:29:58 +00:00
pyos ade9f5a1e8 JVM: rename a couple ValueKinds to make their purpose clearer 2021-09-20 19:29:44 +02:00
pyos f786084a0a JVM_IR: mark direct uses of inline lambdas as conditionally suspend
They may or may not be inlined later.

IDK how the test passes when both modules are compiled with the old
backend - perhaps this has something to do with the fact that when `f`
is compiled with the IR backend, the call to `x()` is followed by `pop`
and `getstatic kotlin/Unit.INSTANCE`? This is probably why the original
issue in kotlinx.coroutines reports that everything works fine with
kotlinx-coroutines-core:1.4.3.

^KT-46879 Fixed
^KT-48801 Fixed
2021-09-20 19:29:44 +02:00
Igor Yakovlev 41a69ad388 [WASM] Add receiver capturing to callable references 2021-09-20 19:08:22 +03:00
Igor Yakovlev b8d11f7938 [WASM] Add text section to implement debug info 2021-09-20 19:08:21 +03:00
Dmitriy Novozhilov 8286927e8c [FIR] Support .jar output with -Xuse-fir flag
To proper support we need to fully implement main function detector,
  see KT-44557

^KT-42868 Fixed
2021-09-20 15:29:45 +03:00
Abduqodiri Qurbonzoda 9a5a3bfdfb Advance kotlin.browser and kotlin.dom packages deprecation level to ERROR #KT-39330 2021-09-20 12:28:07 +00:00
Abduqodiri Qurbonzoda 93833f7db2 Advance K/N StringBuilder.appendln() deprecation level to ERROR #KT-38754 2021-09-20 15:25:53 +03:00
Pavel Kunyavskiy c704fd6ae7 [K/N] Support stacktrace using libbacktrace 2021-09-20 11:28:08 +00:00
Pavel Kunyavskiy 4fa5be3e58 [K/N] Patch libbacktrace to support finding dsyms for framework 2021-09-20 11:28:08 +00:00
Pavel Kunyavskiy 8a6b997559 [K/N] Patch libbacktrace to work in ios simulator. 2021-09-20 11:28:07 +00:00
Pavel Kunyavskiy 45317ca221 [K/N] Patch libbacktrace for columns support 2021-09-20 11:28:07 +00:00
Pavel Kunyavskiy 91dd9dc9b0 [K/N] Add libbacktrace 2021-09-20 11:28:06 +00:00
Pavel Kunyavskiy a5f3b087a4 [K/N] Change getSourceInfo signature to allow returning several frames 2021-09-20 11:28:06 +00:00
Dmitriy Novozhilov 0923d39215 [Build] Setup useFirForLibraries flag 2021-09-20 14:18:18 +03:00
Roman Artemev 0bfc88fad0 [JS IC] Implement test infra for incremental caches 2021-09-20 12:23:36 +03:00
Roman Artemev c692b0b2e0 [JS IC] Make EPs for cache generation and test 2021-09-20 12:23:36 +03:00
Roman Artemev 7f424732bf [JS IC] Make API to store d.ts and sourceMap IC data 2021-09-20 12:23:35 +03:00
Roman Artemev f85a59b7f3 [JS IC] Write cache info in per-file mode too
- make sure that file is existed and not crashes the compiler
2021-09-20 12:23:35 +03:00
Roman Artemev a55be02007 [JS IC] Support binary ast in disk cache 2021-09-20 12:23:34 +03:00
Pavel Punegov 0b2a8c0c25 [K/N][Test] Ignore test with deprecated StringBuilder.deleteCharAt 2021-09-20 12:16:54 +03:00
Svyatoslav Scherbina b656d67bd4 [Gradle, Native, IT] Workaround NativeEmbeddableCompilerJarIT on Apple silicon
The tests fail on Apple silicon because Gradle plugin doesn't provide
run tasks for macosArm64 (KT-48649).

Workaround this by making the tests execute link task instead of run.
2021-09-20 08:36:25 +00:00
Alexander Dudinsky 064cffc89c Move mavenLocal() to the first place 2021-09-20 08:36:25 +00:00
Alexander Dudinsky 7db1b6fe01 Fix some tests in Gradle Integration Tests Native Mac Arm64 2021-09-20 08:36:25 +00:00
Alexander Dudinsky c4a9d7b74d Fix Gradle Integration Tests Native Mac x64 2021-09-20 08:36:24 +00:00