diff --git a/compiler/daemon/src/org/jetbrains/kotlin/daemon/report/experimental/RemoteICReporter.kt b/compiler/daemon/src/org/jetbrains/kotlin/daemon/report/experimental/RemoteICReporter.kt index 0aa564a286c..cb7d92e00c5 100644 --- a/compiler/daemon/src/org/jetbrains/kotlin/daemon/report/experimental/RemoteICReporter.kt +++ b/compiler/daemon/src/org/jetbrains/kotlin/daemon/report/experimental/RemoteICReporter.kt @@ -5,18 +5,17 @@ package org.jetbrains.kotlin.daemon.report.experimental -import kotlinx.coroutines.* -import org.jetbrains.kotlin.cli.common.ExitCode -import org.jetbrains.kotlin.daemon.common.* -import org.jetbrains.kotlin.daemon.report.CompositeICReporter +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.async import org.jetbrains.kotlin.build.report.ICReporterBase import org.jetbrains.kotlin.build.report.RemoteBuildReporter import org.jetbrains.kotlin.build.report.RemoteICReporter import org.jetbrains.kotlin.build.report.metrics.BuildMetricsReporter import org.jetbrains.kotlin.build.report.metrics.DoNothingBuildMetricsReporter import org.jetbrains.kotlin.build.report.metrics.RemoteBuildMetricsReporter -import org.jetbrains.kotlin.daemon.report.BuildReportICReporter -import org.jetbrains.kotlin.daemon.report.CompileIterationICReporter +import org.jetbrains.kotlin.cli.common.ExitCode +import org.jetbrains.kotlin.daemon.common.* +import org.jetbrains.kotlin.daemon.report.CompositeICReporter import java.io.File internal class DebugMessagesICReporterAsync( @@ -137,6 +136,8 @@ fun getICReporterAsync( CompilationResultCategory.VERBOSE_BUILD_REPORT_LINES -> { reporters.add(BuildReportICReporterAsync(compilationResults, root, isVerbose = true)) } + CompilationResultCategory.BUILD_METRICS -> { + } } } @@ -148,4 +149,4 @@ fun getICReporterAsync( object DoNothingRemoteBuildMetricsReporter : BuildMetricsReporter by DoNothingBuildMetricsReporter, RemoteBuildMetricsReporter { override fun flush() { } -} \ No newline at end of file +} diff --git a/compiler/daemon/src/org/jetbrains/kotlin/daemon/report/getICReporter.kt b/compiler/daemon/src/org/jetbrains/kotlin/daemon/report/getICReporter.kt index bdb583cd6c5..8476d7818b3 100644 --- a/compiler/daemon/src/org/jetbrains/kotlin/daemon/report/getICReporter.kt +++ b/compiler/daemon/src/org/jetbrains/kotlin/daemon/report/getICReporter.kt @@ -52,6 +52,8 @@ fun getBuildReporter( CompilationResultCategory.VERBOSE_BUILD_REPORT_LINES -> { reporters.add(BuildReportICReporter(compilationResults, root, isVerbose = true)) } + CompilationResultCategory.BUILD_METRICS -> { + } } } val areBuildMetricsNeeded = CompilationResultCategory.BUILD_METRICS in requestedResults @@ -61,5 +63,3 @@ fun getBuildReporter( return RemoteBuildReporter(CompositeICReporter(reporters), metricsReporter) } - - diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt index 44207d74d13..b6cc65a9351 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt @@ -55,7 +55,8 @@ class CallAndReferenceGenerator( callableReferenceAccess: FirCallableReferenceAccess, explicitReceiverExpression: IrExpression? ): IrExpression { - val symbol = callableReferenceAccess.calleeReference.toSymbolForCall(session, classifierStorage, declarationStorage, conversionScope) + val symbol = + callableReferenceAccess.calleeReference.toSymbolForCall(session, classifierStorage, declarationStorage, conversionScope) val type = callableReferenceAccess.typeRef.toIrType() fun propertyOrigin(): IrStatementOrigin? = when (callableReferenceAccess.source?.psi?.parent) { @@ -84,8 +85,8 @@ class CallAndReferenceGenerator( IrLocalDelegatedPropertyReferenceImpl( startOffset, endOffset, type, symbol, symbol.owner.delegate.symbol, - symbol.owner.getter.symbol as IrSimpleFunctionSymbol, - symbol.owner.setter?.symbol as IrSimpleFunctionSymbol?, + symbol.owner.getter.symbol, + symbol.owner.setter?.symbol, IrStatementOrigin.PROPERTY_REFERENCE_FOR_DELEGATE ) } @@ -223,7 +224,7 @@ class CallAndReferenceGenerator( } is IrLocalDelegatedPropertySymbol -> { IrCallImpl( - startOffset, endOffset, type, symbol.owner.getter.symbol as IrSimpleFunctionSymbol, + startOffset, endOffset, type, symbol.owner.getter.symbol, typeArgumentsCount = symbol.owner.getter.typeParameters.size, valueArgumentsCount = 0, origin = IrStatementOrigin.GET_LOCAL_PROPERTY, @@ -289,7 +290,7 @@ class CallAndReferenceGenerator( val setter = symbol.owner.setter when { setter != null -> IrCallImpl( - startOffset, endOffset, type, setter.symbol as IrSimpleFunctionSymbol, + startOffset, endOffset, type, setter.symbol, typeArgumentsCount = setter.typeParameters.size, valueArgumentsCount = 1, origin = origin, diff --git a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/IrFileSerializer.kt b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/IrFileSerializer.kt index 61cdb1f67fa..37177c73c9b 100644 --- a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/IrFileSerializer.kt +++ b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/IrFileSerializer.kt @@ -24,6 +24,7 @@ import org.jetbrains.kotlin.library.impl.IrMemoryArrayWriter import org.jetbrains.kotlin.library.impl.IrMemoryDeclarationWriter import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.types.Variance +import org.jetbrains.kotlin.backend.common.serialization.proto.AccessorIdSignature as ProtoAccessorIdSignature import org.jetbrains.kotlin.backend.common.serialization.proto.Actual as ProtoActual import org.jetbrains.kotlin.backend.common.serialization.proto.FieldAccessCommon as ProtoFieldAccessCommon import org.jetbrains.kotlin.backend.common.serialization.proto.FileEntry as ProtoFileEntry @@ -52,9 +53,9 @@ import org.jetbrains.kotlin.backend.common.serialization.proto.IrDynamicOperator import org.jetbrains.kotlin.backend.common.serialization.proto.IrDynamicType as ProtoDynamicType import org.jetbrains.kotlin.backend.common.serialization.proto.IrEnumConstructorCall as ProtoEnumConstructorCall import org.jetbrains.kotlin.backend.common.serialization.proto.IrEnumEntry as ProtoEnumEntry +import org.jetbrains.kotlin.backend.common.serialization.proto.IrErrorCallExpression as ProtoErrorCallExpression import org.jetbrains.kotlin.backend.common.serialization.proto.IrErrorDeclaration as ProtoErrorDeclaration import org.jetbrains.kotlin.backend.common.serialization.proto.IrErrorExpression as ProtoErrorExpression -import org.jetbrains.kotlin.backend.common.serialization.proto.IrErrorCallExpression as ProtoErrorCallExpression import org.jetbrains.kotlin.backend.common.serialization.proto.IrErrorType as ProtoErrorType import org.jetbrains.kotlin.backend.common.serialization.proto.IrExpression as ProtoExpression import org.jetbrains.kotlin.backend.common.serialization.proto.IrField as ProtoField @@ -101,7 +102,6 @@ import org.jetbrains.kotlin.backend.common.serialization.proto.Loop as ProtoLoop import org.jetbrains.kotlin.backend.common.serialization.proto.MemberAccessCommon as ProtoMemberAccessCommon import org.jetbrains.kotlin.backend.common.serialization.proto.NullableIrExpression as ProtoNullableIrExpression import org.jetbrains.kotlin.backend.common.serialization.proto.PublicIdSignature as ProtoPublicIdSignature -import org.jetbrains.kotlin.backend.common.serialization.proto.AccessorIdSignature as ProtoAccessorIdSignature open class IrFileSerializer( val logger: LoggingContext, @@ -1091,9 +1091,9 @@ open class IrFileSerializer( .setBase(serializeIrDeclarationBase(variable, LocalVariableFlags.encode(variable))) .setNameType(serializeNameAndType(variable.name, variable.type)) .setDelegate(serializeIrVariable(variable.delegate)) - .setGetter(serializeIrFunction(variable.getter as IrSimpleFunction)) // TODO: can it be non simple? + .setGetter(serializeIrFunction(variable.getter)) - variable.setter?.let { proto.setSetter(serializeIrFunction(it as IrSimpleFunction)) } // TODO: ditto. + variable.setter?.let { proto.setSetter(serializeIrFunction(it)) } return proto.build() } diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/debugInformation/AbstractLocalVariableTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/debugInformation/AbstractLocalVariableTest.kt index c3aec9a7e32..fb8c3cc4fb2 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/debugInformation/AbstractLocalVariableTest.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/debugInformation/AbstractLocalVariableTest.kt @@ -118,7 +118,9 @@ abstract class AbstractLocalVariableTest : AbstractDebugTest() { } } + @Suppress("UNCHECKED_CAST") val compressedLog = compressRunsWithoutLinenumber(loggedItems as List, LVTStep::location) + val actualLocalVariables = compressedLog.joinToString("\n") { "// ${it.location.formatAsExpectation()}: ${it.visibleVars.joinToString(", ")}".trim() } diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/debugInformation/AbstractSteppingTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/debugInformation/AbstractSteppingTest.kt index a04fdbfe55c..a140b5d4458 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/debugInformation/AbstractSteppingTest.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/debugInformation/AbstractSteppingTest.kt @@ -56,6 +56,7 @@ abstract class AbstractSteppingTest : AbstractDebugTest() { val lines = wholeFile.readLines() val forceStepInto = lines.any { it.startsWith(FORCE_STEP_INTO_MARKER) } + @Suppress("UNCHECKED_CAST") val actualLineNumbers = compressRunsWithoutLinenumber(loggedItems as List, LocatableEvent::location) .filter { val location = it.location() @@ -98,4 +99,3 @@ abstract class AbstractSteppingTest : AbstractDebugTest() { assertEqualsToFile(wholeFile, actual.joinToString("\n")) } } - diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/fir/VMCounters.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/fir/VMCounters.kt index 98e622e390e..8dfdbaeb2fd 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/fir/VMCounters.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/fir/VMCounters.kt @@ -3,13 +3,13 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @file:Suppress("JAVA_MODULE_DOES_NOT_EXPORT_PACKAGE") + package org.jetbrains.kotlin.fir import org.jetbrains.kotlin.daemon.common.threadCpuTime import org.jetbrains.kotlin.daemon.common.threadUserTime import sun.management.ManagementFactoryHelper - data class GCInfo(val name: String, val gcTime: Long, val collections: Long) { operator fun minus(other: GCInfo): GCInfo { return this.copy( @@ -36,6 +36,7 @@ data class VMCounters(val userTime: Long, val cpuTime: Long, val gcInfo: Map merge(first: Map, second: Map, valueOp: (V, V) -> V): Map { val result = first.toMutableMap() for ((k, v) in second) { + @Suppress("NULLABLE_TYPE_PARAMETER_AGAINST_NOT_NULL_TYPE_PARAMETER") // KT-43225 result.merge(k, v, valueOp) } return result @@ -55,4 +56,4 @@ fun vmStateSnapshot(): VMCounters { threadMXBean.threadUserTime(), threadMXBean.threadCpuTime(), ManagementFactoryHelper.getGarbageCollectorMXBeans().associate { it.name to GCInfo(it.name, it.collectionTime, it.collectionCount) } ) -} \ No newline at end of file +} diff --git a/compiler/tests-mutes/build.gradle.kts b/compiler/tests-mutes/build.gradle.kts index 034c72c9479..69a4f6bbdca 100644 --- a/compiler/tests-mutes/build.gradle.kts +++ b/compiler/tests-mutes/build.gradle.kts @@ -17,9 +17,12 @@ sourceSets { "test" {} } +val compileKotlin: org.jetbrains.kotlin.gradle.tasks.KotlinCompile by tasks +compileKotlin.kotlinOptions.freeCompilerArgs += "-Xskip-runtime-version-check" + val mutesPackageName = "org.jetbrains.kotlin.test.mutes" application { mainClassName = "$mutesPackageName.MutedTestsSyncKt" applicationDefaultJvmArgs = rootProject.properties.filterKeys { it.startsWith(mutesPackageName) }.map { (k, v) -> "-D$k=$v" } -} \ No newline at end of file +} diff --git a/libraries/stdlib/jvm/src/kotlin/coroutines/SafeContinuationJvm.kt b/libraries/stdlib/jvm/src/kotlin/coroutines/SafeContinuationJvm.kt index 1f8a768b6fa..9effdb546dd 100644 --- a/libraries/stdlib/jvm/src/kotlin/coroutines/SafeContinuationJvm.kt +++ b/libraries/stdlib/jvm/src/kotlin/coroutines/SafeContinuationJvm.kt @@ -27,7 +27,6 @@ internal actual constructor( private companion object { @Suppress("UNCHECKED_CAST") - @JvmStatic private val RESULT = AtomicReferenceFieldUpdater.newUpdater, Any?>( SafeContinuation::class.java, Any::class.java as Class, "result" )