Commit Graph

95264 Commits

Author SHA1 Message Date
pyos a9ae1fcdf9 FIR CFG: handle loops and try/catch when analyzing smartcasts in lambdas
See KT-50092
2022-10-07 08:56:04 +00:00
pyos d054617b8e FIR CFG: handle reassignments with explicit receivers more precisely
When a looping control structure has a reassignment with an explicit
receiver, we don't need to erase its smartcast info as it has to be a
non-local property and is thus automatically unstable anyway. However,
we should still do that upon reaching the assignment itself for slightly
more precise error messages (as the property not just "could be"
reassigned, but *has been* reassigned already).
2022-10-07 08:56:03 +00:00
pyos 77c2601382 Add a test where a local variable has the same name as a property 2022-10-07 08:56:02 +00:00
Ilya Goncharov 03bea0dbaa [Gradle, JS] Disable test when difference between ABI 2022-10-07 08:46:50 +00:00
Evgeniy.Zhelenskiy b7f5c039a6 rra/zhelenskiy/flattening_impl
[IR] Remove unused MFVC getters

Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179

[IR] Add context receivers test, fix a flattening fields bug

Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179

[IR] Support `try` for MFVC

#KT-1179

[IR] Support `if` and `when` for MFVC, fix several bugs, refactor

#KT-1179

[IR] Rename MFVC tests + Add test for get-field optimization

#KT-1179

[IR] Suppress temporary test failing on Android

Bug is fixed in https://jetbrains.team/p/kt/reviews/6452

#KT-1179

[IR] Document the new MFVC lowering classes when necessary

#KT-1179

[IR] Correct work of the new MFVC lowering classes

#KT-1179

[IR] Prepare MFVC-lowering for the new MFVC classes

#KT-1179

[IR] Fix MFVC with type arguments/parameters

#KT-1179

[IR] Support MFVC with type parameters

#KT-1179

[IR] Integrate MFVC with Inline classes

#KT-1179

[IR] Fix compilation of MFVC in different module

#KT-1179

[IR] Add MFVC generation tests

#KT-1179

[IR] Implement equals call correct generation for MFVC

#KT-1179

[IR] Implement bridges generation for MFVC

#KT-1179

[IR] Implement MFVC basic flattening

#KT-1179

Merge-request: KT-MR-6213
Merged-by: Evgeniy Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>
2022-10-06 20:45:45 +00:00
Alexander Shabalin 5c9802ae84 [K/N] Optimize intrusive_forward_list usage in GCs ^KT-54163
* Add fallible push to intrusive_forward_list.
* Add fallible pop to intrusive_forward_list.
* Get rid of size_ member in intrusive_forward_list.
* Force all intrusive_forward_list items to have non-null next().
* Get rid of explicit colors in STMS and CMS.
* Do not queue weak reference for later processing in Mark.

Merge-request: KT-MR-7263
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-10-06 20:16:53 +00:00
Nikolay Krasko e7074e8a92 Fix flaky TARGET_JVM_VERSION_ATTRIBUTE presence in gradle plugins
For some reason TARGET_JVM_VERSION_ATTRIBUTE was not always set in the
resulting artifacts for runtimeElementsConfigurationName and
apiElementsConfigurationName variants

It could be reproduced locally with by executing
`gradle kotlin-allopen:publishToMavenLocal`

The fix can be checked via
`gradle kotlin-allopen:outgoingVariants`

^KTI-920 Fixed
2022-10-06 13:43:19 +00:00
Sergey Bogolepov d7fff3ca01 [K/N] Add -Xforce-compiler-driver=(static, dynamic) flag
Useful for development purposes when one wants to compare
the outputs of different drivers.
2022-10-06 13:10:50 +00:00
Sergey Bogolepov 6ef4277d89 [K/N] Introduce multiple compiler drivers
We want to move from current compilation pipeline
that is defined in TopLevelPhases.kt to a "dynamic" one.
The main drawback of the current one is that it is built
around single Context, single IR module, single compiler output, etc.
It is now as flexible as Kotlin/Native compiler requires.
For example, it is pretty hard to support multiple Apple frameworks
or a proper separate compilation.
To mitigate this problem, we are going to move to a new "dynamic"
compiler pipeline that relies on an explicit data passing between
different compiler phases. For example, it allows to use single phase
output as an input for multiple independent subsequent phases. Or
vice versa, e.g. use outputs of multiple "produce object file" phases by
a single linker phase.

This commit introduces `CompilerDriver` hierarchy which is required
during transition period.
2022-10-06 13:10:50 +00:00
Alexander Korepanov 89d3060e00 [JS IR] Drop unused JsRecordExtractedLocalClasses logic 2022-10-06 11:56:06 +00:00
Alexander Korepanov 86c72a5b9e [JS IR] Drop unused all export collecting logic 2022-10-06 11:56:06 +00:00
Steven Schäfer 93bf54266a FIR: Implement moduleDescriptor in Fir2IrPluginContext
A ModuleDescriptor is needed to create external package fragments with
descriptors (see JvmSymbols.kt). Descriptorless external package
fragments can fail in code using obsolete descriptor based APIs.
2022-10-06 10:37:28 +00:00
Pavel Punegov 6b97a7657d [K/N] Publish bundles to maven
Makes build be able to publish bundles to the maven. It uses common
properties and settings as all other Kotlin publications.
Add usage of the Gradle base plugin and correct version and name setting
for archive tasks
2022-10-06 12:18:48 +02:00
Sebastian Sellmair 127c5120dd Only fail parsing KotlinToolingVersion if parsing major or minor fails
^KT-54301 Verification Pending
2022-10-06 07:54:41 +00:00
Igor Chevdar 05016596df [K/N][codegen] Refactored debug info building 2022-10-06 07:12:32 +00:00
Dmitriy Novozhilov 9b63dde1c3 Add error-level OptIn on safeAs, cast and assertedCast functions in addToStdlib
Usage of this function is unsafe because it does not have native compiler
  support. This means that compiler won't report UNCHECKED_CAST,
  CAST_NEVER_SUCCEED or similar diagnostics in case of error cast
  (which can happen immediately or after some refactoring of class hierarchy)
2022-10-06 06:57:07 +00:00
Dmitriy Novozhilov 1cd4f3ad2f [FIR] Get rid of all usages of cast in FIR modules 2022-10-06 06:57:06 +00:00
Dmitriy Novozhilov ee21c966e1 [FIR] Get rid of all usages of safeAs in FIR modules 2022-10-06 06:57:06 +00:00
pyos 8d33de4297 JVM: partially reify typeOf and signatures as soon as possible
E.g. when substituting T -> Array<T>, write the bytecode for the
Array<...> part for typeOf.

This fixes various issues where either Array nesting levels, nullability
information (for typeOf), or entire reification markers were missing,
causing incorrect outputs ranging from missing `?`s to missing `[]`s to
just reified types not really being reified.

^KT-53761 Fixed
2022-10-06 00:58:25 +02:00
Steven Schäfer 2e6817042c IR Validation: Skip INVISIBLE_FAKE members when validating descriptors 2022-10-05 23:48:18 +02:00
Steven Schäfer 1567b27090 Psi2IR: Fix IR types for Java property setters with non-Unit return type 2022-10-05 23:48:18 +02:00
Steven Schäfer 31807a7977 Tests: Print backend errors in test results 2022-10-05 23:48:18 +02:00
Steven Schäfer 860615ece1 JVM IR: Fix unbound symbols in IrPluginContext 2022-10-05 23:48:18 +02:00
Anton Lakotka c358df7033 [Gradle] Include WATCHOS_DEVICE_ARM64 to Commonize unix platform test
^KT-53107
2022-10-05 19:32:05 +00:00
Anton Lakotka e57f9384b9 [Gradle] Use KonanTarget's name instead of calling toString()
^KT-53107
2022-10-05 19:32:04 +00:00
Anton Lakotka eb5a2f65bd [Gradle] Fix tests after adding watchosDeviceArm64 target
^KT-53107
2022-10-05 19:32:04 +00:00
Anton Lakotka fd5c061c0b [Gradle] Use more granular arm64 clang macro's for fat frameworks
After introducing watchOsDeviceArm64 target it conflicted with existing
watchOsArm64 target. Because both having the same Konan Architecture as
Arm64. This is not entirely correct and actual
architectures are different. So it requires more precise macros for
fat framework.

* __ARM64_ARCH_8_32__ for `watchOsArm64` which is based on `arm64_32`
* __ARM64_ARCH_8__ for other arm64 devices including `watchOsDeviceArm64`

^KT-53107
2022-10-05 19:32:03 +00:00
Anton Lakotka 1b3cc0dfaa [Gradle] Register watchosDeviceArm64 in commonizer
^KT-53107
2022-10-05 19:32:03 +00:00
Anton Lakotka 1b7f673e94 [Gradle] Register watchosDeviceArm64 in apple-specific tasks
^KT-53107
2022-10-05 19:32:03 +00:00
Anton Lakotka efa331feed [Gradle] Add arm64 architecture of watchos to AppleSdk object
^KT-53107
2022-10-05 19:32:02 +00:00
Anton Lakotka 640ba1ecfa [Gradle] Add watchosDeviceArm64 to nativeTargetsWithSimulatorTests
^KT-53107
2022-10-05 19:32:02 +00:00
Anton Lakotka 02c9cf74b4 [Gradle] Add watchosDeviceArm64 to KotlinArtifactsExtension
Generate via `generateAbstractKotlinArtifactsExtensionImplementation`

^KT-53107
2022-10-05 19:32:02 +00:00
Anton Lakotka 54d21634aa [Gradle, KPM] Add watchosDeviceArm64 KPM Variant
Generate via `generateKpmNativeVariants`

^KT-53107
2022-10-05 19:32:01 +00:00
Anton Lakotka 3fe5601a70 [Gradle] Add watchosDeviceArm64 target preset
Generate via `generateMppTargetContainerWithPresets`

^KT-53107 Verification Pending
2022-10-05 19:32:01 +00:00
Ilya Kirillov fceb3425c8 [Analysis API FIR] fix invalid usages of CachedValue
it should not cache map as values are stored on soft references
2022-10-05 15:53:54 +00:00
Ilya Kirillov 457069090b [Analysis API FIR] fix LLFirResolveSession creation for KtNotUnderContentRootModule 2022-10-05 15:53:54 +00:00
Ilya Kirillov 4de311f671 [Analysis API FIR] remove unused CachingKtAnalysisSessionProvider.getFirResolveSession(KtSymbol) 2022-10-05 15:53:53 +00:00
Ilya Kirillov b68532a316 [Analysis API FIR] fix memory leaks via KtAnalysisSessionCache keys 2022-10-05 15:53:53 +00:00
Roman Golyshev 3485d65213 [K2] Ignore failing tests for isUsedAsExpression
Those tests do not pass at the moment because of KTIJ-23143
2022-10-05 15:06:52 +00:00
Kristoffer Andersen f765457e51 [K2] isUsedAsExpression analysis 2022-10-05 15:06:52 +00:00
Denis.Zharkov d9701c71b7 Minor. Clean ZipImplementation.kt 2022-10-05 15:03:41 +00:00
Denis.Zharkov 337f461ad8 Fix IndexOutOfBoundsException at FastJarFS
If there are more than 0xffff files in the jar,
we have to use Zip64 format

^KT-52786 Fixed
2022-10-05 15:03:41 +00:00
Kristoffer Andersen fcabc60471 [FIR] Insert fake source for FIR for array access temporaries 2022-10-05 16:22:22 +02:00
Sergey Bogolepov 46feb00ee7 [K/N] KT-48100
Use `"frame-pointer"="all"` on arm64_32 watches.
Motivation: https://github.com/llvm/llvm-project/commit/152df3a
2022-10-05 13:23:49 +00:00
Sebastian Sellmair cda28da09d [kotlin-tooling-core] KotlinToolingVersionOrNull: return null on bad classifier argument
^KT-54301 Verification Pending
2022-10-05 12:19:16 +00:00
Steven Schäfer 760f89efd3 FIR: Fix operator and infix flags for FIR builtins 2022-10-05 12:14:05 +00:00
Ilmir Usmanov 808a73d5b9 FE: Change misleading error message 2022-10-05 11:51:20 +00:00
Marina.Shishkina 53219d60e6 Add changelog for 1.7.20 2022-10-05 13:29:12 +02:00
Margarita Bobova 3424614752 Add changelog for 1.7.10 2022-10-05 13:29:11 +02:00
Nikolay Krasko b5b58f40d6 Workaround instability of Gradle builds caused by the default encoding
The encoding setting from org.gradle.jvmargs is not applied
(https://github.com/gradle/gradle/issues/22292) during
the :kotlin-stdlib-js:compileJs, causing instability in kotlin.js.map
(https://youtrack.jetbrains.com/issue/KT-50589) on machines where
default encoding is not UTF-8.

This reverts commit d7ef5efa6a.

KTI-932
2022-10-05 10:57:46 +00:00