[IR] Correct work of the new MFVC lowering classes
#KT-1179
This commit is contained in:
committed by
teamcity
parent
8ba20bee5b
commit
6f94af80ab
+3
-3
@@ -50202,9 +50202,9 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("MFVCFieldInitializationOrder.kt")
|
||||
public void testMFVCFieldInitializationOrder() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/valueClasses/MFVCFieldInitializationOrder.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal());
|
||||
@TestMetadata("MfvcFieldInitializationOrder.kt")
|
||||
public void testMfvcFieldInitializationOrder() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/valueClasses/MfvcFieldInitializationOrder.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
+22
-24
@@ -11,11 +11,9 @@ import org.jetbrains.kotlin.backend.common.lower.VariableRemapper
|
||||
import org.jetbrains.kotlin.backend.common.lower.createIrBuilder
|
||||
import org.jetbrains.kotlin.backend.common.lower.irNot
|
||||
import org.jetbrains.kotlin.backend.common.phaser.makeIrFilePhase
|
||||
import org.jetbrains.kotlin.backend.jvm.JvmBackendContext
|
||||
import org.jetbrains.kotlin.backend.jvm.JvmLoweredDeclarationOrigin
|
||||
import org.jetbrains.kotlin.backend.jvm.*
|
||||
import org.jetbrains.kotlin.backend.jvm.MemoizedMultiFieldValueClassReplacements.RemappedParameter.MultiFieldValueClassMapping
|
||||
import org.jetbrains.kotlin.backend.jvm.MemoizedMultiFieldValueClassReplacements.RemappedParameter.RegularMapping
|
||||
import org.jetbrains.kotlin.backend.jvm.SpecialBridge
|
||||
import org.jetbrains.kotlin.backend.jvm.ir.*
|
||||
import org.jetbrains.kotlin.codegen.AsmUtil
|
||||
import org.jetbrains.kotlin.descriptors.DescriptorVisibilities
|
||||
@@ -623,8 +621,8 @@ internal class BridgeLowering(val context: JvmBackendContext) : FileLoweringPass
|
||||
target: IrSimpleFunction,
|
||||
superQualifierSymbol: IrClassSymbol? = null
|
||||
) =
|
||||
irCastIfNeeded(
|
||||
irCall(target, origin = IrStatementOrigin.BRIDGE_DELEGATION, superQualifierSymbol = superQualifierSymbol).apply {
|
||||
irCastIfNeeded(irBlock {
|
||||
+irReturn(irCall(target, origin = IrStatementOrigin.BRIDGE_DELEGATION, superQualifierSymbol = superQualifierSymbol).apply {
|
||||
|
||||
val targetStructure = run {
|
||||
val mfvcOrOriginal =
|
||||
@@ -656,7 +654,7 @@ internal class BridgeLowering(val context: JvmBackendContext) : FileLoweringPass
|
||||
bridgeStructure.size == targetStructure.size &&
|
||||
(targetStructure zip bridgeStructure).none { (targetParameter, bridgeParameter) ->
|
||||
targetParameter is MultiFieldValueClassMapping && bridgeParameter is MultiFieldValueClassMapping &&
|
||||
targetParameter.declarations != bridgeParameter.declarations
|
||||
targetParameter.rootMfvcNode != bridgeParameter.rootMfvcNode
|
||||
}) { "Incompatible structures: $bridgeStructure and $targetStructure" }
|
||||
|
||||
fun irGetOrCast(bridgeParameter: IrValueParameter, targetParameter: IrValueParameter) =
|
||||
@@ -678,7 +676,7 @@ internal class BridgeLowering(val context: JvmBackendContext) : FileLoweringPass
|
||||
when (targetRemappedParameter) {
|
||||
is MultiFieldValueClassMapping -> when (bridgeRemappedParameter) {
|
||||
is MultiFieldValueClassMapping -> {
|
||||
require(bridgeRemappedParameter.declarations == targetRemappedParameter.declarations) {
|
||||
require(bridgeRemappedParameter.rootMfvcNode == targetRemappedParameter.rootMfvcNode) {
|
||||
"Incompatible parameters: $bridgeRemappedParameter, $targetRemappedParameter"
|
||||
}
|
||||
repeat(bridgeRemappedParameter.valueParameters.size) {
|
||||
@@ -687,34 +685,35 @@ internal class BridgeLowering(val context: JvmBackendContext) : FileLoweringPass
|
||||
putArgument(targetParameter, irGetOrCast(bridgeParameter, targetParameter))
|
||||
}
|
||||
}
|
||||
|
||||
is RegularMapping, null -> {
|
||||
val bridgeParameter = bridgeExplicitParameters[bridgeIndex++]
|
||||
val newArguments = targetRemappedParameter.declarations.unboxMethods.map { unboxFunction ->
|
||||
irCall(unboxFunction).apply {
|
||||
val targetParameterType = targetRemappedParameter.declarations.valueClass.defaultType
|
||||
dispatchReceiver = irCastIfNeeded(irGet(bridgeParameter), targetParameterType)
|
||||
}
|
||||
}
|
||||
val targetParameterType = targetRemappedParameter.rootMfvcNode.mfvc.defaultType
|
||||
val instance = targetRemappedParameter.rootMfvcNode.createInstanceFromBox(
|
||||
this@irBlock,
|
||||
irCastIfNeeded(irGet(bridgeParameter), targetParameterType),
|
||||
hasAccessToPrivateMembersOf(target, targetRemappedParameter.rootMfvcNode.mfvc)
|
||||
) { error("Not applicable") }
|
||||
val newArguments = instance.makeFlattenedGetterExpressions()
|
||||
for (newArgument in newArguments) {
|
||||
putArgument(targetExplicitParameters[targetIndex++], newArgument)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
is RegularMapping, null -> {
|
||||
val targetParameter = targetExplicitParameters[targetIndex]
|
||||
when (bridgeRemappedParameter) {
|
||||
is MultiFieldValueClassMapping -> {
|
||||
val count = bridgeRemappedParameter.declarations.fields.size
|
||||
val boxCall = irCall(bridgeRemappedParameter.declarations.boxMethod).apply {
|
||||
bridgeRemappedParameter.boxedType.arguments.forEachIndexed { index, argument ->
|
||||
putTypeArgument(index, argument.typeOrNull)
|
||||
}
|
||||
for (i in 0 until count) {
|
||||
putValueArgument(i, irGet(bridgeExplicitParameters[bridgeIndex++]))
|
||||
}
|
||||
val valueArguments = List(bridgeRemappedParameter.rootMfvcNode.leavesCount) {
|
||||
irGet(bridgeExplicitParameters[bridgeIndex++])
|
||||
}
|
||||
val boxCall = bridgeRemappedParameter.rootMfvcNode.makeBoxedExpression(
|
||||
this@irBlock, bridgeRemappedParameter.typeArguments, valueArguments
|
||||
)
|
||||
putArgument(targetParameter, irCastIfNeeded(boxCall, targetParameter.type.upperBound))
|
||||
}
|
||||
|
||||
is RegularMapping, null -> {
|
||||
val bridgeParameter = bridgeExplicitParameters[bridgeIndex++]
|
||||
putArgument(targetParameter, irGetOrCast(bridgeParameter, targetParameter))
|
||||
@@ -734,9 +733,8 @@ internal class BridgeLowering(val context: JvmBackendContext) : FileLoweringPass
|
||||
require((bridgeStructure == null || structureIndex == bridgeStructure.size)) {
|
||||
"Invalid structure index $structureIndex for $bridgeStructure"
|
||||
}
|
||||
},
|
||||
bridge.returnType.upperBound
|
||||
)
|
||||
})
|
||||
}.unwrap(), bridge.returnType.upperBound)
|
||||
|
||||
private fun IrBuilderWithScope.irCastIfNeeded(expression: IrExpression, to: IrType): IrExpression =
|
||||
if (expression.type == to || to.isAny() || to.isNullableAny()) expression else irImplicitCast(expression, to)
|
||||
|
||||
+11
-11
@@ -16,6 +16,7 @@ import org.jetbrains.kotlin.backend.jvm.MemoizedMultiFieldValueClassReplacements
|
||||
import org.jetbrains.kotlin.backend.jvm.MemoizedMultiFieldValueClassReplacements.RemappedParameter.RegularMapping
|
||||
import org.jetbrains.kotlin.backend.jvm.fullValueParameterList
|
||||
import org.jetbrains.kotlin.backend.jvm.ir.*
|
||||
import org.jetbrains.kotlin.backend.jvm.makeBoxedExpression
|
||||
import org.jetbrains.kotlin.builtins.StandardNames
|
||||
import org.jetbrains.kotlin.config.JvmDefaultMode
|
||||
import org.jetbrains.kotlin.descriptors.DescriptorVisibilities
|
||||
@@ -32,7 +33,6 @@ import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||
import org.jetbrains.kotlin.ir.expressions.IrTypeOperator
|
||||
import org.jetbrains.kotlin.ir.expressions.impl.IrTypeOperatorCallImpl
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
import org.jetbrains.kotlin.ir.types.typeOrNull
|
||||
import org.jetbrains.kotlin.ir.util.*
|
||||
import org.jetbrains.kotlin.ir.visitors.*
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
|
||||
@@ -134,16 +134,16 @@ private class InheritedDefaultMethodsOnClassesLowering(val context: JvmBackendCo
|
||||
var flattenedIndex = 0
|
||||
for (i in 1 until structure.size) {
|
||||
when (val remappedParameter = structure[i]) {
|
||||
is MultiFieldValueClassMapping ->
|
||||
putValueArgument(i, irCall(remappedParameter.declarations.boxMethod).apply {
|
||||
remappedParameter.boxedType.arguments.forEachIndexed { index, argument ->
|
||||
putTypeArgument(index, argument.typeOrNull)
|
||||
}
|
||||
val boxArgumentsCount = remappedParameter.valueParameters.size
|
||||
for (boxArgumentIndex in 0 until boxArgumentsCount) {
|
||||
putValueArgument(boxArgumentIndex, irGet(sourceFullValueParameterList[flattenedIndex++]))
|
||||
}
|
||||
})
|
||||
is MultiFieldValueClassMapping -> {
|
||||
val valueArguments = (0 until remappedParameter.valueParameters.size).map {
|
||||
irGet(sourceFullValueParameterList[flattenedIndex++])
|
||||
}
|
||||
val boxedExpression = remappedParameter.rootMfvcNode.makeBoxedExpression(
|
||||
this@irBlockBody, remappedParameter.typeArguments, valueArguments
|
||||
)
|
||||
putValueArgument(i, boxedExpression)
|
||||
}
|
||||
|
||||
is RegularMapping -> putValueArgument(i, irGet(sourceFullValueParameterList[flattenedIndex++]))
|
||||
}
|
||||
}
|
||||
|
||||
+4
-2
@@ -83,7 +83,9 @@ private class JvmInlineClassLowering(context: JvmBackendContext) : JvmValueClass
|
||||
|
||||
override fun IrClass.isSpecificLoweringLogicApplicable(): Boolean = isSingleFieldValueClass
|
||||
|
||||
override fun IrFunction.isFieldGetterToRemove(): Boolean = isInlineClassFieldGetter
|
||||
override val specificMangle: SpecificMangle
|
||||
get() = SpecificMangle.Inline
|
||||
|
||||
override fun visitClassNew(declaration: IrClass): IrStatement {
|
||||
// The arguments to the primary constructor are in scope in the initializers of IrFields.
|
||||
|
||||
@@ -113,7 +115,7 @@ private class JvmInlineClassLowering(context: JvmBackendContext) : JvmValueClass
|
||||
val irConstructor = declaration.primaryConstructor!!
|
||||
// The field getter is used by reflection and cannot be removed here unless it is internal.
|
||||
declaration.declarations.removeIf {
|
||||
it == irConstructor || (it is IrFunction && it.isFieldGetterToRemove() && !it.visibility.isPublicAPI)
|
||||
it == irConstructor || (it is IrFunction && it.isInlineClassFieldGetter && !it.visibility.isPublicAPI)
|
||||
}
|
||||
buildPrimaryInlineClassConstructor(declaration, irConstructor)
|
||||
buildBoxFunction(declaration)
|
||||
|
||||
+786
-681
File diff suppressed because it is too large
Load Diff
+13
-10
@@ -31,8 +31,6 @@ internal abstract class JvmValueClassAbstractLowering(val context: JvmBackendCon
|
||||
|
||||
abstract fun IrClass.isSpecificLoweringLogicApplicable(): Boolean
|
||||
|
||||
abstract fun IrFunction.isFieldGetterToRemove(): Boolean
|
||||
|
||||
abstract override fun visitClassNew(declaration: IrClass): IrStatement
|
||||
|
||||
abstract fun handleSpecificNewClass(declaration: IrClass)
|
||||
@@ -46,7 +44,7 @@ internal abstract class JvmValueClassAbstractLowering(val context: JvmBackendCon
|
||||
|
||||
if (replacement == null) {
|
||||
if (function is IrConstructor) {
|
||||
val constructorReplacement = replacements.getReplacementRegularClassConstructor(function)
|
||||
val constructorReplacement = replacements.getReplacementForRegularClassConstructor(function)
|
||||
if (constructorReplacement != null) {
|
||||
addBindingsFor(function, constructorReplacement)
|
||||
return transformFlattenedConstructor(function, constructorReplacement)
|
||||
@@ -107,7 +105,7 @@ internal abstract class JvmValueClassAbstractLowering(val context: JvmBackendCon
|
||||
it.transformChildrenVoid()
|
||||
it.defaultValue?.patchDeclarationParents(replacement)
|
||||
}
|
||||
allScopes.push(createScope(function))
|
||||
allScopes.push(createScope(replacement))
|
||||
replacement.body = function.body?.transform(this, null)?.patchDeclarationParents(replacement)
|
||||
allScopes.pop()
|
||||
replacement.copyAttributes(function)
|
||||
@@ -127,7 +125,9 @@ internal abstract class JvmValueClassAbstractLowering(val context: JvmBackendCon
|
||||
if (suffix != null && target.name.asString().endsWith(suffix))
|
||||
return super.visitReturn(expression)
|
||||
|
||||
replacements.getReplacementFunction(target)?.let {
|
||||
replacements.run {
|
||||
getReplacementFunction(target) ?: if (target is IrConstructor) getReplacementForRegularClassConstructor(target) else null
|
||||
}?.let {
|
||||
return context.createIrBuilder(it.symbol, expression.startOffset, expression.endOffset).irReturn(
|
||||
expression.value.transform(this, null)
|
||||
)
|
||||
@@ -145,12 +145,12 @@ internal abstract class JvmValueClassAbstractLowering(val context: JvmBackendCon
|
||||
}
|
||||
}
|
||||
|
||||
override fun visitContainerExpression(expression: IrContainerExpression): IrExpression {
|
||||
final override fun visitContainerExpression(expression: IrContainerExpression): IrExpression {
|
||||
visitStatementContainer(expression)
|
||||
return expression
|
||||
}
|
||||
|
||||
override fun visitBlockBody(body: IrBlockBody): IrBody {
|
||||
final override fun visitBlockBody(body: IrBlockBody): IrBody {
|
||||
visitStatementContainer(body)
|
||||
return body
|
||||
}
|
||||
@@ -164,6 +164,8 @@ internal abstract class JvmValueClassAbstractLowering(val context: JvmBackendCon
|
||||
|
||||
protected abstract fun addBindingsFor(original: IrFunction, replacement: IrFunction)
|
||||
|
||||
protected enum class SpecificMangle { Inline, MultiField }
|
||||
protected abstract val specificMangle: SpecificMangle
|
||||
private fun createBridgeFunction(
|
||||
function: IrSimpleFunction,
|
||||
replacement: IrSimpleFunction
|
||||
@@ -173,9 +175,10 @@ internal abstract class JvmValueClassAbstractLowering(val context: JvmBackendCon
|
||||
replacement,
|
||||
when {
|
||||
// If the original function has signature which need mangling we still need to replace it with a mangled version.
|
||||
(!function.isFakeOverride || function.findInterfaceImplementation(context.state.jvmDefaultMode) != null) &&
|
||||
function.signatureRequiresMangling() ->
|
||||
replacement.name
|
||||
(!function.isFakeOverride || function.findInterfaceImplementation(context.state.jvmDefaultMode) != null) && when (specificMangle) {
|
||||
SpecificMangle.Inline -> function.signatureRequiresMangling(includeInline = true, includeMFVC = false)
|
||||
SpecificMangle.MultiField -> function.signatureRequiresMangling(includeInline = false, includeMFVC = true)
|
||||
} -> replacement.name
|
||||
// Since we remove the corresponding property symbol from the bridge we need to resolve getter/setter
|
||||
// names at this point.
|
||||
replacement.isGetter ->
|
||||
|
||||
-202
@@ -1,202 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.backend.jvm.lower
|
||||
|
||||
import org.jetbrains.kotlin.backend.jvm.MultiFieldValueClassSpecificDeclarations
|
||||
import org.jetbrains.kotlin.backend.jvm.MultiFieldValueClassTree
|
||||
import org.jetbrains.kotlin.backend.jvm.ir.erasedUpperBound
|
||||
import org.jetbrains.kotlin.ir.builders.*
|
||||
import org.jetbrains.kotlin.ir.declarations.*
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||
import org.jetbrains.kotlin.ir.symbols.IrTypeParameterSymbol
|
||||
import org.jetbrains.kotlin.ir.types.IrSimpleType
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
import org.jetbrains.kotlin.ir.types.typeOrNull
|
||||
import org.jetbrains.kotlin.ir.util.defaultType
|
||||
import org.jetbrains.kotlin.ir.util.render
|
||||
import org.jetbrains.kotlin.ir.util.substitute
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
|
||||
typealias TypeArguments = Map<IrTypeParameterSymbol, IrType>
|
||||
|
||||
sealed interface MFVCRepresentation<Leaf : MFVCLeafRepresentation> {
|
||||
operator fun get(name: Name): MFVCRepresentation<Leaf>?
|
||||
fun IrBuilderWithScope.makeGetter(): IrExpression
|
||||
val type: IrSimpleType
|
||||
val children: List<Pair<Name, MFVCRepresentation<Leaf>>>
|
||||
val leaves: List<Leaf>
|
||||
}
|
||||
|
||||
sealed interface MutableMFVCRepresentation<Leaf : MFVCLeafRepresentation> : MFVCRepresentation<Leaf>
|
||||
sealed interface RecursivelyMutableMFVCRepresentation<Leaf : MFVCLeafRepresentation> : MutableMFVCRepresentation<Leaf>
|
||||
|
||||
interface MFVCLeafRepresentation : MFVCRepresentation<Nothing> {
|
||||
override fun get(name: Name): Nothing? = null
|
||||
override val children: List<Pair<Name, MFVCRepresentation<Nothing>>>
|
||||
get() = emptyList()
|
||||
override val leaves: List<Nothing>
|
||||
get() = emptyList()
|
||||
}
|
||||
|
||||
interface MutableMFVCLeafRepresentation : MFVCLeafRepresentation, RecursivelyMutableMFVCRepresentation<Nothing> {
|
||||
fun IrBuilderWithScope.makeSetter(value: IrExpression): IrExpression
|
||||
}
|
||||
|
||||
sealed class ValueDeclarationLeafRepresentation(open val valueDeclaration: IrValueDeclaration) : MFVCLeafRepresentation {
|
||||
override fun IrBuilderWithScope.makeGetter(): IrExpression = irGet(valueDeclaration)
|
||||
override val type: IrSimpleType
|
||||
get() = valueDeclaration.type as IrSimpleType
|
||||
}
|
||||
|
||||
data class VariableLeafRepresentation(override val valueDeclaration: IrVariable) : ValueDeclarationLeafRepresentation(valueDeclaration),
|
||||
MutableMFVCLeafRepresentation {
|
||||
override fun IrBuilderWithScope.makeSetter(value: IrExpression): IrExpression = irSet(valueDeclaration, value)
|
||||
}
|
||||
|
||||
data class ValueParameterLeafRepresentation(override val valueDeclaration: IrValueParameter) :
|
||||
ValueDeclarationLeafRepresentation(valueDeclaration)
|
||||
|
||||
sealed class ReceiverBasedLeafRepresentation(open val receiver: IrValueDeclaration) : MFVCLeafRepresentation {
|
||||
protected fun makeTypeParametersMapping(): Map<IrTypeParameterSymbol, IrType> {
|
||||
val type = receiver.type as IrSimpleType
|
||||
return (type.erasedUpperBound.typeParameters zip type.arguments)
|
||||
.mapNotNull { (parameter, argument) -> argument.typeOrNull?.let { parameter.symbol to it } }.toMap()
|
||||
}
|
||||
}
|
||||
|
||||
data class FieldAccessLeafRepresentation(override val receiver: IrValueDeclaration, val field: IrField) :
|
||||
ReceiverBasedLeafRepresentation(receiver), MutableMFVCLeafRepresentation {
|
||||
override fun IrBuilderWithScope.makeGetter(): IrExpression = irGetField(irGet(receiver), field)
|
||||
override fun IrBuilderWithScope.makeSetter(value: IrExpression): IrExpression = irSetField(irGet(receiver), field, value)
|
||||
override val type: IrSimpleType = field.type.substitute(makeTypeParametersMapping()) as IrSimpleType
|
||||
}
|
||||
|
||||
data class GetterLeafRepresentation(override val receiver: IrValueDeclaration, val getter: IrFunction) :
|
||||
ReceiverBasedLeafRepresentation(receiver) {
|
||||
init {
|
||||
require(getter.typeParameters.isEmpty()) { "Getter ${getter.render()} must have no type parameters" }
|
||||
}
|
||||
|
||||
override fun IrBuilderWithScope.makeGetter(): IrExpression = irCall(getter).apply {
|
||||
dispatchReceiver = irGet(receiver)
|
||||
}
|
||||
|
||||
override val type: IrSimpleType = getter.returnType.substitute(makeTypeParametersMapping()) as IrSimpleType
|
||||
}
|
||||
|
||||
private fun getChildType(
|
||||
declarations: MultiFieldValueClassSpecificDeclarations,
|
||||
typeMapping: Map<IrTypeParameterSymbol, IrSimpleType>,
|
||||
name: Name,
|
||||
): IrSimpleType? = declarations.loweringRepresentation[name]?.type?.substitute(typeMapping) as IrSimpleType?
|
||||
|
||||
|
||||
private fun <T : MFVCRepresentation<Leaf>, Leaf : T, InternalNode : T> makeTree(
|
||||
node: MultiFieldValueClassTree,
|
||||
typeArguments: TypeArguments,
|
||||
createInternalNode: (type: IrSimpleType, typeArguments: TypeArguments, node: MultiFieldValueClassTree, children: List<Pair<Name, T>>) -> InternalNode,
|
||||
createLeaf: (type: IrType, node: MultiFieldValueClassTree) -> Leaf,
|
||||
): T = when (node) {
|
||||
is MultiFieldValueClassTree.InternalNode -> {
|
||||
val type = node.type.substitute(typeArguments) as IrSimpleType
|
||||
val children = node.fields.map { it.name to makeTree(it.node, typeArguments, createInternalNode, createLeaf) }
|
||||
createInternalNode(type, typeArguments, node, children)
|
||||
}
|
||||
is MultiFieldValueClassTree.Leaf -> createLeaf(node.type.substitute(typeArguments), node)
|
||||
}
|
||||
|
||||
sealed interface InternalNodeRepresentation<Leaf : MFVCLeafRepresentation> : MFVCRepresentation<Leaf>
|
||||
|
||||
abstract class InternalNodeRepresentationImpl<Leaf : MFVCLeafRepresentation>(
|
||||
val declarations: MultiFieldValueClassSpecificDeclarations,
|
||||
val typeArguments: TypeArguments,
|
||||
final override val children: List<Pair<Name, MFVCRepresentation<Leaf>>>,
|
||||
) : InternalNodeRepresentation<Leaf> {
|
||||
final override val type: IrSimpleType = declarations.valueClass.defaultType.substitute(typeArguments) as IrSimpleType
|
||||
|
||||
final override val leaves: List<Leaf> = children.flatMap { (_, node) -> node.leaves }
|
||||
|
||||
private val childrenMap = children.toMap()
|
||||
|
||||
final override fun get(name: Name): MFVCRepresentation<Leaf>? = childrenMap[name]
|
||||
|
||||
final override fun IrBuilderWithScope.makeGetter(): IrExpression = irCall(declarations.boxMethod).apply {
|
||||
declarations.valueClass.typeParameters.forEachIndexed { index, typeParameter ->
|
||||
typeArguments[typeParameter.symbol]?.let { putTypeArgument(index, it) }
|
||||
}
|
||||
leaves.forEachIndexed { index, leaf -> putValueArgument(index, leaf.run { makeGetter() }) }
|
||||
}
|
||||
}
|
||||
|
||||
abstract class MutableInternalNodeRepresentation<Leaf : MFVCLeafRepresentation>(
|
||||
declarations: MultiFieldValueClassSpecificDeclarations,
|
||||
typeArguments: TypeArguments,
|
||||
children: List<Pair<Name, MFVCRepresentation<Leaf>>>
|
||||
) : InternalNodeRepresentationImpl<Leaf>(declarations, typeArguments, children), MutableMFVCRepresentation<Leaf> {
|
||||
abstract fun IrBuilderWithScope.makeSetter(values: List<IrExpression>): IrExpression
|
||||
}
|
||||
|
||||
abstract class RecursivelyMutableInternalNodeRepresentation<Leaf : MutableMFVCLeafRepresentation>(
|
||||
declarations: MultiFieldValueClassSpecificDeclarations,
|
||||
typeArguments: TypeArguments,
|
||||
children: List<Pair<Name, MFVCRepresentation<Leaf>>>,
|
||||
) : MutableInternalNodeRepresentation<Leaf>(declarations, typeArguments, children), RecursivelyMutableMFVCRepresentation<Leaf> {
|
||||
final override fun IrBuilderWithScope.makeSetter(values: List<IrExpression>): IrExpression {
|
||||
require(values.size == leaves.size) { "Expected ${leaves.size} expressions but found ${values.size} of them" }
|
||||
return irComposite {
|
||||
for ((leaf, value) in leaves zip values) {
|
||||
+leaf.run { makeSetter(value) }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sealed interface ValueDeclarationInternalNodeRepresentation<Leaf : ValueDeclarationLeafRepresentation> : InternalNodeRepresentation<Leaf>
|
||||
|
||||
class MutableValueDeclarationInternalNodeRepresentation(
|
||||
declarations: MultiFieldValueClassSpecificDeclarations,
|
||||
typeArguments: TypeArguments,
|
||||
children: List<Pair<Name, RecursivelyMutableMFVCRepresentation<VariableLeafRepresentation>>>,
|
||||
) : ValueDeclarationInternalNodeRepresentation<VariableLeafRepresentation>,
|
||||
RecursivelyMutableInternalNodeRepresentation<VariableLeafRepresentation>(declarations, typeArguments, children)
|
||||
|
||||
class FieldAccessInternalNodeRepresentation(
|
||||
declarations: MultiFieldValueClassSpecificDeclarations,
|
||||
typeArguments: TypeArguments,
|
||||
children: List<Pair<Name, RecursivelyMutableMFVCRepresentation<FieldAccessLeafRepresentation>>>,
|
||||
) : RecursivelyMutableInternalNodeRepresentation<FieldAccessLeafRepresentation>(declarations, typeArguments, children)
|
||||
|
||||
class RegularClassMFVCInternalNodeRepresentation(
|
||||
declarations: MultiFieldValueClassSpecificDeclarations,
|
||||
typeArguments: TypeArguments,
|
||||
children: List<Pair<Name, MFVCRepresentation<ReceiverBasedLeafRepresentation>>>,
|
||||
) : InternalNodeRepresentationImpl<ReceiverBasedLeafRepresentation>(declarations, typeArguments, children) {
|
||||
init {
|
||||
leaves.verifyEqualReceivers()
|
||||
}
|
||||
}
|
||||
|
||||
private fun List<ReceiverBasedLeafRepresentation>.verifyEqualReceivers() {
|
||||
val receiver = this[0].receiver
|
||||
require(all { it.receiver == receiver }) { "Different receivers found in leaves" }
|
||||
}
|
||||
|
||||
class MutableRegularClassMFVCInternalNodeRepresentation(
|
||||
declarations: MultiFieldValueClassSpecificDeclarations,
|
||||
val setter: IrFunction,
|
||||
typeArguments: TypeArguments,
|
||||
children: List<Pair<Name, MFVCRepresentation<ReceiverBasedLeafRepresentation>>>,
|
||||
) : MutableInternalNodeRepresentation<ReceiverBasedLeafRepresentation>(declarations, typeArguments, children) {
|
||||
init {
|
||||
leaves.verifyEqualReceivers()
|
||||
require(setter.typeParameters.isEmpty()) { "No type parameters are expected for ${setter.render()}" }
|
||||
}
|
||||
|
||||
override fun IrBuilderWithScope.makeSetter(values: List<IrExpression>): IrExpression = irCall(setter).apply {
|
||||
dispatchReceiver = irGet(leaves[0].receiver)
|
||||
values.forEachIndexed { index, value -> putValueArgument(index, value) }
|
||||
}
|
||||
}
|
||||
@@ -157,7 +157,7 @@ val IrFunction.isInlineClassFieldGetter: Boolean
|
||||
get() = (parent as? IrClass)?.isSingleFieldValueClass == true && this is IrSimpleFunction && extensionReceiverParameter == null &&
|
||||
correspondingPropertySymbol?.let { it.owner.getter == this && it.owner.name == parentAsClass.inlineClassFieldName } == true
|
||||
|
||||
val IrFunction.isMultiFieldValueClassOriginalFieldGetter: Boolean
|
||||
val IrFunction.isMultiFieldValueClassFieldGetter: Boolean
|
||||
get() = (parent as? IrClass)?.isMultiFieldValueClass == true && this is IrSimpleFunction && extensionReceiverParameter == null &&
|
||||
correspondingPropertySymbol?.let {
|
||||
val multiFieldValueClassRepresentation = parentAsClass.multiFieldValueClassRepresentation
|
||||
|
||||
@@ -31,7 +31,6 @@ import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
|
||||
import org.jetbrains.kotlin.ir.symbols.*
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
import org.jetbrains.kotlin.ir.types.IrTypeSystemContext
|
||||
import org.jetbrains.kotlin.ir.types.IrTypeSystemContextImpl
|
||||
import org.jetbrains.kotlin.ir.types.defaultType
|
||||
import org.jetbrains.kotlin.ir.util.SymbolTable
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
@@ -145,7 +144,7 @@ class JvmBackendContext(
|
||||
val inlineClassReplacements = MemoizedInlineClassReplacements(state.functionsWithInlineClassReturnTypesMangled, irFactory, this)
|
||||
|
||||
val multiFieldValueClassReplacements =
|
||||
MemoizedMultiFieldValueClassReplacements(irFactory, this, IrTypeSystemContextImpl(irBuiltIns))
|
||||
MemoizedMultiFieldValueClassReplacements(irFactory, this)
|
||||
|
||||
val continuationClassesVarsCountByType: MutableMap<IrAttributeContainer, Map<Type, Int>> = hashMapOf()
|
||||
|
||||
|
||||
+1
-1
@@ -252,7 +252,7 @@ class MemoizedInlineClassReplacements(
|
||||
name = InlineClassAbi.mangledNameFor(function, mangleReturnTypes, useOldManglingScheme)
|
||||
}
|
||||
|
||||
override val getReplacementRegularClassConstructor: (IrConstructor) -> IrConstructor? = alwaysNull()
|
||||
override val getReplacementForRegularClassConstructor: (IrConstructor) -> IrConstructor? = alwaysNull()
|
||||
|
||||
override val replaceOverriddenSymbols: (IrSimpleFunction) -> List<IrSimpleFunctionSymbol> =
|
||||
storageManager.createMemoizedFunction { irSimpleFunction ->
|
||||
|
||||
+139
-142
@@ -6,14 +6,19 @@
|
||||
package org.jetbrains.kotlin.backend.jvm
|
||||
|
||||
import org.jetbrains.kotlin.backend.jvm.MemoizedMultiFieldValueClassReplacements.RemappedParameter.MultiFieldValueClassMapping
|
||||
import org.jetbrains.kotlin.backend.jvm.ir.*
|
||||
import org.jetbrains.kotlin.backend.jvm.ir.erasedUpperBound
|
||||
import org.jetbrains.kotlin.backend.jvm.ir.extensionReceiverName
|
||||
import org.jetbrains.kotlin.backend.jvm.ir.findSuperDeclaration
|
||||
import org.jetbrains.kotlin.backend.jvm.ir.isStaticValueClassReplacement
|
||||
import org.jetbrains.kotlin.descriptors.DescriptorVisibilities
|
||||
import org.jetbrains.kotlin.ir.builders.declarations.addValueParameter
|
||||
import org.jetbrains.kotlin.ir.builders.declarations.buildConstructor
|
||||
import org.jetbrains.kotlin.ir.declarations.*
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpressionBody
|
||||
import org.jetbrains.kotlin.ir.symbols.IrSimpleFunctionSymbol
|
||||
import org.jetbrains.kotlin.ir.symbols.IrTypeParameterSymbol
|
||||
import org.jetbrains.kotlin.ir.types.*
|
||||
import org.jetbrains.kotlin.ir.types.IrSimpleType
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
import org.jetbrains.kotlin.ir.types.defaultType
|
||||
import org.jetbrains.kotlin.ir.util.*
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.storage.LockBasedStorageManager
|
||||
@@ -25,8 +30,7 @@ import java.util.concurrent.ConcurrentHashMap
|
||||
*/
|
||||
class MemoizedMultiFieldValueClassReplacements(
|
||||
irFactory: IrFactory,
|
||||
context: JvmBackendContext,
|
||||
private val typeSystemContext: IrTypeSystemContext
|
||||
context: JvmBackendContext
|
||||
) : MemoizedValueClassAbstractReplacements(irFactory, context) {
|
||||
private val storageManager = LockBasedStorageManager("multi-field-value-class-replacements")
|
||||
|
||||
@@ -34,78 +38,47 @@ class MemoizedMultiFieldValueClassReplacements(
|
||||
val originalFunctionForMethodReplacement: MutableMap<IrFunction, IrFunction> = ConcurrentHashMap()
|
||||
private val originalConstructorForConstructorReplacement: MutableMap<IrConstructor, IrConstructor> = ConcurrentHashMap()
|
||||
|
||||
val getDeclarations: (IrClass) -> MultiFieldValueClassSpecificDeclarations? =
|
||||
storageManager.createMemoizedFunctionWithNullableValues {
|
||||
if (it.isMultiFieldValueClass)
|
||||
MultiFieldValueClassSpecificDeclarations(it, typeSystemContext, irFactory, context, this)
|
||||
else
|
||||
null
|
||||
}
|
||||
|
||||
val getOldMFVCProperties: (IrClass) -> List<IrProperty> = storageManager.createMemoizedFunction { irClass ->
|
||||
require(irClass.isMultiFieldValueClass) { "No need to save data for non MFVC" }
|
||||
(irClass.properties.toList().filter { it.getter?.isMultiFieldValueClassOriginalFieldGetter == true }.takeIf { it.isNotEmpty() }
|
||||
?: irClass.fields.mapNotNull { it.correspondingPropertySymbol?.owner }.toList().takeIf { it.isNotEmpty() }
|
||||
?: error("No properties found: ${irClass.render()}"))
|
||||
}
|
||||
|
||||
fun commitMFVCOldProperties(irClass: IrClass) {
|
||||
getOldMFVCProperties(irClass)
|
||||
}
|
||||
|
||||
class ValueParameterTemplate(
|
||||
val name: String,
|
||||
val type: IrType,
|
||||
val origin: IrDeclarationOrigin?,
|
||||
val defaultValue: IrExpressionBody?,
|
||||
val original: IrValueParameter, // todo don't use it as it is not always correct
|
||||
) {
|
||||
|
||||
constructor(valueParameter: IrValueParameter, origin: IrDeclarationOrigin?) : this(
|
||||
name = valueParameter.name.asString(),
|
||||
type = valueParameter.type,
|
||||
origin = origin,
|
||||
defaultValue = valueParameter.defaultValue,
|
||||
original = valueParameter,
|
||||
)
|
||||
|
||||
fun toParameter(irFunction: IrFunction, index: Int): IrValueParameter = original.copyTo(
|
||||
irFunction = irFunction,
|
||||
index = index,
|
||||
name = Name.guessByFirstCharacter(name),
|
||||
origin = origin ?: original.origin,
|
||||
defaultValue = null,
|
||||
type = type,
|
||||
).also {
|
||||
// Assuming that constructors and non-override functions are always replaced with the unboxed
|
||||
// equivalent, deep-copying the value here is unnecessary.
|
||||
it.defaultValue = defaultValue?.patchDeclarationParents(irFunction)
|
||||
}
|
||||
}
|
||||
|
||||
private fun IrFunction.makeValueParametersFromTemplate(newFlattenedParameters: List<RemappedParameter>) = newFlattenedParameters
|
||||
.flatMap { it.valueParameters }.mapIndexed { index: Int, template -> template.toParameter(this, index) }
|
||||
|
||||
private fun List<ValueParameterTemplate>.grouped(
|
||||
private fun IrValueParameter.grouped(
|
||||
name: String?,
|
||||
substitutionMap: Map<IrTypeParameterSymbol, IrType>,
|
||||
originWhenFlattenedAndNotSpecified: IrDeclarationOrigin? = IrDeclarationOrigin.GENERATED_MULTI_FIELD_VALUE_CLASS_PARAMETER
|
||||
): List<RemappedParameter> = map { parameter ->
|
||||
val declarations = parameter.type.takeIf { !it.isNullable() }?.erasedUpperBound?.let { getDeclarations(it) }
|
||||
?: return@map RemappedParameter.RegularMapping(parameter)
|
||||
require(!parameter.original.hasDefaultValue()) { "Default parameters values are not supported for multi-field value classes" }
|
||||
val localSubstitutionMap = declarations.valueClass.typeParameters.zip((parameter.type as IrSimpleType).arguments)
|
||||
.mapNotNull { (parameter, argument) -> if (argument is IrSimpleType) parameter.symbol to argument.type else null}.toMap()
|
||||
MultiFieldValueClassMapping(declarations, parameter.type.substitute(substitutionMap) as IrSimpleType, declarations.leaves.map { leaf ->
|
||||
ValueParameterTemplate(
|
||||
name = "${parameter.name}$${declarations.nodeFullNames[leaf]!!}",
|
||||
type = leaf.type.substitute(localSubstitutionMap),
|
||||
origin = parameter.origin ?: originWhenFlattenedAndNotSpecified,
|
||||
defaultValue = null,
|
||||
original = parameter.original,
|
||||
)
|
||||
})
|
||||
targetFunction: IrFunction,
|
||||
originWhenFlattened: IrDeclarationOrigin,
|
||||
): RemappedParameter {
|
||||
if (!type.needsMfvcFlattening()) return RemappedParameter.RegularMapping(
|
||||
targetFunction.addValueParameter {
|
||||
updateFrom(this@grouped)
|
||||
this.name = this@grouped.name
|
||||
index = targetFunction.valueParameters.size
|
||||
}.apply {
|
||||
copyAnnotationsFrom(this@grouped)
|
||||
}
|
||||
)
|
||||
val rootMfvcNode = this@MemoizedMultiFieldValueClassReplacements.getRootMfvcNode(type.erasedUpperBound)!!
|
||||
require(!hasDefaultValue()) { "Default parameters values are not supported for multi-field value classes" }
|
||||
val newType = type.substitute(substitutionMap) as IrSimpleType
|
||||
val localSubstitutionMap = makeTypeArgumentsFromType(newType)
|
||||
val valueParameters = rootMfvcNode.mapLeaves { leaf ->
|
||||
targetFunction.addValueParameter {
|
||||
updateFrom(this@grouped)
|
||||
this.name = Name.identifier("${name ?: this@grouped.name}-${leaf.fullFieldName}")
|
||||
type = leaf.type.substitute(localSubstitutionMap)
|
||||
origin = originWhenFlattened
|
||||
index = targetFunction.valueParameters.size
|
||||
}.apply {
|
||||
defaultValue = null
|
||||
copyAnnotationsFrom(this@grouped)
|
||||
}
|
||||
}
|
||||
return MultiFieldValueClassMapping(rootMfvcNode, newType, valueParameters)
|
||||
}
|
||||
|
||||
private fun List<IrValueParameter>.grouped(
|
||||
name: String?,
|
||||
substitutionMap: Map<IrTypeParameterSymbol, IrType>,
|
||||
targetFunction: IrFunction,
|
||||
originWhenFlattened: IrDeclarationOrigin,
|
||||
): List<RemappedParameter> = map { it.grouped(name, substitutionMap, targetFunction, originWhenFlattened) }
|
||||
|
||||
private fun buildReplacement(
|
||||
function: IrFunction,
|
||||
replacementOrigin: IrDeclarationOrigin,
|
||||
@@ -115,71 +88,78 @@ class MemoizedMultiFieldValueClassReplacements(
|
||||
origin = when {
|
||||
function.origin == IrDeclarationOrigin.GENERATED_MULTI_FIELD_VALUE_CLASS_MEMBER ->
|
||||
JvmLoweredDeclarationOrigin.MULTI_FIELD_VALUE_CLASS_GENERATED_IMPL_METHOD
|
||||
|
||||
function is IrConstructor && function.constructedClass.isMultiFieldValueClass ->
|
||||
JvmLoweredDeclarationOrigin.STATIC_MULTI_FIELD_VALUE_CLASS_CONSTRUCTOR
|
||||
|
||||
else -> replacementOrigin
|
||||
}
|
||||
name = InlineClassAbi.mangledNameFor(function, mangleReturnTypes = false, useOldMangleRules = false)
|
||||
}
|
||||
|
||||
private fun makeGroupedValueParametersFrom(
|
||||
function: IrFunction, includeDispatcherReceiver: Boolean, substitutionMap: Map<IrTypeParameterSymbol, IrType>
|
||||
private fun makeAndAddGroupedValueParametersFrom(
|
||||
sourceFunction: IrFunction,
|
||||
includeDispatcherReceiver: Boolean,
|
||||
substitutionMap: Map<IrTypeParameterSymbol, IrType>,
|
||||
targetFunction: IrFunction,
|
||||
): List<RemappedParameter> {
|
||||
val newFlattenedParameters = mutableListOf<RemappedParameter>()
|
||||
if (function.dispatchReceiverParameter != null && includeDispatcherReceiver) {
|
||||
val template = ValueParameterTemplate(
|
||||
name = "\$dispatchReceiver",
|
||||
type = function.parentAsClass.defaultType,
|
||||
origin = IrDeclarationOrigin.MOVED_DISPATCH_RECEIVER,
|
||||
defaultValue = null,
|
||||
original = function.parentAsClass.thisReceiver!!,
|
||||
if (sourceFunction.dispatchReceiverParameter != null && includeDispatcherReceiver) {
|
||||
newFlattenedParameters.add(
|
||||
sourceFunction.parentAsClass.thisReceiver!!.grouped(
|
||||
"\$dispatchReceiver",
|
||||
substitutionMap,
|
||||
targetFunction,
|
||||
IrDeclarationOrigin.MOVED_DISPATCH_RECEIVER,
|
||||
)
|
||||
)
|
||||
newFlattenedParameters.addAll(listOf(template).grouped(substitutionMap))
|
||||
}
|
||||
val contextReceivers = function.valueParameters.take(function.contextReceiverParametersCount)
|
||||
val contextReceivers = sourceFunction.valueParameters.take(sourceFunction.contextReceiverParametersCount)
|
||||
.mapIndexed { index: Int, valueParameter: IrValueParameter ->
|
||||
ValueParameterTemplate(
|
||||
name = "contextReceiver$index",
|
||||
origin = IrDeclarationOrigin.MOVED_CONTEXT_RECEIVER,
|
||||
type = valueParameter.type,
|
||||
defaultValue = valueParameter.defaultValue,
|
||||
original = valueParameter,
|
||||
valueParameter.grouped(
|
||||
"contextReceiver$index",
|
||||
substitutionMap,
|
||||
targetFunction,
|
||||
IrDeclarationOrigin.MOVED_CONTEXT_RECEIVER,
|
||||
)
|
||||
}
|
||||
.grouped(substitutionMap)
|
||||
newFlattenedParameters.addAll(contextReceivers)
|
||||
function.extensionReceiverParameter?.let {
|
||||
val template = ValueParameterTemplate(
|
||||
name = Name.identifier(function.extensionReceiverName(context.state)).asString(),
|
||||
origin = IrDeclarationOrigin.MOVED_EXTENSION_RECEIVER,
|
||||
type = it.type,
|
||||
defaultValue = it.defaultValue,
|
||||
original = it,
|
||||
sourceFunction.extensionReceiverParameter?.let {
|
||||
val newParameters = it.grouped(
|
||||
sourceFunction.extensionReceiverName(context.state),
|
||||
substitutionMap,
|
||||
targetFunction,
|
||||
IrDeclarationOrigin.MOVED_EXTENSION_RECEIVER,
|
||||
)
|
||||
newFlattenedParameters.addAll(listOf(template).grouped(substitutionMap))
|
||||
newFlattenedParameters.add(newParameters)
|
||||
}
|
||||
newFlattenedParameters += function.valueParameters.drop(function.contextReceiverParametersCount).map {
|
||||
ValueParameterTemplate(it, origin = null)
|
||||
}.grouped(substitutionMap)
|
||||
newFlattenedParameters += sourceFunction.valueParameters.drop(sourceFunction.contextReceiverParametersCount)
|
||||
.grouped(name = null, substitutionMap, targetFunction, IrDeclarationOrigin.GENERATED_MULTI_FIELD_VALUE_CLASS_PARAMETER)
|
||||
return newFlattenedParameters
|
||||
}
|
||||
|
||||
sealed class RemappedParameter {
|
||||
data class RegularMapping(val valueParameter: ValueParameterTemplate) : RemappedParameter() {
|
||||
override val valueParameters: List<ValueParameterTemplate> = listOf(valueParameter)
|
||||
|
||||
abstract val valueParameters: List<IrValueParameter>
|
||||
|
||||
data class RegularMapping(val valueParameter: IrValueParameter) : RemappedParameter() {
|
||||
override val valueParameters: List<IrValueParameter> = listOf(valueParameter)
|
||||
}
|
||||
|
||||
data class MultiFieldValueClassMapping(
|
||||
val declarations: MultiFieldValueClassSpecificDeclarations,
|
||||
val boxedType: IrSimpleType,
|
||||
override val valueParameters: List<ValueParameterTemplate>,
|
||||
val rootMfvcNode: RootMfvcNode,
|
||||
val typeArguments: TypeArguments,
|
||||
override val valueParameters: List<IrValueParameter>,
|
||||
) : RemappedParameter() {
|
||||
init {
|
||||
require(valueParameters.size > 1) { "MFVC must have > 1 fields" }
|
||||
}
|
||||
}
|
||||
|
||||
abstract val valueParameters: List<ValueParameterTemplate>
|
||||
constructor(rootMfvcNode: RootMfvcNode, type: IrSimpleType, valueParameters: List<IrValueParameter>) :
|
||||
this(rootMfvcNode, makeTypeArgumentsFromType(type), valueParameters)
|
||||
|
||||
val boxedType: IrSimpleType = rootMfvcNode.type.substitute(typeArguments) as IrSimpleType
|
||||
}
|
||||
}
|
||||
|
||||
val bindingOldFunctionToParameterTemplateStructure: MutableMap<IrFunction, List<RemappedParameter>> = ConcurrentHashMap()
|
||||
@@ -192,7 +172,7 @@ class MemoizedMultiFieldValueClassReplacements(
|
||||
return super.put(key, value)
|
||||
}
|
||||
}
|
||||
// todo inline classes pass type arguments correctly
|
||||
|
||||
override fun createStaticReplacement(function: IrFunction): IrSimpleFunction =
|
||||
buildReplacement(function, JvmLoweredDeclarationOrigin.STATIC_MULTI_FIELD_VALUE_CLASS_REPLACEMENT, noFakeOverride = true) {
|
||||
originalFunctionForStaticReplacement[this] = function
|
||||
@@ -200,8 +180,8 @@ class MemoizedMultiFieldValueClassReplacements(
|
||||
copyTypeParametersFrom(function.parentAsClass)
|
||||
val substitutionMap = function.parentAsClass.typeParameters.map { it.symbol }.zip(typeParameters.map { it.defaultType }).toMap()
|
||||
copyTypeParametersFrom(function, parameterMap = (function.parentAsClass.typeParameters zip typeParameters).toMap())
|
||||
val newFlattenedParameters = makeGroupedValueParametersFrom(function, includeDispatcherReceiver = true, substitutionMap)
|
||||
valueParameters = makeValueParametersFromTemplate(newFlattenedParameters)
|
||||
val newFlattenedParameters =
|
||||
makeAndAddGroupedValueParametersFrom(function, includeDispatcherReceiver = true, substitutionMap, this)
|
||||
bindingOldFunctionToParameterTemplateStructure[function] = newFlattenedParameters
|
||||
bindingNewFunctionToParameterTemplateStructure[this] = newFlattenedParameters
|
||||
}
|
||||
@@ -209,49 +189,32 @@ class MemoizedMultiFieldValueClassReplacements(
|
||||
override fun createMethodReplacement(function: IrFunction): IrSimpleFunction = buildReplacement(function, function.origin) {
|
||||
originalFunctionForMethodReplacement[this] = function
|
||||
dispatchReceiverParameter = function.dispatchReceiverParameter?.copyTo(this, index = -1)
|
||||
val newFlattenedParameters = makeGroupedValueParametersFrom(function, includeDispatcherReceiver = false, mapOf())
|
||||
val newFlattenedParameters = makeAndAddGroupedValueParametersFrom(function, includeDispatcherReceiver = false, mapOf(), this)
|
||||
val receiver = dispatchReceiverParameter
|
||||
val receiverTemplate = if (receiver != null) ValueParameterTemplate(receiver, origin = receiver.origin) else null
|
||||
val remappedParameters =
|
||||
if (receiverTemplate != null) listOf(RemappedParameter.RegularMapping(receiverTemplate)) + newFlattenedParameters else newFlattenedParameters
|
||||
valueParameters = makeValueParametersFromTemplate(newFlattenedParameters)
|
||||
if (receiver != null) listOf(RemappedParameter.RegularMapping(receiver)) + newFlattenedParameters else newFlattenedParameters
|
||||
bindingOldFunctionToParameterTemplateStructure[function] = remappedParameters
|
||||
bindingNewFunctionToParameterTemplateStructure[this] = remappedParameters
|
||||
}
|
||||
|
||||
private fun createConstructorReplacement(@Suppress("UNUSED_PARAMETER") constructor: IrConstructor): IrConstructor {
|
||||
val newFlattenedParameters = makeGroupedValueParametersFrom(constructor, includeDispatcherReceiver = false, mapOf())
|
||||
bindingOldFunctionToParameterTemplateStructure[constructor] = newFlattenedParameters
|
||||
private fun createConstructorReplacement(constructor: IrConstructor): IrConstructor {
|
||||
val newConstructor = irFactory.buildConstructor {
|
||||
updateFrom(constructor)
|
||||
returnType = constructor.returnType
|
||||
}.apply {
|
||||
val newFlattenedParameters = makeAndAddGroupedValueParametersFrom(constructor, includeDispatcherReceiver = false, mapOf(), this)
|
||||
bindingOldFunctionToParameterTemplateStructure[constructor] = newFlattenedParameters
|
||||
parent = constructor.parent
|
||||
copyTypeParametersFrom(constructor)
|
||||
valueParameters = makeValueParametersFromTemplate(newFlattenedParameters)
|
||||
annotations = constructor.annotations
|
||||
originalConstructorForConstructorReplacement[this] = constructor
|
||||
bindingNewFunctionToParameterTemplateStructure[this] = newFlattenedParameters
|
||||
}
|
||||
bindingNewFunctionToParameterTemplateStructure[newConstructor] = newFlattenedParameters
|
||||
return newConstructor
|
||||
}
|
||||
|
||||
private fun createGetterReplacement(function: IrFunction): IrSimpleFunction {
|
||||
val declarations = getDeclarations(function.parentAsClass)!!
|
||||
val name = (function as IrSimpleFunction).correspondingPropertySymbol!!.owner.name
|
||||
val node = declarations.loweringRepresentation[name]!!.node
|
||||
val newGetter = declarations.properties[node]!!.getter!!
|
||||
originalFunctionForMethodReplacement[newGetter] = function
|
||||
val receiver = function.dispatchReceiverParameter!!
|
||||
val receiverTemplate = ValueParameterTemplate(receiver, origin = receiver.origin)
|
||||
val parameterRemapping = listOf(RemappedParameter.RegularMapping(receiverTemplate))
|
||||
bindingOldFunctionToParameterTemplateStructure[function] = parameterRemapping
|
||||
bindingNewFunctionToParameterTemplateStructure[newGetter] = parameterRemapping
|
||||
return newGetter
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a replacement for a function or a constructor.
|
||||
* Get a function replacement for a function or a constructor.
|
||||
*/
|
||||
override val getReplacementFunction: (IrFunction) -> IrSimpleFunction? =
|
||||
storageManager.createMemoizedFunctionWithNullableValues { function ->
|
||||
@@ -262,33 +225,38 @@ class MemoizedMultiFieldValueClassReplacements(
|
||||
function.origin == IrDeclarationOrigin.GENERATED_MULTI_FIELD_VALUE_CLASS_MEMBER && function.isAccessor ||
|
||||
function.origin == JvmLoweredDeclarationOrigin.MULTI_FIELD_VALUE_CLASS_GENERATED_IMPL_METHOD ||
|
||||
function.origin.isSynthetic && function.origin != IrDeclarationOrigin.SYNTHETIC_GENERATED_SAM_IMPLEMENTATION -> null
|
||||
function.isMultiFieldValueClassOriginalFieldGetter -> createGetterReplacement(function)
|
||||
|
||||
function.parent.safeAs<IrClass>()?.isMultiFieldValueClass == true -> when {
|
||||
function.isRemoveAtSpecialBuiltinStub() ->
|
||||
null
|
||||
|
||||
function.isValueClassMemberFakeOverriddenFromJvmDefaultInterfaceMethod() ||
|
||||
function.origin == IrDeclarationOrigin.IR_BUILTINS_STUB ->
|
||||
createMethodReplacement(function)
|
||||
|
||||
else ->
|
||||
createStaticReplacement(function)
|
||||
}
|
||||
|
||||
function is IrSimpleFunction && !function.isFromJava() &&
|
||||
function.fullValueParameterList.any { it.type.isMultiFieldValueClassType() && !it.type.isNullable() } &&
|
||||
function.fullValueParameterList.any { it.type.needsMfvcFlattening() } &&
|
||||
(!function.isFakeOverride ||
|
||||
findSuperDeclaration(function, false, context.state.jvmDefaultMode)
|
||||
in bindingOldFunctionToParameterTemplateStructure) ->
|
||||
createMethodReplacement(function)
|
||||
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
override val getReplacementRegularClassConstructor: (IrConstructor) -> IrConstructor? =
|
||||
override val getReplacementForRegularClassConstructor: (IrConstructor) -> IrConstructor? =
|
||||
storageManager.createMemoizedFunctionWithNullableValues { constructor ->
|
||||
when {
|
||||
constructor.constructedClass.isMultiFieldValueClass -> null
|
||||
constructor.isFromJava() -> null
|
||||
constructor.fullValueParameterList.any { !it.type.isNullable() && it.type.isMultiFieldValueClassType() } ->
|
||||
constructor.fullValueParameterList.any { it.type.needsMfvcFlattening() } ->
|
||||
createConstructorReplacement(constructor)
|
||||
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
@@ -300,5 +268,34 @@ class MemoizedMultiFieldValueClassReplacements(
|
||||
computeOverrideReplacement(it.owner).symbol
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val getRootMfvcNode: (IrClass) -> RootMfvcNode? = storageManager.createMemoizedFunctionWithNullableValues {
|
||||
if (it.defaultType.needsMfvcFlattening()) getRootNode(context, it) else null
|
||||
}
|
||||
|
||||
val getRegularClassMfvcPropertyNode: (IrProperty) -> IntermediateMfvcNode? =
|
||||
storageManager.createMemoizedFunctionWithNullableValues { property: IrProperty ->
|
||||
val parent = property.parent
|
||||
when {
|
||||
parent !is IrClass -> null
|
||||
property.isFakeOverride -> null
|
||||
useRootNode(parent, property) -> null
|
||||
property.run { backingField?.type ?: getter?.returnType }?.needsMfvcFlattening() != true -> null
|
||||
else -> createIntermediateNodeForMfvcPropertyOfRegularClass(parent, context, property)
|
||||
}
|
||||
}
|
||||
|
||||
fun getMfvcPropertyNode(property: IrProperty): NameableMfvcNode? {
|
||||
val parent = property.parent
|
||||
return when {
|
||||
parent !is IrClass -> null
|
||||
useRootNode(parent, property) -> getRootMfvcNode(parent)!![property.name]
|
||||
else -> getRegularClassMfvcPropertyNode(property)
|
||||
}
|
||||
}
|
||||
|
||||
private fun useRootNode(
|
||||
parent: IrClass,
|
||||
property: IrProperty
|
||||
) = parent.isMultiFieldValueClass && (property.getter?.isStatic ?: property.backingField?.isStatic) == false
|
||||
}
|
||||
|
||||
+1
-1
@@ -108,7 +108,7 @@ abstract class MemoizedValueClassAbstractReplacements(protected val irFactory: I
|
||||
|
||||
abstract val replaceOverriddenSymbols: (IrSimpleFunction) -> List<IrSimpleFunctionSymbol>
|
||||
|
||||
abstract val getReplacementRegularClassConstructor: (IrConstructor) -> IrConstructor?
|
||||
abstract val getReplacementForRegularClassConstructor: (IrConstructor) -> IrConstructor?
|
||||
|
||||
protected fun computeOverrideReplacement(function: IrSimpleFunction): IrSimpleFunction =
|
||||
getReplacementFunction(function) ?: function.also {
|
||||
|
||||
@@ -0,0 +1,474 @@
|
||||
/*
|
||||
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.backend.jvm
|
||||
|
||||
import org.jetbrains.kotlin.backend.jvm.ir.erasedUpperBound
|
||||
import org.jetbrains.kotlin.backend.jvm.ir.isMultiFieldValueClassType
|
||||
import org.jetbrains.kotlin.codegen.state.KotlinTypeMapper
|
||||
import org.jetbrains.kotlin.ir.IrStatement
|
||||
import org.jetbrains.kotlin.ir.builders.IrBlockBuilder
|
||||
import org.jetbrains.kotlin.ir.builders.IrBuilderWithScope
|
||||
import org.jetbrains.kotlin.ir.builders.irCall
|
||||
import org.jetbrains.kotlin.ir.declarations.*
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||
import org.jetbrains.kotlin.ir.expressions.IrGetField
|
||||
import org.jetbrains.kotlin.ir.expressions.IrReturn
|
||||
import org.jetbrains.kotlin.ir.symbols.IrClassSymbol
|
||||
import org.jetbrains.kotlin.ir.symbols.IrTypeParameterSymbol
|
||||
import org.jetbrains.kotlin.ir.types.*
|
||||
import org.jetbrains.kotlin.ir.util.*
|
||||
import org.jetbrains.kotlin.load.java.JvmAbi
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
|
||||
typealias TypeArguments = Map<IrTypeParameterSymbol, IrType>
|
||||
|
||||
sealed interface MfvcNode {
|
||||
val type: IrType
|
||||
val leavesCount: Int
|
||||
|
||||
fun createInstanceFromBox(
|
||||
scope: IrBlockBuilder,
|
||||
typeArguments: TypeArguments,
|
||||
receiver: IrExpression?,
|
||||
isPrivateAccess: Boolean,
|
||||
saveVariable: (IrVariable) -> Unit,
|
||||
): ReceiverBasedMfvcNodeInstance
|
||||
}
|
||||
|
||||
fun MfvcNode.createInstanceFromBox(
|
||||
scope: IrBlockBuilder,
|
||||
receiver: IrExpression,
|
||||
isPrivateAccess: Boolean,
|
||||
saveVariable: (IrVariable) -> Unit
|
||||
) =
|
||||
createInstanceFromBox(scope, makeTypeArgumentsFromType(receiver.type as IrSimpleType), receiver, isPrivateAccess, saveVariable)
|
||||
|
||||
fun MfvcNode.createInstanceFromValueDeclarationsAndBoxType(
|
||||
scope: IrBuilderWithScope, type: IrSimpleType, name: Name, saveVariable: (IrVariable) -> Unit,
|
||||
): ValueDeclarationMfvcNodeInstance = createInstanceFromValueDeclarations(scope, makeTypeArgumentsFromType(type), name, saveVariable)
|
||||
|
||||
fun MfvcNode.createInstanceFromValueDeclarations(
|
||||
scope: IrBuilderWithScope, typeArguments: TypeArguments, name: Name, saveVariable: (IrVariable) -> Unit,
|
||||
): ValueDeclarationMfvcNodeInstance {
|
||||
val valueDeclarations = mapLeaves {
|
||||
scope.savableStandaloneVariable(
|
||||
type = it.type,
|
||||
name = listOf(name, it.fullFieldName).joinToString("-"),
|
||||
origin = IrDeclarationOrigin.MULTI_FIELD_VALUE_CLASS_REPRESENTATION_VARIABLE,
|
||||
saveVariable = saveVariable
|
||||
)
|
||||
}
|
||||
return ValueDeclarationMfvcNodeInstance(scope, this, typeArguments, valueDeclarations, listOf())
|
||||
}
|
||||
|
||||
fun MfvcNode.createInstanceFromValueDeclarationsAndBoxType(
|
||||
scope: IrBuilderWithScope, type: IrSimpleType, fieldValues: List<IrValueDeclaration>, initializationStatements: List<IrStatement>
|
||||
): ValueDeclarationMfvcNodeInstance =
|
||||
ValueDeclarationMfvcNodeInstance(scope, this, makeTypeArgumentsFromType(type), fieldValues, initializationStatements)
|
||||
|
||||
fun makeTypeArgumentsFromType(type: IrSimpleType): TypeArguments {
|
||||
if (type.classifierOrNull !is IrClassSymbol) return mapOf()
|
||||
val parameters = type.erasedUpperBound.typeParameters
|
||||
val arguments = type.arguments
|
||||
require(parameters.size == arguments.size) {
|
||||
"Number of type parameters (${parameters.joinToString { it.render() }}) is not equal to number of type arguments (${arguments.joinToString { it.render() }})."
|
||||
}
|
||||
return parameters.zip(arguments) { parameter, argument -> parameter.symbol to (argument.typeOrNull ?: parameter.defaultType) }.toMap()
|
||||
|
||||
}
|
||||
|
||||
private fun <Scope, IrElement, Instance> MfvcNode.createInstanceFromBoxTypeImpl(
|
||||
scope: Scope,
|
||||
boxType: IrSimpleType,
|
||||
fieldValues: List<IrElement>,
|
||||
gen: (Scope, MfvcNode, TypeArguments, List<IrElement>) -> Instance
|
||||
): Instance {
|
||||
val typeArguments = makeTypeArgumentsFromType(boxType)
|
||||
return gen(scope, this, typeArguments, fieldValues)
|
||||
}
|
||||
|
||||
sealed interface NameableMfvcNode : MfvcNode {
|
||||
val namedNodeImpl: NameableMfvcNodeImpl
|
||||
}
|
||||
|
||||
val NameableMfvcNode.nameParts: List<IndexedNamePart>
|
||||
get() = namedNodeImpl.nameParts
|
||||
val NameableMfvcNode.name: Name
|
||||
get() = nameParts.last().name
|
||||
val NameableMfvcNode.index: Int
|
||||
get() = nameParts.last().index
|
||||
val NameableMfvcNode.unboxMethod: IrSimpleFunction
|
||||
get() = namedNodeImpl.unboxMethod
|
||||
val NameableMfvcNode.fullMethodName: Name
|
||||
get() = namedNodeImpl.fullMethodName
|
||||
val NameableMfvcNode.fullFieldName: Name
|
||||
get() = namedNodeImpl.fullFieldName
|
||||
val NameableMfvcNode.hasPureUnboxMethod: Boolean
|
||||
get() = namedNodeImpl.hasPureUnboxMethod
|
||||
|
||||
|
||||
data class IndexedNamePart(val index: Int, val name: Name)
|
||||
|
||||
class NameableMfvcNodeImpl(
|
||||
rootPropertyName: String?,
|
||||
val nameParts: List<IndexedNamePart>,
|
||||
val unboxMethod: IrSimpleFunction,
|
||||
val hasPureUnboxMethod: Boolean,
|
||||
) {
|
||||
val fullMethodName = makeFullMethodName(rootPropertyName, nameParts)
|
||||
val fullFieldName = makeFullFieldName(rootPropertyName, nameParts)
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun makeFullMethodName(rootPropertyName: String?, nameParts: List<IndexedNamePart>): Name = if (rootPropertyName == null) {
|
||||
val restJoined = nameParts.joinToString("-") { it.index.toString() }
|
||||
Name.identifier("${KotlinTypeMapper.UNBOX_JVM_METHOD_NAME}-$restJoined")
|
||||
} else {
|
||||
val wholeName = (listOf(JvmAbi.getterName(rootPropertyName)) + nameParts.map { it.index.toString() }).joinToString("-")
|
||||
Name.identifier(wholeName)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun makeFullFieldName(rootPropertyName: String?, nameParts: List<IndexedNamePart>): Name {
|
||||
val joined = (listOf(rootPropertyName ?: "field") + nameParts.map { it.index.toString() }).joinToString("-")
|
||||
return Name.identifier(joined)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun MfvcNode.getSubnodeAndIndices(name: Name): Pair<NameableMfvcNode, IntRange>? {
|
||||
val node = (this as? MfvcNodeWithSubnodes)?.get(name) ?: return null
|
||||
val indices = subnodeIndices[node] ?: error("existing node without indices")
|
||||
return node to indices
|
||||
}
|
||||
|
||||
sealed interface MfvcNodeWithSubnodes : MfvcNode {
|
||||
abstract override val type: IrSimpleType
|
||||
val boxMethod: IrSimpleFunction
|
||||
val leavesUnboxMethods: List<IrSimpleFunction>?
|
||||
val subnodesImpl: MfvcNodeWithSubnodesImpl
|
||||
}
|
||||
|
||||
fun MfvcNodeWithSubnodes.makeBoxedExpression(
|
||||
scope: IrBuilderWithScope, typeArguments: TypeArguments, valueArguments: List<IrExpression>
|
||||
): IrExpression = scope.irCall(boxMethod).apply {
|
||||
val resultType = type.substitute(typeArguments) as IrSimpleType
|
||||
require(resultType.erasedUpperBound == type.erasedUpperBound) { "Substitution of $type led to $resultType" }
|
||||
for ((index, typeArgument) in resultType.arguments.withIndex()) {
|
||||
putTypeArgument(index, typeArgument.typeOrNull ?: resultType.erasedUpperBound.typeParameters[index].defaultType)
|
||||
}
|
||||
for ((index, valueArgument) in valueArguments.withIndex()) {
|
||||
putValueArgument(index, valueArgument)
|
||||
}
|
||||
}
|
||||
|
||||
operator fun MfvcNodeWithSubnodes.get(names: List<Name>): MfvcNode? {
|
||||
var cur: MfvcNode = this
|
||||
for (name in names) {
|
||||
cur = (cur as? MfvcNodeWithSubnodes)?.get(name) ?: return null
|
||||
}
|
||||
return cur
|
||||
}
|
||||
|
||||
private fun List<Any>.allEqual() = all { it == first() }
|
||||
|
||||
class MfvcNodeWithSubnodesImpl(val subnodes: List<NameableMfvcNode>, unboxMethod: IrSimpleFunction?) {
|
||||
init {
|
||||
require(subnodes.isNotEmpty())
|
||||
require(subnodes.map { it.nameParts.dropLast(1) }.allEqual())
|
||||
require(subnodes.map { it.index } == subnodes.indices.toList())
|
||||
}
|
||||
|
||||
private val mapping = subnodes.associateBy { it.name }.also { mapping ->
|
||||
require(mapping.size == subnodes.size) {
|
||||
subnodes
|
||||
.groupBy { it.name }
|
||||
.filterValues { it.size > 1 }
|
||||
.entries.joinToString(prefix = "Repeating node names found: ") { (name, nodes) -> "${nodes.size} nodes with name '$name'" }
|
||||
}
|
||||
}
|
||||
|
||||
operator fun get(name: Name): NameableMfvcNode? = mapping[name]
|
||||
val leaves: List<LeafMfvcNode> = mapLeaves { it }
|
||||
val fields: List<IrField>? = mapLeaves { it.field }.run {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
when {
|
||||
all { it == null } -> null
|
||||
all { it != null } -> this as List<IrField>
|
||||
else -> error("IrFields can either exist all or none for MFVC property")
|
||||
}
|
||||
}
|
||||
|
||||
val allInnerUnboxMethods: List<IrSimpleFunction> = subnodes.flatMap { subnode ->
|
||||
when (subnode) {
|
||||
is MfvcNodeWithSubnodes -> subnode.allUnboxMethods
|
||||
is LeafMfvcNode -> listOf(subnode.unboxMethod)
|
||||
}
|
||||
}
|
||||
|
||||
val allUnboxMethods = allInnerUnboxMethods + listOfNotNull(unboxMethod)
|
||||
|
||||
val indices: IntRange = leaves.indices
|
||||
|
||||
val subnodeIndices: Map<NameableMfvcNode, IntRange> = buildMap {
|
||||
var offset = 0
|
||||
for (node in subnodes) {
|
||||
when (node) {
|
||||
is IntermediateMfvcNode -> {
|
||||
val nodeSize = node.leavesCount
|
||||
put(node, offset until offset + nodeSize)
|
||||
putAll(node.subnodeIndices.mapValues { (_, v) -> (v.first + offset)..(v.last + offset) })
|
||||
offset += nodeSize
|
||||
}
|
||||
|
||||
is LeafMfvcNode -> {
|
||||
put(node, offset..offset)
|
||||
offset++
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val MfvcNodeWithSubnodes.subnodes: List<NameableMfvcNode>
|
||||
get() = subnodesImpl.subnodes
|
||||
|
||||
operator fun MfvcNodeWithSubnodes.get(name: Name): NameableMfvcNode? = subnodesImpl[name]
|
||||
val MfvcNodeWithSubnodes.leaves: List<LeafMfvcNode>
|
||||
get() = subnodesImpl.leaves
|
||||
val MfvcNodeWithSubnodes.fields: List<IrField>?
|
||||
get() = subnodesImpl.fields
|
||||
val RootMfvcNode.fields: List<IrField>
|
||||
get() = subnodesImpl.fields!!
|
||||
val MfvcNodeWithSubnodes.indices: IntRange
|
||||
get() = subnodesImpl.indices
|
||||
val MfvcNodeWithSubnodes.subnodeIndices: Map<NameableMfvcNode, IntRange>
|
||||
get() = subnodesImpl.subnodeIndices
|
||||
val MfvcNodeWithSubnodes.allUnboxMethods: List<IrSimpleFunction>
|
||||
get() = subnodesImpl.allUnboxMethods
|
||||
val MfvcNodeWithSubnodes.allInnerUnboxMethods: List<IrSimpleFunction>
|
||||
get() = subnodesImpl.allInnerUnboxMethods
|
||||
|
||||
inline fun <R> MfvcNode.mapLeaves(crossinline f: (LeafMfvcNode) -> R): List<R> = flatMapLeaves { listOf(f(it)) }
|
||||
|
||||
fun <R> MfvcNode.flatMapLeaves(f: (LeafMfvcNode) -> List<R>): List<R> = when (this) {
|
||||
is MfvcNodeWithSubnodes -> subnodes.flatMap { it.flatMapLeaves(f) }
|
||||
is LeafMfvcNode -> f(this)
|
||||
}
|
||||
|
||||
inline fun <R> MfvcNodeWithSubnodesImpl.mapLeaves(crossinline f: (LeafMfvcNode) -> R): List<R> = subnodes.flatMap { it.mapLeaves(f) }
|
||||
|
||||
|
||||
private fun requireSameClasses(vararg classes: IrClass?) {
|
||||
val notNulls = classes.filterNotNull()
|
||||
require(notNulls.zipWithNext { a, b -> a == b }.all { it }) {
|
||||
"Found different classes: ${notNulls.joinToString("\n") { it.render() }}"
|
||||
}
|
||||
}
|
||||
|
||||
private fun requireSameTypes(vararg types: List<IrType>) {
|
||||
require(types.asList().zipWithNext { a, b -> a == b }.all { it }) {
|
||||
"Found different types: ${types.joinToString("\n") { list -> list.map { it.render() }.toString() }}"
|
||||
}
|
||||
}
|
||||
|
||||
private fun requireSameSizes(vararg sizes: Int) {
|
||||
require(sizes.asList().zipWithNext { a, b -> a == b }.all { it }) {
|
||||
"Found different sizes: ${sizes.joinToString()}"
|
||||
}
|
||||
}
|
||||
|
||||
private fun validateGettingAccessorParameters(function: IrSimpleFunction) {
|
||||
require(function.valueParameters.isEmpty()) { "Value parameters are not expected for ${function.render()}" }
|
||||
require(function.extensionReceiverParameter == null) { "Extension receiver is not expected for ${function.render()}" }
|
||||
require(function.contextReceiverParametersCount == 0) { "Context receivers is not expected for ${function.render()}" }
|
||||
require(function.typeParameters.isEmpty()) { "Type parameters are not expected for ${function.render()}" }
|
||||
}
|
||||
|
||||
class LeafMfvcNode(
|
||||
override val type: IrType,
|
||||
rootPropertyName: String?,
|
||||
nameParts: List<IndexedNamePart>,
|
||||
val field: IrField?,
|
||||
unboxMethod: IrSimpleFunction,
|
||||
hasPureUnboxMethod: Boolean,
|
||||
) : NameableMfvcNode {
|
||||
override val namedNodeImpl: NameableMfvcNodeImpl = NameableMfvcNodeImpl(rootPropertyName, nameParts, unboxMethod, hasPureUnboxMethod)
|
||||
|
||||
override val leavesCount: Int
|
||||
get() = 1
|
||||
|
||||
init {
|
||||
requireSameClasses(
|
||||
field?.parentAsClass?.takeUnless { unboxMethod.parentAsClass.isCompanion },
|
||||
unboxMethod.parentAsClass,
|
||||
(unboxMethod.dispatchReceiverParameter?.type as? IrSimpleType)?.erasedUpperBound,
|
||||
)
|
||||
validateGettingAccessorParameters(unboxMethod)
|
||||
}
|
||||
|
||||
override fun createInstanceFromBox(
|
||||
scope: IrBlockBuilder,
|
||||
typeArguments: TypeArguments,
|
||||
receiver: IrExpression?,
|
||||
isPrivateAccess: Boolean,
|
||||
saveVariable: (IrVariable) -> Unit,
|
||||
) = ReceiverBasedMfvcNodeInstance(
|
||||
scope, this, typeArguments, receiver, field?.let(::listOf), unboxMethod, isPrivateAccess, saveVariable
|
||||
)
|
||||
|
||||
override fun toString(): String = "$fullFieldName: ${type.render()}"
|
||||
}
|
||||
|
||||
val MfvcNode.fields
|
||||
get() = when (this) {
|
||||
is MfvcNodeWithSubnodes -> this.fields
|
||||
is LeafMfvcNode -> field?.let(::listOf)
|
||||
}
|
||||
|
||||
class IntermediateMfvcNode(
|
||||
override val type: IrSimpleType,
|
||||
rootPropertyName: String?,
|
||||
nameParts: List<IndexedNamePart>,
|
||||
subnodes: List<NameableMfvcNode>,
|
||||
unboxMethod: IrSimpleFunction,
|
||||
hasPureUnboxMethod: Boolean,
|
||||
val rootNode: RootMfvcNode, // root node corresponding type of the node
|
||||
) : NameableMfvcNode, MfvcNodeWithSubnodes {
|
||||
override val namedNodeImpl: NameableMfvcNodeImpl = NameableMfvcNodeImpl(rootPropertyName, nameParts, unboxMethod, hasPureUnboxMethod)
|
||||
override val subnodesImpl: MfvcNodeWithSubnodesImpl = MfvcNodeWithSubnodesImpl(subnodes, unboxMethod)
|
||||
override val leavesCount
|
||||
get() = leaves.size
|
||||
|
||||
init {
|
||||
require(type.needsMfvcFlattening()) { "MFVC type expected but got% ${type.render()}" }
|
||||
require(type.erasedUpperBound == rootNode.mfvc) {
|
||||
"Root node must point at the RootNode of class ${type.erasedUpperBound.render()} but points at ${rootNode.mfvc.render()}"
|
||||
}
|
||||
requireSameClasses(
|
||||
unboxMethod.parentAsClass,
|
||||
(unboxMethod.dispatchReceiverParameter?.type as IrSimpleType?)?.erasedUpperBound,
|
||||
)
|
||||
validateGettingAccessorParameters(unboxMethod)
|
||||
}
|
||||
|
||||
override val boxMethod: IrSimpleFunction
|
||||
get() = rootNode.boxMethod
|
||||
|
||||
override val leavesUnboxMethods: List<IrSimpleFunction> = collectLeavesUnboxMethods()
|
||||
|
||||
override fun createInstanceFromBox(
|
||||
scope: IrBlockBuilder,
|
||||
typeArguments: TypeArguments,
|
||||
receiver: IrExpression?,
|
||||
isPrivateAccess: Boolean,
|
||||
saveVariable: (IrVariable) -> Unit,
|
||||
) = ReceiverBasedMfvcNodeInstance(
|
||||
scope, this, typeArguments, receiver, fields, unboxMethod, isPrivateAccess, saveVariable
|
||||
)
|
||||
|
||||
override fun toString(): String =
|
||||
"$fullFieldName: ${type.render()}\n${subnodes.joinToString("\n").prependIndent(" ")}"
|
||||
}
|
||||
|
||||
private fun MfvcNodeWithSubnodes.collectLeavesUnboxMethods() = mapLeaves { it.unboxMethod }
|
||||
|
||||
fun IrSimpleFunction.isDefaultGetter(expectedField: IrField? = null): Boolean {
|
||||
if (!isGetter) return false
|
||||
if (expectedField != null && correspondingPropertySymbol?.owner?.backingField != expectedField) return false
|
||||
val statement = (body?.statements?.singleOrNull() as? IrReturn)?.value as? IrGetField ?: return false
|
||||
val actualField = statement.symbol.owner
|
||||
return expectedField == null || actualField == expectedField || parentAsClass.isCompanion && actualField.correspondingPropertySymbol == correspondingPropertySymbol
|
||||
}
|
||||
|
||||
fun IrSimpleFunction.getGetterField(): IrField? {
|
||||
if (!isGetter) return null
|
||||
val statement = (body?.statements?.singleOrNull() as? IrReturn)?.value as? IrGetField ?: return null
|
||||
return statement.symbol.owner
|
||||
}
|
||||
|
||||
class RootMfvcNode internal constructor(
|
||||
val mfvc: IrClass,
|
||||
subnodes: List<NameableMfvcNode>,
|
||||
val oldPrimaryConstructor: IrConstructor,
|
||||
val newPrimaryConstructor: IrConstructor,
|
||||
val primaryConstructorImpl: IrSimpleFunction,
|
||||
override val boxMethod: IrSimpleFunction,
|
||||
val specializedEqualsMethod: IrSimpleFunction,
|
||||
) : MfvcNodeWithSubnodes {
|
||||
override val subnodesImpl: MfvcNodeWithSubnodesImpl = MfvcNodeWithSubnodesImpl(subnodes, null)
|
||||
override val type: IrSimpleType = mfvc.defaultType
|
||||
|
||||
override val leavesCount: Int
|
||||
get() = leaves.size
|
||||
|
||||
override val leavesUnboxMethods: List<IrSimpleFunction> = collectLeavesUnboxMethods()
|
||||
|
||||
init {
|
||||
require(type.needsMfvcFlattening()) { "MFVC type expected but got% ${type.render()}" }
|
||||
for (constructor in listOf(oldPrimaryConstructor, newPrimaryConstructor)) {
|
||||
require(constructor.isPrimary) { "Expected a primary constructor but got:\n${constructor.dump()}" }
|
||||
}
|
||||
requireSameClasses(
|
||||
mfvc,
|
||||
oldPrimaryConstructor.parentAsClass,
|
||||
newPrimaryConstructor.parentAsClass,
|
||||
primaryConstructorImpl.parentAsClass,
|
||||
boxMethod.parentAsClass,
|
||||
specializedEqualsMethod.parentAsClass,
|
||||
oldPrimaryConstructor.constructedClass,
|
||||
newPrimaryConstructor.constructedClass,
|
||||
boxMethod.returnType.erasedUpperBound,
|
||||
)
|
||||
require(primaryConstructorImpl.returnType.isUnit()) {
|
||||
"Constructor-impl must return Unit but returns ${primaryConstructorImpl.returnType.render()}"
|
||||
}
|
||||
require(specializedEqualsMethod.returnType.isBoolean()) {
|
||||
"Specialized equals method must return Boolean but returns ${primaryConstructorImpl.returnType.render()}"
|
||||
}
|
||||
require(oldPrimaryConstructor.typeParameters.isEmpty() && newPrimaryConstructor.typeParameters.isEmpty()) {
|
||||
"Constructors do not support type parameters yet"
|
||||
}
|
||||
requireSameSizes(
|
||||
mfvc.typeParameters.size,
|
||||
boxMethod.typeParameters.size,
|
||||
primaryConstructorImpl.typeParameters.size,
|
||||
)
|
||||
require(specializedEqualsMethod.typeParameters.size == 2 * mfvc.typeParameters.size) {
|
||||
"Specialized equals method must contain twice more type parameters than corresponding MFVC ${mfvc.typeParameters.map { it.defaultType.render() }} but has ${specializedEqualsMethod.typeParameters.map { it.defaultType.render() }}"
|
||||
}
|
||||
requireSameSizes(oldPrimaryConstructor.valueParameters.size, subnodes.size)
|
||||
requireSameSizes(
|
||||
leavesCount,
|
||||
newPrimaryConstructor.valueParameters.size,
|
||||
primaryConstructorImpl.valueParameters.size,
|
||||
boxMethod.valueParameters.size,
|
||||
)
|
||||
require(specializedEqualsMethod.valueParameters.size == 2 * leavesCount) {
|
||||
"Specialized equals method must contain twice more value parameters than corresponding primary constructor of the MFVC ${mfvc.typeParameters.map { it.defaultType.render() }} but has ${specializedEqualsMethod.typeParameters.map { it.defaultType.render() }}"
|
||||
}
|
||||
for (function in listOf(oldPrimaryConstructor, newPrimaryConstructor, primaryConstructorImpl, boxMethod, specializedEqualsMethod)) {
|
||||
require(function.extensionReceiverParameter == null) { "Extension receiver is not expected for ${function.render()}" }
|
||||
require(function.contextReceiverParametersCount == 0) { "Context receivers are not expected for ${function.render()}" }
|
||||
}
|
||||
}
|
||||
|
||||
override fun createInstanceFromBox(
|
||||
scope: IrBlockBuilder,
|
||||
typeArguments: TypeArguments,
|
||||
receiver: IrExpression?,
|
||||
isPrivateAccess: Boolean,
|
||||
saveVariable: (IrVariable) -> Unit,
|
||||
) = ReceiverBasedMfvcNodeInstance(scope, this, typeArguments, receiver, fields, null, isPrivateAccess, saveVariable)
|
||||
|
||||
override fun toString(): String =
|
||||
"${type.render()}\n${subnodes.joinToString("\n").prependIndent(" ")}"
|
||||
}
|
||||
|
||||
fun IrType.needsMfvcFlattening(): Boolean = isMultiFieldValueClassType() && !isNullable() ||
|
||||
classifierOrNull.let { classifier ->
|
||||
classifier is IrTypeParameterSymbol && classifier.owner.superTypes.any { it.needsMfvcFlattening() }
|
||||
} // add not is annotated as @UseBox etc
|
||||
@@ -0,0 +1,486 @@
|
||||
/*
|
||||
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.backend.jvm
|
||||
|
||||
import org.jetbrains.kotlin.backend.common.lower.createIrBuilder
|
||||
import org.jetbrains.kotlin.backend.common.lower.irBlockBody
|
||||
import org.jetbrains.kotlin.backend.common.lower.parents
|
||||
import org.jetbrains.kotlin.backend.jvm.ir.createJvmIrBuilder
|
||||
import org.jetbrains.kotlin.backend.jvm.ir.erasedUpperBound
|
||||
import org.jetbrains.kotlin.codegen.state.KotlinTypeMapper
|
||||
import org.jetbrains.kotlin.descriptors.DescriptorVisibilities
|
||||
import org.jetbrains.kotlin.descriptors.Modality
|
||||
import org.jetbrains.kotlin.descriptors.MultiFieldValueClassRepresentation
|
||||
import org.jetbrains.kotlin.ir.IrElement
|
||||
import org.jetbrains.kotlin.ir.builders.*
|
||||
import org.jetbrains.kotlin.ir.builders.declarations.addValueParameter
|
||||
import org.jetbrains.kotlin.ir.builders.declarations.buildConstructor
|
||||
import org.jetbrains.kotlin.ir.builders.declarations.buildField
|
||||
import org.jetbrains.kotlin.ir.builders.declarations.buildFun
|
||||
import org.jetbrains.kotlin.ir.declarations.*
|
||||
import org.jetbrains.kotlin.ir.deepCopyWithVariables
|
||||
import org.jetbrains.kotlin.ir.expressions.IrConstructorCall
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||
import org.jetbrains.kotlin.ir.types.IrSimpleType
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
import org.jetbrains.kotlin.ir.types.defaultType
|
||||
import org.jetbrains.kotlin.ir.util.*
|
||||
import org.jetbrains.kotlin.load.java.JvmAbi
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.resolve.InlineClassDescriptorResolver
|
||||
|
||||
fun createLeafMfvcNode(
|
||||
parent: IrDeclarationContainer,
|
||||
context: JvmBackendContext,
|
||||
type: IrType,
|
||||
rootPropertyName: String?,
|
||||
nameParts: List<IndexedNamePart>,
|
||||
fieldAnnotations: List<IrConstructorCall>,
|
||||
static: Boolean,
|
||||
overriddenNode: LeafMfvcNode?,
|
||||
defaultMethodsImplementationSourceNode: Pair<IrSimpleFunction?, LeafMfvcNode>?, // used if the getter was custom and need to call it.
|
||||
oldGetter: IrSimpleFunction?,
|
||||
modality: Modality,
|
||||
oldPropertyBackingField: IrField?,
|
||||
): LeafMfvcNode {
|
||||
require(!type.needsMfvcFlattening()) { "${type.render()} requires flattening" }
|
||||
|
||||
val fullMethodName = NameableMfvcNodeImpl.makeFullMethodName(rootPropertyName, nameParts)
|
||||
val fullFieldName = NameableMfvcNodeImpl.makeFullFieldName(rootPropertyName, nameParts)
|
||||
|
||||
val field = oldPropertyBackingField?.let { oldBackingField ->
|
||||
context.irFactory.buildField {
|
||||
updateFrom(oldBackingField)
|
||||
this.name = fullFieldName
|
||||
this.type = type
|
||||
this.visibility = DescriptorVisibilities.PRIVATE
|
||||
this.metadata = null
|
||||
}.apply {
|
||||
this.parent = oldBackingField.parent
|
||||
this.annotations = fieldAnnotations.map { it.deepCopyWithVariables() }
|
||||
}
|
||||
}
|
||||
|
||||
val unboxMethod = makeUnboxMethod(
|
||||
context,
|
||||
fullMethodName,
|
||||
type,
|
||||
parent,
|
||||
overriddenNode,
|
||||
static,
|
||||
defaultMethodsImplementationSourceNode,
|
||||
oldGetter,
|
||||
modality,
|
||||
) { receiver -> irGetField(if (field!!.isStatic) null else irGet(receiver!!), field) }
|
||||
|
||||
return LeafMfvcNode(type, rootPropertyName, nameParts, field, unboxMethod, defaultMethodsImplementationSourceNode.isPure())
|
||||
}
|
||||
|
||||
private fun Pair<IrSimpleFunction?, NameableMfvcNode>?.isPure(): Boolean {
|
||||
val (outer, inner) = this ?: return true
|
||||
return outer == null && inner.hasPureUnboxMethod
|
||||
}
|
||||
|
||||
private fun makeUnboxMethod(
|
||||
context: JvmBackendContext,
|
||||
fullMethodName: Name,
|
||||
type: IrType,
|
||||
parent: IrDeclarationParent,
|
||||
overriddenNode: NameableMfvcNode?,
|
||||
static: Boolean,
|
||||
defaultMethodsImplementationSourceNode: Pair<IrSimpleFunction?, NameableMfvcNode>?,
|
||||
oldGetter: IrSimpleFunction?,
|
||||
modality: Modality,
|
||||
makeOptimizedExpression: IrBuilderWithScope.(receiver: IrValueDeclaration?) -> IrExpression,
|
||||
): IrSimpleFunction {
|
||||
val res = oldGetter ?: context.irFactory.buildFun {
|
||||
this.name = fullMethodName
|
||||
this.origin = JvmLoweredDeclarationOrigin.SYNTHETIC_MULTI_FIELD_VALUE_CLASS_MEMBER
|
||||
this.returnType = type
|
||||
this.modality = modality
|
||||
}.apply {
|
||||
this.parent = parent
|
||||
overriddenSymbols = overriddenNode?.let { it.unboxMethod.overriddenSymbols + it.unboxMethod.symbol } ?: listOf()
|
||||
if (!static) {
|
||||
createDispatchReceiverParameter()
|
||||
}
|
||||
}
|
||||
|
||||
return res.apply {
|
||||
body = with(context.createJvmIrBuilder(this.symbol)) {
|
||||
val receiver = dispatchReceiverParameter
|
||||
if (defaultMethodsImplementationSourceNode == null) {
|
||||
irExprBody(makeOptimizedExpression(receiver))
|
||||
} else {
|
||||
val (outer, inner) = defaultMethodsImplementationSourceNode
|
||||
val receiverExpression = receiver?.let { irGet(it) }
|
||||
val outerCall = if (outer == null) receiverExpression else irCall(outer).apply { dispatchReceiver = receiverExpression }
|
||||
val innerCall = irCall(inner.unboxMethod).apply { dispatchReceiver = outerCall }
|
||||
irExprBody(innerCall)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun createNameableMfvcNodes(
|
||||
parent: IrDeclarationContainer,
|
||||
context: JvmBackendContext,
|
||||
type: IrSimpleType,
|
||||
typeArguments: TypeArguments,
|
||||
rootPropertyName: String?,
|
||||
nameParts: List<IndexedNamePart>,
|
||||
fieldAnnotations: List<IrConstructorCall>,
|
||||
static: Boolean,
|
||||
overriddenNode: NameableMfvcNode?,
|
||||
defaultMethodsImplementationSourceNode: Pair<IrSimpleFunction?, NameableMfvcNode>?, // used if the getter was custom and need to call it.
|
||||
oldGetter: IrSimpleFunction?,
|
||||
modality: Modality,
|
||||
oldPropertyBackingField: IrField?,
|
||||
): NameableMfvcNode = if (type.needsMfvcFlattening()) createIntermediateMfvcNode(
|
||||
parent,
|
||||
context,
|
||||
type,
|
||||
typeArguments,
|
||||
rootPropertyName,
|
||||
nameParts,
|
||||
fieldAnnotations,
|
||||
static,
|
||||
overriddenNode as IntermediateMfvcNode?,
|
||||
defaultMethodsImplementationSourceNode?.let { (outer, inner) -> outer to (inner as IntermediateMfvcNode) },
|
||||
oldGetter,
|
||||
modality,
|
||||
oldPropertyBackingField,
|
||||
) else createLeafMfvcNode(
|
||||
parent,
|
||||
context,
|
||||
type,
|
||||
rootPropertyName,
|
||||
nameParts,
|
||||
fieldAnnotations,
|
||||
static,
|
||||
overriddenNode as LeafMfvcNode?,
|
||||
defaultMethodsImplementationSourceNode?.let { (outer, inner) -> outer to (inner as LeafMfvcNode) },
|
||||
oldGetter,
|
||||
modality,
|
||||
oldPropertyBackingField
|
||||
)
|
||||
|
||||
fun createIntermediateMfvcNode(
|
||||
parent: IrDeclarationContainer,
|
||||
context: JvmBackendContext,
|
||||
type: IrSimpleType,
|
||||
typeArguments: TypeArguments,
|
||||
rootPropertyName: String?,
|
||||
nameParts: List<IndexedNamePart>,
|
||||
fieldAnnotations: List<IrConstructorCall>,
|
||||
static: Boolean,
|
||||
overriddenNode: IntermediateMfvcNode?,
|
||||
defaultMethodsImplementationSourceNode: Pair<IrSimpleFunction?, IntermediateMfvcNode>?, // used if the getter was custom and need to call it.
|
||||
oldGetter: IrSimpleFunction?,
|
||||
modality: Modality,
|
||||
oldPropertyBackingField: IrField?,
|
||||
): IntermediateMfvcNode {
|
||||
require(type.needsMfvcFlattening()) { "${type.render()} does not require flattening" }
|
||||
val valueClass = type.erasedUpperBound
|
||||
val representation = valueClass.multiFieldValueClassRepresentation!!
|
||||
|
||||
val replacements = context.multiFieldValueClassReplacements
|
||||
val rootNode = replacements.getRootMfvcNode(valueClass)!!
|
||||
|
||||
val oldField = oldGetter?.correspondingPropertySymbol?.owner?.backingField
|
||||
|
||||
val shadowBackingFieldProperty = if (oldField == null) oldGetter?.getGetterField()?.correspondingPropertySymbol?.owner else null
|
||||
val useOldGetter = oldGetter != null && (oldField == null || !oldGetter.isDefaultGetter(oldField))
|
||||
|
||||
val subnodes = representation.underlyingPropertyNamesToTypes.mapIndexed { index, (name, type) ->
|
||||
val newType = type.substitute(typeArguments) as IrSimpleType
|
||||
val newTypeArguments = typeArguments.toMutableMap().apply { putAll(makeTypeArgumentsFromType(newType)) }
|
||||
val newDefaultMethodsImplementationSourceNode = when {
|
||||
defaultMethodsImplementationSourceNode != null -> {
|
||||
val (outer, inner) = defaultMethodsImplementationSourceNode
|
||||
require(!useOldGetter) { "Multiple non-default getters:\n\n${outer?.dump()}\n\n${oldGetter?.dump()}" }
|
||||
outer to inner[name]!!
|
||||
}
|
||||
|
||||
shadowBackingFieldProperty != null -> null to replacements.getMfvcPropertyNode(shadowBackingFieldProperty)!!
|
||||
useOldGetter -> oldGetter!! to rootNode[name]!!
|
||||
else -> null
|
||||
}
|
||||
createNameableMfvcNodes(
|
||||
parent,
|
||||
context,
|
||||
newType,
|
||||
newTypeArguments,
|
||||
rootPropertyName,
|
||||
nameParts + IndexedNamePart(index, name),
|
||||
fieldAnnotations,
|
||||
static,
|
||||
overriddenNode?.let { it[name]!! },
|
||||
newDefaultMethodsImplementationSourceNode,
|
||||
null,
|
||||
modality,
|
||||
oldPropertyBackingField,
|
||||
)
|
||||
}
|
||||
|
||||
val fullMethodName = NameableMfvcNodeImpl.makeFullMethodName(rootPropertyName, nameParts)
|
||||
|
||||
val unboxMethod = if (useOldGetter) oldGetter!! else makeUnboxMethod(
|
||||
context, fullMethodName, type, parent, overriddenNode, static, defaultMethodsImplementationSourceNode, oldGetter, modality
|
||||
) { receiver ->
|
||||
val valueArguments = subnodes.flatMap { it.fields!! }.map { field -> irGetField(if (field.isStatic) null else irGet(receiver!!), field) }
|
||||
rootNode.makeBoxedExpression(this, typeArguments, valueArguments)
|
||||
}
|
||||
|
||||
return IntermediateMfvcNode(
|
||||
type, rootPropertyName, nameParts, subnodes, unboxMethod, defaultMethodsImplementationSourceNode.isPure(), rootNode
|
||||
)
|
||||
}
|
||||
|
||||
fun collectPropertiesAfterLowering(irClass: IrClass) = LinkedHashSet<IrProperty>().apply {
|
||||
for (element in irClass.declarations) {
|
||||
if (element is IrField) {
|
||||
element.correspondingPropertySymbol?.owner?.let { add(it) }
|
||||
} else if (element is IrSimpleFunction) {
|
||||
element.correspondingPropertySymbol?.owner?.let { add(it) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun IrProperty.isStatic(currentContainer: IrDeclarationContainer) =
|
||||
getterIfDeclared(currentContainer)?.isStatic ?: backingField?.isStatic ?: error("Property without both getter and backing field")
|
||||
|
||||
fun getRootNode(context: JvmBackendContext, mfvc: IrClass): RootMfvcNode {
|
||||
require(mfvc.isMultiFieldValueClass) { "${mfvc.defaultType.render()} does not require flattening" }
|
||||
val oldPrimaryConstructor = mfvc.primaryConstructor!!
|
||||
val representation = mfvc.multiFieldValueClassRepresentation!!
|
||||
val properties = collectPropertiesAfterLowering(mfvc).associateBy { it.isStatic(mfvc) to it.name }
|
||||
|
||||
val subnodes = makeRootMfvcNodeSubnodes(representation, properties, context, mfvc)
|
||||
|
||||
val mfvcNodeWithSubnodesImpl = MfvcNodeWithSubnodesImpl(subnodes, null)
|
||||
val leaves = mfvcNodeWithSubnodesImpl.leaves
|
||||
val fields = mfvcNodeWithSubnodesImpl.fields!!
|
||||
|
||||
val newPrimaryConstructor = makeMfvcPrimaryConstructor(context, oldPrimaryConstructor, mfvc, leaves, fields)
|
||||
val primaryConstructorImpl = makePrimaryConstructorImpl(context, oldPrimaryConstructor, mfvc, leaves)
|
||||
val boxMethod = makeBoxMethod(context, mfvc, leaves, newPrimaryConstructor)
|
||||
val specializedEqualsMethod = makeSpecializedEqualsMethod(context, mfvc, leaves)
|
||||
|
||||
return RootMfvcNode(
|
||||
mfvc, subnodes, oldPrimaryConstructor, newPrimaryConstructor, primaryConstructorImpl, boxMethod, specializedEqualsMethod
|
||||
)
|
||||
}
|
||||
|
||||
private fun makeSpecializedEqualsMethod(
|
||||
context: JvmBackendContext,
|
||||
mfvc: IrClass,
|
||||
leaves: List<LeafMfvcNode>
|
||||
) = context.irFactory.buildFun {
|
||||
name = InlineClassDescriptorResolver.SPECIALIZED_EQUALS_NAME
|
||||
// TODO: Revisit this once we allow user defined equals methods in value classes.
|
||||
origin = JvmLoweredDeclarationOrigin.MULTI_FIELD_VALUE_CLASS_GENERATED_IMPL_METHOD
|
||||
returnType = context.irBuiltIns.booleanType
|
||||
}.apply {
|
||||
parent = mfvc
|
||||
copyTypeParametersFrom(mfvc)
|
||||
val typeParametersHalf1 = typeParameters.apply {
|
||||
for (it in this) {
|
||||
it.name = Name.guessByFirstCharacter("${it.name.asString()}1")
|
||||
}
|
||||
}
|
||||
|
||||
copyTypeParametersFrom(mfvc)
|
||||
val typeParametersHalf2 = typeParameters.drop(typeParametersHalf1.size).apply {
|
||||
for (it in this) {
|
||||
it.name = Name.guessByFirstCharacter("${it.name.asString()}2")
|
||||
}
|
||||
}
|
||||
|
||||
val valueParametersHalf1 = leaves.map { leaf ->
|
||||
addValueParameter {
|
||||
this.name = Name.guessByFirstCharacter(
|
||||
"${InlineClassDescriptorResolver.SPECIALIZED_EQUALS_FIRST_PARAMETER_NAME}$${leaf.fullFieldName}"
|
||||
)
|
||||
this.type = leaf.type.substitute(mfvc.typeParameters, typeParametersHalf1.map { it.defaultType })
|
||||
}
|
||||
}
|
||||
|
||||
val valueParametersHalf2 = leaves.map { leaf ->
|
||||
addValueParameter {
|
||||
this.name = Name.guessByFirstCharacter(
|
||||
"${InlineClassDescriptorResolver.SPECIALIZED_EQUALS_SECOND_PARAMETER_NAME}$${leaf.fullFieldName}"
|
||||
)
|
||||
this.type = leaf.type.substitute(mfvc.typeParameters, typeParametersHalf2.map { it.defaultType })
|
||||
}
|
||||
}
|
||||
|
||||
body = with(context.createJvmIrBuilder(this.symbol)) {
|
||||
val conjunctions = valueParametersHalf1.zip(valueParametersHalf2) { f1, f2 -> irEquals(irGet(f1), irGet(f2)) }
|
||||
irExprBody(conjunctions.reduce { acc, current ->
|
||||
irCall(context.irBuiltIns.andandSymbol).apply {
|
||||
putValueArgument(0, acc)
|
||||
putValueArgument(1, current)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
private fun makeBoxMethod(
|
||||
context: JvmBackendContext,
|
||||
mfvc: IrClass,
|
||||
leaves: List<LeafMfvcNode>,
|
||||
newPrimaryConstructor: IrConstructor
|
||||
) = context.irFactory.buildFun {
|
||||
name = Name.identifier(KotlinTypeMapper.BOX_JVM_METHOD_NAME)
|
||||
origin = JvmLoweredDeclarationOrigin.SYNTHETIC_MULTI_FIELD_VALUE_CLASS_MEMBER
|
||||
returnType = mfvc.defaultType
|
||||
}.apply {
|
||||
parent = mfvc
|
||||
copyTypeParametersFrom(mfvc)
|
||||
val mapping = mfvc.typeParameters.zip(typeParameters) { classTypeParameter, functionTypeParameter ->
|
||||
classTypeParameter.symbol to functionTypeParameter.defaultType
|
||||
}.toMap()
|
||||
returnType = returnType.substitute(mapping)
|
||||
val parameters = leaves.map { leaf -> addValueParameter(leaf.fullFieldName, leaf.type.substitute(mapping)) }
|
||||
body = with(context.createJvmIrBuilder(this.symbol)) {
|
||||
irExprBody(irCall(newPrimaryConstructor).apply {
|
||||
for ((index, parameter) in parameters.withIndex()) {
|
||||
putValueArgument(index, irGet(parameter))
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
private fun makePrimaryConstructorImpl(
|
||||
context: JvmBackendContext,
|
||||
oldPrimaryConstructor: IrConstructor,
|
||||
mfvc: IrClass,
|
||||
leaves: List<LeafMfvcNode>
|
||||
) = context.irFactory.buildFun {
|
||||
name = InlineClassAbi.mangledNameFor(oldPrimaryConstructor, false, false)
|
||||
visibility = oldPrimaryConstructor.visibility
|
||||
origin = JvmLoweredDeclarationOrigin.STATIC_MULTI_FIELD_VALUE_CLASS_CONSTRUCTOR
|
||||
returnType = context.irBuiltIns.unitType
|
||||
modality = Modality.FINAL
|
||||
}.apply {
|
||||
parent = mfvc
|
||||
copyTypeParametersFrom(mfvc)
|
||||
for (leaf in leaves) {
|
||||
addValueParameter(leaf.fullFieldName, leaf.type.substitute(mfvc.typeParameters, typeParameters.map { it.defaultType }))
|
||||
}
|
||||
// body is added in the Lowering file as it needs to be lowered
|
||||
}
|
||||
|
||||
private fun makeMfvcPrimaryConstructor(
|
||||
context: JvmBackendContext,
|
||||
oldPrimaryConstructor: IrConstructor,
|
||||
mfvc: IrClass,
|
||||
leaves: List<LeafMfvcNode>,
|
||||
fields: List<IrField>
|
||||
) = context.irFactory.buildConstructor {
|
||||
updateFrom(oldPrimaryConstructor)
|
||||
visibility = DescriptorVisibilities.PRIVATE
|
||||
origin = JvmLoweredDeclarationOrigin.SYNTHETIC_MULTI_FIELD_VALUE_CLASS_MEMBER
|
||||
returnType = oldPrimaryConstructor.returnType
|
||||
}.apply {
|
||||
require(oldPrimaryConstructor.typeParameters.isEmpty()) {
|
||||
"Constructors do not support type parameters yet"
|
||||
}
|
||||
this.parent = mfvc
|
||||
val parameters = leaves.map { addValueParameter(it.fullFieldName, it.type) }
|
||||
val irConstructor = this@apply
|
||||
body = context.createIrBuilder(irConstructor.symbol).irBlockBody(irConstructor) {
|
||||
+irDelegatingConstructorCall(context.irBuiltIns.anyClass.owner.constructors.single())
|
||||
for ((field, parameter) in fields zip parameters) {
|
||||
+irSetField(irGet(mfvc.thisReceiver!!), field, irGet(parameter))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun makeRootMfvcNodeSubnodes(
|
||||
representation: MultiFieldValueClassRepresentation<IrSimpleType>,
|
||||
properties: Map<Pair<Boolean, Name>, IrProperty>,
|
||||
context: JvmBackendContext,
|
||||
mfvc: IrClass
|
||||
) = representation.underlyingPropertyNamesToTypes.mapIndexed { index, (name, type) ->
|
||||
val typeArguments = makeTypeArgumentsFromType(type)
|
||||
val oldProperty = properties[false to name]!!
|
||||
val oldBackingField = oldProperty.backingField
|
||||
val oldGetter = oldProperty.getterIfDeclared(mfvc)
|
||||
val overriddenNode = oldGetter?.let { getOverriddenNode(context.multiFieldValueClassReplacements, it) as IntermediateMfvcNode? }
|
||||
val static = oldProperty.isStatic(mfvc)
|
||||
createNameableMfvcNodes(
|
||||
mfvc,
|
||||
context,
|
||||
type,
|
||||
typeArguments,
|
||||
null,
|
||||
listOf(IndexedNamePart(index, name)),
|
||||
oldBackingField?.annotations ?: listOf(),
|
||||
static,
|
||||
overriddenNode,
|
||||
null,
|
||||
oldGetter.takeIf { static },
|
||||
Modality.FINAL,
|
||||
oldBackingField,
|
||||
).also {
|
||||
updateAnnotationsAndPropertyFromOldProperty(oldProperty)
|
||||
it.unboxMethod.overriddenSymbols = listOf() // the getter is saved so it overrides itself
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateAnnotationsAndPropertyFromOldProperty(
|
||||
oldProperty: IrProperty
|
||||
) {
|
||||
oldProperty.setter?.apply {
|
||||
name = Name.identifier(JvmAbi.setterName(oldProperty.name.asString()))
|
||||
correspondingPropertySymbol = null
|
||||
origin = IrDeclarationOrigin.DEFINED
|
||||
}
|
||||
oldProperty.setter = null
|
||||
oldProperty.backingField = null
|
||||
}
|
||||
|
||||
fun createIntermediateNodeForMfvcPropertyOfRegularClass(
|
||||
parent: IrDeclarationContainer,
|
||||
context: JvmBackendContext,
|
||||
oldProperty: IrProperty,
|
||||
): IntermediateMfvcNode {
|
||||
val oldGetter = oldProperty.getterIfDeclared(parent)
|
||||
val oldField = oldProperty.backingField
|
||||
val type = oldProperty.getter?.returnType ?: oldField?.type ?: error("Either getter or field must exist")
|
||||
require(type is IrSimpleType && type.needsMfvcFlattening()) { "Expected MFVC but got ${type.render()}" }
|
||||
val fieldAnnotations = oldField?.annotations ?: listOf()
|
||||
val static = oldProperty.isStatic(parent)
|
||||
val overriddenNode = oldGetter?.let { getOverriddenNode(context.multiFieldValueClassReplacements, it) as IntermediateMfvcNode? }
|
||||
val modality = if (oldGetter == null || oldGetter.modality == Modality.FINAL) Modality.FINAL else oldGetter.modality
|
||||
return createIntermediateMfvcNode(
|
||||
parent, context, type, makeTypeArgumentsFromType(type), oldProperty.name.asString(), listOf(),
|
||||
fieldAnnotations, static, overriddenNode, null, oldGetter, modality, oldField
|
||||
).also {
|
||||
updateAnnotationsAndPropertyFromOldProperty(oldProperty)
|
||||
}
|
||||
}
|
||||
|
||||
private fun getOverriddenNode(replacements: MemoizedMultiFieldValueClassReplacements, getter: IrSimpleFunction): NameableMfvcNode? =
|
||||
getter.overriddenSymbols
|
||||
.firstOrNull { !it.owner.isFakeOverride }
|
||||
?.let { replacements.getMfvcPropertyNode(it.owner.correspondingPropertySymbol!!.owner) }
|
||||
|
||||
fun hasAccessToPrivateMembersOf(currentElement: IrElement?, parent: IrClass): Boolean {
|
||||
val declaration = currentElement as? IrDeclaration ?: return false
|
||||
for (cur in declaration.parents.filterIsInstance<IrClass>()) {
|
||||
return when {
|
||||
cur == parent -> true
|
||||
cur.isInner -> continue
|
||||
else -> false
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
private fun IrProperty.getterIfDeclared(parent: IrDeclarationContainer): IrSimpleFunction? = getter?.takeIf { it in parent.declarations }
|
||||
@@ -0,0 +1,270 @@
|
||||
/*
|
||||
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
package org.jetbrains.kotlin.backend.jvm
|
||||
|
||||
import org.jetbrains.kotlin.backend.jvm.ir.erasedUpperBound
|
||||
import org.jetbrains.kotlin.ir.IrElement
|
||||
import org.jetbrains.kotlin.ir.IrStatement
|
||||
import org.jetbrains.kotlin.ir.builders.*
|
||||
import org.jetbrains.kotlin.ir.declarations.*
|
||||
import org.jetbrains.kotlin.ir.declarations.impl.IrVariableImpl
|
||||
import org.jetbrains.kotlin.ir.expressions.*
|
||||
import org.jetbrains.kotlin.ir.expressions.impl.IrTypeOperatorCallImpl
|
||||
import org.jetbrains.kotlin.ir.symbols.impl.IrVariableSymbolImpl
|
||||
import org.jetbrains.kotlin.ir.types.IrSimpleType
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
import org.jetbrains.kotlin.ir.util.deepCopyWithSymbols
|
||||
import org.jetbrains.kotlin.ir.util.dump
|
||||
import org.jetbrains.kotlin.ir.util.render
|
||||
import org.jetbrains.kotlin.ir.util.substitute
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
|
||||
interface MfvcNodeInstance {
|
||||
val scope: IrBuilderWithScope
|
||||
val node: MfvcNode
|
||||
val typeArguments: TypeArguments
|
||||
val type: IrSimpleType
|
||||
val initializationStatements: List<IrStatement>
|
||||
|
||||
fun makeFlattenedGetterExpressions(): List<IrExpression>
|
||||
fun makeGetterExpression(): IrExpression
|
||||
operator fun get(name: Name): MfvcNodeInstance?
|
||||
fun makeStatements(values: List<IrExpression>): List<IrStatement>
|
||||
}
|
||||
|
||||
private fun makeTypeFromMfvcNodeAndTypeArguments(node: MfvcNode, typeArguments: TypeArguments) =
|
||||
node.type.substitute(typeArguments) as IrSimpleType
|
||||
|
||||
fun MfvcNodeInstance.addSetterStatements(scope: IrBlockBuilder, values: List<IrExpression>) = with(scope) {
|
||||
for (statement in makeStatements(values)) {
|
||||
+statement
|
||||
}
|
||||
}
|
||||
|
||||
fun MfvcNodeInstance.makeSetterExpressions(values: List<IrExpression>): IrExpression = scope.irBlock {
|
||||
addSetterStatements(this, values)
|
||||
}
|
||||
|
||||
private fun MfvcNodeInstance.checkValuesCount(values: List<IrExpression>) {
|
||||
require(values.size == node.leavesCount) { "Node $node requires ${node.leavesCount} values but got ${values.map { it.render() }}" }
|
||||
}
|
||||
|
||||
class ValueDeclarationMfvcNodeInstance(
|
||||
override val scope: IrBuilderWithScope,
|
||||
override val node: MfvcNode,
|
||||
override val typeArguments: TypeArguments,
|
||||
val valueDeclarations: List<IrValueDeclaration>,
|
||||
override val initializationStatements: List<IrStatement>,
|
||||
) : MfvcNodeInstance {
|
||||
init {
|
||||
require(valueDeclarations.size == size) { "Expected value declarations list of size $size but got of size ${valueDeclarations.size}" }
|
||||
}
|
||||
|
||||
override val type: IrSimpleType = makeTypeFromMfvcNodeAndTypeArguments(node, typeArguments)
|
||||
|
||||
override fun makeFlattenedGetterExpressions(): List<IrExpression> = valueDeclarations.map { scope.irGet(it) }
|
||||
|
||||
override fun makeGetterExpression(): IrExpression = when (node) {
|
||||
is LeafMfvcNode -> makeFlattenedGetterExpressions().single()
|
||||
is MfvcNodeWithSubnodes -> node.makeBoxedExpression(scope, typeArguments, makeFlattenedGetterExpressions())
|
||||
}
|
||||
|
||||
override fun get(name: Name): ValueDeclarationMfvcNodeInstance? {
|
||||
val (newNode, indices) = node.getSubnodeAndIndices(name) ?: return null
|
||||
return ValueDeclarationMfvcNodeInstance(scope, newNode, typeArguments, valueDeclarations.slice(indices), initializationStatements)
|
||||
}
|
||||
|
||||
override fun makeStatements(values: List<IrExpression>): List<IrStatement> {
|
||||
checkValuesCount(values)
|
||||
return valueDeclarations.zip(values) { declaration, value -> scope.irSet(declaration, value) }
|
||||
}
|
||||
}
|
||||
|
||||
internal class ExpressionCopierImpl(
|
||||
expression: IrExpression?,
|
||||
private val scope: IrBlockBuilder,
|
||||
private val saveVariable: (IrVariable) -> Unit,
|
||||
private val saveReceiverSetter: (IrSetValue) -> Unit
|
||||
) {
|
||||
private sealed interface CopyableExpression {
|
||||
fun makeExpression(scope: IrBuilderWithScope): IrExpression
|
||||
}
|
||||
|
||||
private class SavedToVariable(val variable: IrVariable) : CopyableExpression {
|
||||
override fun makeExpression(scope: IrBuilderWithScope): IrExpression = scope.irGet(variable)
|
||||
}
|
||||
|
||||
private class PureExpression(val expression: IrExpression) : CopyableExpression {
|
||||
override fun makeExpression(scope: IrBuilderWithScope): IrExpression = expression.deepCopyWithSymbols()
|
||||
}
|
||||
|
||||
private fun IrExpression.orSavedToVariable(): CopyableExpression =
|
||||
if (isRepeatableGetter()) {
|
||||
PureExpression(this)
|
||||
} else SavedToVariable(
|
||||
scope.savableStandaloneVariableWithSetter(
|
||||
this@orSavedToVariable,
|
||||
origin = IrDeclarationOrigin.TEMPORARY_MULTI_FIELD_VALUE_CLASS_VARIABLE,
|
||||
saveVariable = saveVariable,
|
||||
isTemporary = true,
|
||||
saveSetter = saveReceiverSetter,
|
||||
)
|
||||
)
|
||||
|
||||
private val copyableExpression = expression?.orSavedToVariable()
|
||||
|
||||
fun makeCopy() = copyableExpression?.makeExpression(scope)
|
||||
}
|
||||
|
||||
fun IrExpression?.isRepeatableGetter(): Boolean = when (this) {
|
||||
null -> true
|
||||
is IrConst<*> -> true
|
||||
is IrGetValue -> true
|
||||
is IrGetField -> receiver.isRepeatableGetter()
|
||||
is IrTypeOperatorCallImpl -> this.argument.isRepeatableGetter()
|
||||
is IrContainerExpression -> statements.all { it is IrExpression && it.isRepeatableGetter() || it is IrVariable }
|
||||
else -> false
|
||||
}
|
||||
|
||||
fun IrExpression?.isRepeatableSetter(): Boolean = when (this) {
|
||||
null -> true
|
||||
is IrConst<*> -> true
|
||||
is IrSetValue -> value.isRepeatableGetter()
|
||||
is IrSetField -> receiver.isRepeatableGetter() && value.isRepeatableGetter()
|
||||
is IrTypeOperatorCallImpl -> this.argument.isRepeatableSetter()
|
||||
is IrContainerExpression -> statements.dropLast(1).all { it is IrExpression && it.isRepeatableGetter() || it is IrVariable } &&
|
||||
statements.lastOrNull().let { it is IrExpression? && it.isRepeatableSetter() }
|
||||
|
||||
else -> false
|
||||
}
|
||||
|
||||
fun IrExpression?.isRepeatableAccessor(): Boolean = isRepeatableGetter() || isRepeatableSetter()
|
||||
|
||||
class ReceiverBasedMfvcNodeInstance(
|
||||
override val scope: IrBlockBuilder,
|
||||
override val node: MfvcNode,
|
||||
override val typeArguments: TypeArguments,
|
||||
receiver: IrExpression?,
|
||||
val fields: List<IrField>?,
|
||||
val unboxMethod: IrSimpleFunction?,
|
||||
val isPrivateAccess: Boolean,
|
||||
private val saveVariable: (IrVariable) -> Unit,
|
||||
) : MfvcNodeInstance {
|
||||
override val type: IrSimpleType = makeTypeFromMfvcNodeAndTypeArguments(node, typeArguments)
|
||||
|
||||
override val initializationStatements: List<IrStatement> = mutableListOf()
|
||||
private val receiverCopier = ExpressionCopierImpl(
|
||||
receiver, scope, saveVariable, saveReceiverSetter = { (initializationStatements as MutableList).add(it) }
|
||||
)
|
||||
|
||||
private fun makeReceiverCopy() = receiverCopier.makeCopy()
|
||||
|
||||
init {
|
||||
require(fields == null || fields.isNotEmpty()) { "Empty list of fields" }
|
||||
require(node is RootMfvcNode == (unboxMethod == null)) { "Only root node has node getter" }
|
||||
}
|
||||
|
||||
override fun makeFlattenedGetterExpressions(): List<IrExpression> = when (node) {
|
||||
is LeafMfvcNode -> listOf(makeGetterExpression())
|
||||
is MfvcNodeWithSubnodes -> when {
|
||||
node is IntermediateMfvcNode && isPrivateAccess && fields != null -> fields.map { scope.irGetField(makeReceiverCopy(), it) }
|
||||
node is IntermediateMfvcNode && !node.hasPureUnboxMethod -> {
|
||||
val value = makeGetterExpression()
|
||||
val asVariable = scope.savableStandaloneVariableWithSetter(
|
||||
value,
|
||||
origin = IrDeclarationOrigin.GENERATED_MULTI_FIELD_VALUE_CLASS_PARAMETER,
|
||||
saveVariable = saveVariable,
|
||||
isTemporary = true,
|
||||
)
|
||||
val root = node.rootNode
|
||||
val variableInstance =
|
||||
root.createInstanceFromBox(scope, typeArguments, scope.irGet(asVariable), isPrivateAccess = false, saveVariable)
|
||||
variableInstance.makeFlattenedGetterExpressions()
|
||||
}
|
||||
|
||||
else -> node.subnodes.flatMap { get(it.name)!!.makeFlattenedGetterExpressions() }
|
||||
}
|
||||
}
|
||||
|
||||
override fun makeGetterExpression(): IrExpression = with(scope) {
|
||||
when {
|
||||
node is LeafMfvcNode && isPrivateAccess && fields != null -> irGetField(makeReceiverCopy(), fields.single())
|
||||
node is IntermediateMfvcNode && isPrivateAccess && fields != null -> node.makeBoxedExpression(
|
||||
this, typeArguments, fields.map { irGetField(makeReceiverCopy(), it) }
|
||||
)
|
||||
unboxMethod != null -> irCall(unboxMethod).apply {
|
||||
val dispatchReceiverParameter = unboxMethod.dispatchReceiverParameter
|
||||
if (dispatchReceiverParameter != null) {
|
||||
dispatchReceiver = makeReceiverCopy() ?: run {
|
||||
val erasedUpperBound = dispatchReceiverParameter.type.erasedUpperBound
|
||||
require(erasedUpperBound.isCompanion) { "Expected a dispatch receiver for:\n${unboxMethod.dump()}" }
|
||||
irGetObject(erasedUpperBound.symbol)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
node is RootMfvcNode -> makeReceiverCopy()!!
|
||||
else -> error("Unbox method must exist for $node")
|
||||
}
|
||||
}
|
||||
|
||||
override fun get(name: Name): ReceiverBasedMfvcNodeInstance? {
|
||||
val (newNode, _) = node.getSubnodeAndIndices(name) ?: return null
|
||||
return newNode.createInstanceFromBox(scope, typeArguments, makeReceiverCopy(), isPrivateAccess, saveVariable)
|
||||
}
|
||||
|
||||
override fun makeStatements(values: List<IrExpression>): List<IrStatement> {
|
||||
checkValuesCount(values)
|
||||
require(fields != null) { "$node is immutable as it has custom getter and so no backing fields" }
|
||||
return fields.zip(values) { field, expr -> scope.irSetField(makeReceiverCopy(), field, expr) }
|
||||
}
|
||||
}
|
||||
|
||||
val MfvcNodeInstance.size: Int
|
||||
get() = node.leavesCount
|
||||
|
||||
fun IrContainerExpression.unwrap(): IrExpression = statements.singleOrNull() as? IrExpression ?: this
|
||||
|
||||
fun IrBuilderWithScope.savableStandaloneVariable(
|
||||
type: IrType,
|
||||
name: String? = null,
|
||||
isMutable: Boolean = false,
|
||||
origin: IrDeclarationOrigin,
|
||||
isTemporary: Boolean = origin == IrDeclarationOrigin.IR_TEMPORARY_VARIABLE,
|
||||
saveVariable: (IrVariable) -> Unit,
|
||||
): IrVariable {
|
||||
val variable = if (isTemporary || name == null) scope.createTemporaryVariableDeclaration(
|
||||
type, name, isMutable,
|
||||
startOffset = startOffset,
|
||||
endOffset = endOffset,
|
||||
origin = origin,
|
||||
) else IrVariableImpl(
|
||||
startOffset = startOffset,
|
||||
endOffset = endOffset,
|
||||
origin = origin,
|
||||
symbol = IrVariableSymbolImpl(),
|
||||
name = Name.identifier(name),
|
||||
type = type,
|
||||
isVar = isMutable,
|
||||
isConst = false,
|
||||
isLateinit = false
|
||||
).apply {
|
||||
parent = this@savableStandaloneVariable.scope.getLocalDeclarationParent()
|
||||
}
|
||||
saveVariable(variable)
|
||||
return variable
|
||||
}
|
||||
|
||||
fun <T : IrElement> IrStatementsBuilder<T>.savableStandaloneVariableWithSetter(
|
||||
expression: IrExpression,
|
||||
name: String? = null,
|
||||
isMutable: Boolean = false,
|
||||
origin: IrDeclarationOrigin,
|
||||
isTemporary: Boolean = origin == IrDeclarationOrigin.IR_TEMPORARY_VARIABLE,
|
||||
saveSetter: (IrSetValue) -> Unit = {},
|
||||
saveVariable: (IrVariable) -> Unit,
|
||||
) = savableStandaloneVariable(expression.type, name, isMutable, origin, isTemporary, saveVariable).also {
|
||||
+irSet(it, expression).also(saveSetter)
|
||||
}
|
||||
-527
@@ -1,527 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.backend.jvm
|
||||
|
||||
import org.jetbrains.kotlin.backend.common.lower.createIrBuilder
|
||||
import org.jetbrains.kotlin.backend.common.lower.irBlockBody
|
||||
import org.jetbrains.kotlin.backend.common.pop
|
||||
import org.jetbrains.kotlin.backend.jvm.MultiFieldValueClassTree.InternalNode
|
||||
import org.jetbrains.kotlin.backend.jvm.MultiFieldValueClassTree.Leaf
|
||||
import org.jetbrains.kotlin.backend.jvm.ir.erasedUpperBound
|
||||
import org.jetbrains.kotlin.backend.jvm.ir.isMultiFieldValueClassType
|
||||
import org.jetbrains.kotlin.backend.jvm.ir.upperBound
|
||||
import org.jetbrains.kotlin.codegen.state.KotlinTypeMapper
|
||||
import org.jetbrains.kotlin.descriptors.DescriptorVisibilities
|
||||
import org.jetbrains.kotlin.descriptors.DescriptorVisibility
|
||||
import org.jetbrains.kotlin.descriptors.Modality
|
||||
import org.jetbrains.kotlin.descriptors.MultiFieldValueClassRepresentation
|
||||
import org.jetbrains.kotlin.ir.IrStatement
|
||||
import org.jetbrains.kotlin.ir.builders.*
|
||||
import org.jetbrains.kotlin.ir.builders.declarations.*
|
||||
import org.jetbrains.kotlin.ir.declarations.*
|
||||
import org.jetbrains.kotlin.ir.expressions.IrConstructorCall
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||
import org.jetbrains.kotlin.ir.expressions.IrFunctionAccessExpression
|
||||
import org.jetbrains.kotlin.ir.expressions.IrGetField
|
||||
import org.jetbrains.kotlin.ir.symbols.IrTypeParameterSymbol
|
||||
import org.jetbrains.kotlin.ir.symbols.IrValueSymbol
|
||||
import org.jetbrains.kotlin.ir.types.*
|
||||
import org.jetbrains.kotlin.ir.util.*
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.renderer.render
|
||||
import org.jetbrains.kotlin.resolve.InlineClassDescriptorResolver
|
||||
|
||||
sealed class MultiFieldValueClassTree {
|
||||
abstract val type: IrType
|
||||
val irClass: IrClass
|
||||
get() = type.erasedUpperBound
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun create(type: IrSimpleType, replacements: MemoizedMultiFieldValueClassReplacements, descriptorVisibility: DescriptorVisibility) =
|
||||
if (!type.isNullable() && type.isMultiFieldValueClassType()) InternalNode(type, descriptorVisibility, replacements)
|
||||
else Leaf(type)
|
||||
}
|
||||
|
||||
class Leaf(override val type: IrType) : MultiFieldValueClassTree() {
|
||||
init {
|
||||
require(type.isNullable() || !type.isMultiFieldValueClassType())
|
||||
}
|
||||
}
|
||||
|
||||
class InternalNode internal constructor(
|
||||
override val type: IrSimpleType, val fields: List<TreeField>
|
||||
) : MultiFieldValueClassTree() {
|
||||
constructor(
|
||||
type: IrSimpleType, visibility: DescriptorVisibility,
|
||||
replacements: MemoizedMultiFieldValueClassReplacements
|
||||
) : this(type, 0.let {
|
||||
val valueClassRepresentation = type.erasedUpperBound.valueClassRepresentation as MultiFieldValueClassRepresentation
|
||||
val primaryConstructor = type.erasedUpperBound.primaryConstructor!!
|
||||
val propertiesByName = replacements.getOldMFVCProperties(primaryConstructor.constructedClass).associateBy { it.name }
|
||||
val typeArguments: List<IrTypeArgument> = type.arguments
|
||||
val typeParameters = type.erasedUpperBound.typeParameters
|
||||
val substitutionMap = typeParameters.map { it.symbol }.zip(typeArguments)
|
||||
.mapNotNull { (param, arg) -> if (arg is IrSimpleType) param to arg else null }.toMap()
|
||||
valueClassRepresentation.underlyingPropertyNamesToTypes.map { (name, representationType) ->
|
||||
val property = propertiesByName[name]!!
|
||||
val innerVisibility = property.visibility
|
||||
val newVisibility = minVisibility(visibility, innerVisibility)
|
||||
TreeField(
|
||||
name,
|
||||
representationType.substitute(substitutionMap) as IrSimpleType,
|
||||
newVisibility,
|
||||
property.annotations,
|
||||
replacements
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
class TreeField(
|
||||
val name: Name, val type: IrType, val visibility: DescriptorVisibility, val annotations: List<IrConstructorCall>,
|
||||
val node: MultiFieldValueClassTree
|
||||
) {
|
||||
constructor(
|
||||
name: Name,
|
||||
type: IrSimpleType,
|
||||
visibility: DescriptorVisibility,
|
||||
annotations: List<IrConstructorCall>,
|
||||
replacements: MemoizedMultiFieldValueClassReplacements
|
||||
) : this(name, type, visibility, annotations, create(type, replacements, visibility))
|
||||
}
|
||||
|
||||
init {
|
||||
require(!type.isNullable() && type.isMultiFieldValueClassType())
|
||||
}
|
||||
|
||||
private val fieldByName = fields.associateBy { it.name }
|
||||
|
||||
operator fun get(name: Name) = fieldByName[name]
|
||||
}
|
||||
}
|
||||
|
||||
fun minVisibility(
|
||||
visibility1: DescriptorVisibility,
|
||||
visibility2: DescriptorVisibility
|
||||
): DescriptorVisibility {
|
||||
val comparison = visibility1.compareTo(visibility2)
|
||||
?: error("Expected comparable visibilities but got $visibility1 and $visibility2")
|
||||
return if (comparison < 0) visibility1 else visibility2
|
||||
}
|
||||
|
||||
fun MultiFieldValueClassTree.render(): String = type.render() + when (this) {
|
||||
is InternalNode -> "\n" + fields.joinToString("\n") { "${it.name.render()}: ${it.node.render().prependIndent(" ")}" }
|
||||
is Leaf -> ""
|
||||
}
|
||||
|
||||
class MultiFieldValueClassSpecificDeclarations(
|
||||
val valueClass: IrClass,
|
||||
private val typeSystemContext: IrTypeSystemContext,
|
||||
private val irFactory: IrFactory,
|
||||
private val context: JvmBackendContext,
|
||||
private val replacements: MemoizedMultiFieldValueClassReplacements,
|
||||
) {
|
||||
init {
|
||||
require(valueClass.isMultiFieldValueClass) { "Cannot build ${this::class.simpleName} for not multi-field value class: $valueClass" }
|
||||
}
|
||||
|
||||
val loweringRepresentation =
|
||||
MultiFieldValueClassTree.create(valueClass.defaultType, replacements, DescriptorVisibilities.PUBLIC) as InternalNode
|
||||
|
||||
val leaves: List<Leaf> = ArrayList<Leaf>().apply {
|
||||
fun proceed(node: MultiFieldValueClassTree) {
|
||||
when (node) {
|
||||
is InternalNode -> node.fields.forEach { proceed(it.node) }
|
||||
is Leaf -> add(node)
|
||||
}
|
||||
}
|
||||
proceed(loweringRepresentation)
|
||||
if (size <= 1) {
|
||||
error("${this@MultiFieldValueClassSpecificDeclarations::class.qualifiedName} for $valueClass must have multiple leaves")
|
||||
}
|
||||
}
|
||||
|
||||
val nodeFullNames: Map<MultiFieldValueClassTree, Name> =
|
||||
mutableMapOf<MultiFieldValueClassTree, Name>().apply {
|
||||
val parts = mutableListOf<String>()
|
||||
fun makeName() = Name.guessByFirstCharacter(parts.joinToString("$"))
|
||||
fun proceed(node: MultiFieldValueClassTree) {
|
||||
when (node) {
|
||||
is InternalNode -> {
|
||||
if (parts.isNotEmpty()) {
|
||||
put(node, makeName())
|
||||
}
|
||||
for (field in node.fields) {
|
||||
parts.add(field.name.asString())
|
||||
proceed(field.node)
|
||||
parts.removeLast()
|
||||
}
|
||||
}
|
||||
is Leaf -> put(node, makeName())
|
||||
}
|
||||
}
|
||||
proceed(loweringRepresentation)
|
||||
}
|
||||
|
||||
init {
|
||||
require(nodeFullNames.size == nodeFullNames.values.distinct().size) { "Ambiguous names found: ${nodeFullNames.values}" }
|
||||
}
|
||||
|
||||
val indexByLeaf = leaves.withIndex().associate { it.value to it.index }
|
||||
val indexesByInternalNode = mutableMapOf<InternalNode, IntRange>().apply {
|
||||
var index = 0
|
||||
fun proceed(node: MultiFieldValueClassTree) {
|
||||
when (node) {
|
||||
is InternalNode -> {
|
||||
val start = index
|
||||
node.fields.forEach { proceed(it.node) }
|
||||
val finish = index
|
||||
val range = start until finish
|
||||
if (finish - start <= 1) {
|
||||
error("Invalid multi-field value class indexes range for class $valueClass: ${range}")
|
||||
}
|
||||
put(node, range)
|
||||
}
|
||||
is Leaf -> index++
|
||||
}
|
||||
}
|
||||
proceed(loweringRepresentation)
|
||||
}
|
||||
|
||||
val oldPrimaryConstructor = valueClass.primaryConstructor ?: error("Value classes have primary constructors")
|
||||
|
||||
val oldProperties = replacements.getOldMFVCProperties(valueClass).associateBy { it.name }
|
||||
|
||||
val fields = leaves.map { leaf ->
|
||||
irFactory.buildField {
|
||||
this.name = nodeFullNames[leaf]!!
|
||||
this.type = leaf.type
|
||||
visibility = DescriptorVisibilities.PRIVATE
|
||||
}.apply {
|
||||
parent = valueClass
|
||||
}
|
||||
}
|
||||
|
||||
val gettersVisibilities = mutableMapOf<MultiFieldValueClassTree, DescriptorVisibility>().apply {
|
||||
val stack = mutableListOf<DescriptorVisibility>()
|
||||
fun proceed(node: MultiFieldValueClassTree) {
|
||||
when (node) {
|
||||
is InternalNode -> {
|
||||
if (stack.isNotEmpty()) {
|
||||
put(node, stack.last())
|
||||
}
|
||||
for (field in node.fields) {
|
||||
stack.add(field.visibility)
|
||||
proceed(field.node)
|
||||
stack.pop()
|
||||
}
|
||||
}
|
||||
is Leaf -> put(node, stack.last())
|
||||
}
|
||||
}
|
||||
proceed(loweringRepresentation)
|
||||
}
|
||||
|
||||
private val gettersAnnotations = mutableMapOf<MultiFieldValueClassTree, List<IrConstructorCall>>().apply {
|
||||
val stack = mutableListOf<List<IrConstructorCall>>()
|
||||
|
||||
fun proceed(node: MultiFieldValueClassTree) {
|
||||
when (node) {
|
||||
is InternalNode -> {
|
||||
if (stack.isNotEmpty()) {
|
||||
put(node, stack.last())
|
||||
}
|
||||
for (field in node.fields) {
|
||||
stack.add(field.annotations)
|
||||
proceed(field.node)
|
||||
stack.pop()
|
||||
}
|
||||
}
|
||||
is Leaf -> put(node, stack.last())
|
||||
}
|
||||
}
|
||||
proceed(loweringRepresentation)
|
||||
}
|
||||
|
||||
private fun IrBuilderWithScope.fieldGetter(receiver: IrValueParameter, field: IrField): IrGetField =
|
||||
irGetField(irGet(receiver), field)
|
||||
|
||||
private fun IrFunction.fieldGetter(field: IrField): IrBuilderWithScope.() -> IrGetField =
|
||||
{ fieldGetter(dispatchReceiverParameter!!, field) }
|
||||
|
||||
val primaryConstructor: IrConstructor = irFactory.buildConstructor {
|
||||
updateFrom(oldPrimaryConstructor)
|
||||
visibility = DescriptorVisibilities.PRIVATE
|
||||
origin = JvmLoweredDeclarationOrigin.SYNTHETIC_MULTI_FIELD_VALUE_CLASS_MEMBER
|
||||
returnType = oldPrimaryConstructor.returnType
|
||||
}.apply {
|
||||
require(oldPrimaryConstructor.typeParameters.isEmpty()) {
|
||||
"Constructors do not support type parameters yet"
|
||||
}
|
||||
addFlattenedClassRepresentationToParameters(mapOf())
|
||||
val irConstructor = this@apply
|
||||
parent = valueClass
|
||||
body = context.createIrBuilder(irConstructor.symbol).irBlockBody(irConstructor) {
|
||||
+irDelegatingConstructorCall(context.irBuiltIns.anyClass.owner.constructors.single())
|
||||
for (i in leaves.indices) {
|
||||
+irSetField(
|
||||
receiver = irGet(valueClass.thisReceiver!!),
|
||||
field = fields[i],
|
||||
value = irGet(irConstructor.valueParameters[i])
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val primaryConstructorImpl: IrSimpleFunction = irFactory.buildFun {
|
||||
name = InlineClassAbi.mangledNameFor(oldPrimaryConstructor, false, false)
|
||||
visibility = oldPrimaryConstructor.visibility
|
||||
origin = JvmLoweredDeclarationOrigin.STATIC_MULTI_FIELD_VALUE_CLASS_CONSTRUCTOR
|
||||
returnType = context.irBuiltIns.unitType
|
||||
modality = Modality.FINAL
|
||||
}.apply {
|
||||
parent = valueClass
|
||||
copyTypeParametersFrom(valueClass)
|
||||
addFlattenedClassRepresentationToParameters(classToFunctionTypeParametersMapping())
|
||||
// body is added in Lowering file
|
||||
}
|
||||
|
||||
private fun IrSimpleFunction.classToFunctionTypeParametersMapping() =
|
||||
valueClass.typeParameters.map { it.symbol }.zip(typeParameters.map { it.defaultType }).toMap()
|
||||
|
||||
val boxMethod = irFactory.buildFun {
|
||||
name = Name.identifier(KotlinTypeMapper.BOX_JVM_METHOD_NAME)
|
||||
origin = JvmLoweredDeclarationOrigin.SYNTHETIC_MULTI_FIELD_VALUE_CLASS_MEMBER
|
||||
returnType = valueClass.defaultType
|
||||
}.apply {
|
||||
parent = valueClass
|
||||
copyTypeParametersFrom(valueClass)
|
||||
addFlattenedClassRepresentationToParameters(classToFunctionTypeParametersMapping())
|
||||
// body is added in Lowering file
|
||||
}
|
||||
|
||||
private fun IrFunction.addFlattenedClassRepresentationToParameters(substitutionMap: Map<IrTypeParameterSymbol, IrType>) {
|
||||
for (leaf in leaves) {
|
||||
addValueParameter {
|
||||
this.name = nodeFullNames[leaf]!!
|
||||
this.type = leaf.type.substitute(substitutionMap)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val specializedEqualsMethod = irFactory.buildFun {
|
||||
name = InlineClassDescriptorResolver.SPECIALIZED_EQUALS_NAME
|
||||
// TODO: Revisit this once we allow user defined equals methods in value classes.
|
||||
origin = JvmLoweredDeclarationOrigin.MULTI_FIELD_VALUE_CLASS_GENERATED_IMPL_METHOD
|
||||
returnType = context.irBuiltIns.booleanType
|
||||
}.apply {
|
||||
parent = valueClass
|
||||
copyTypeParametersFrom(valueClass)
|
||||
val typeParametersHalf1 = typeParameters.apply {
|
||||
for (it in this) {
|
||||
it.name = Name.guessByFirstCharacter("${it.name.asString()}1")
|
||||
}
|
||||
}
|
||||
val substitutionMapHalf1 = (valueClass.typeParameters.map { it.symbol } zip typeParametersHalf1.map { it.defaultType }).toMap()
|
||||
copyTypeParametersFrom(valueClass)
|
||||
val typeParametersHalf2 = typeParameters.drop(typeParametersHalf1.size).apply {
|
||||
for (it in this) {
|
||||
it.name = Name.guessByFirstCharacter("${it.name.asString()}2")
|
||||
}
|
||||
}
|
||||
val substitutionMapHalf2 = (valueClass.typeParameters.map { it.symbol } zip typeParametersHalf2.map { it.defaultType }).toMap()
|
||||
for (leaf in leaves) {
|
||||
addValueParameter {
|
||||
this.name = Name.guessByFirstCharacter(
|
||||
"${InlineClassDescriptorResolver.SPECIALIZED_EQUALS_FIRST_PARAMETER_NAME}$${nodeFullNames[leaf]!!.asString()}"
|
||||
)
|
||||
this.type = leaf.type.substitute(substitutionMapHalf1)
|
||||
}
|
||||
}
|
||||
for (leaf in leaves) {
|
||||
addValueParameter {
|
||||
this.name = Name.guessByFirstCharacter(
|
||||
"${InlineClassDescriptorResolver.SPECIALIZED_EQUALS_SECOND_PARAMETER_NAME}$${nodeFullNames[leaf]!!.asString()}"
|
||||
)
|
||||
this.type = leaf.type.substitute(substitutionMapHalf2)
|
||||
}
|
||||
}
|
||||
// body is added in Lowering file
|
||||
}
|
||||
|
||||
val unboxMethods = fields.mapIndexed { index: Int, field: IrField ->
|
||||
irFactory.buildFun {
|
||||
name = Name.identifier(KotlinTypeMapper.UNBOX_JVM_METHOD_NAME + index)
|
||||
origin = JvmLoweredDeclarationOrigin.SYNTHETIC_MULTI_FIELD_VALUE_CLASS_MEMBER
|
||||
returnType = field.type
|
||||
}.apply {
|
||||
parent = valueClass
|
||||
createDispatchReceiverParameter()
|
||||
body = with(context.createIrBuilder(this.symbol)) {
|
||||
irExprBody(fieldGetter(field)())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val properties: Map<MultiFieldValueClassTree, IrProperty> = run {
|
||||
val nodes2expressions: Map<MultiFieldValueClassTree, IrBuilderWithScope.(function: IrFunction) -> IrExpression> =
|
||||
makeNodes2FieldExpressions(fields)
|
||||
nodeFullNames.mapValues { (node, propertyName) ->
|
||||
val overrideable = oldProperties[propertyName]
|
||||
val descriptorVisibility = gettersVisibilities[node]!!
|
||||
irFactory.buildProperty {
|
||||
name = propertyName
|
||||
origin = IrDeclarationOrigin.GENERATED_MULTI_FIELD_VALUE_CLASS_MEMBER
|
||||
visibility = descriptorVisibility
|
||||
}.apply {
|
||||
annotations = gettersAnnotations[node]!!
|
||||
overrideable?.overriddenSymbols?.let { overriddenSymbols = it }
|
||||
parent = valueClass
|
||||
addGetter {
|
||||
returnType = node.type
|
||||
origin = IrDeclarationOrigin.GENERATED_MULTI_FIELD_VALUE_CLASS_MEMBER
|
||||
visibility = descriptorVisibility
|
||||
}.apply {
|
||||
val function = this
|
||||
overrideable?.getter?.overriddenSymbols?.let { overriddenSymbols = it }
|
||||
createDispatchReceiverParameter()
|
||||
body = with(context.createIrBuilder(this.symbol)) {
|
||||
irExprBody(nodes2expressions[node]!!.invoke(this, function))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
private fun IrFunctionAccessExpression.copyTypeArgumentsFromType(
|
||||
type: IrSimpleType, valueClass: IrClass, substitutionMap: Map<IrTypeParameterSymbol, IrType>
|
||||
) {
|
||||
require(type.erasedUpperBound == valueClass) {
|
||||
"Illegal bound ${type.erasedUpperBound.render()} instead of ${valueClass.render()}"
|
||||
}
|
||||
require(type.arguments.size == valueClass.typeParameters.size) {
|
||||
"Unexpected number of type arguments: ${type.arguments.size} for ${valueClass.typeParameters.size} parameters"
|
||||
}
|
||||
require(type.arguments.size == symbol.owner.typeParameters.size) {
|
||||
"Unexpected number of type arguments: ${type.arguments.size} for ${symbol.owner.typeParameters.size} parameters"
|
||||
}
|
||||
for (i in valueClass.typeParameters.indices) {
|
||||
putTypeArgument(i, type.arguments[i].typeOrNull?.substitute(substitutionMap))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun makeNodes2FieldExpressions(fields: List<IrField>): Map<MultiFieldValueClassTree, IrBuilderWithScope.(IrFunction) -> IrExpression> {
|
||||
fun proceed(node: MultiFieldValueClassTree): Map<MultiFieldValueClassTree, IrBuilderWithScope.(function: IrFunction) -> IrExpression> =
|
||||
when (node) {
|
||||
is InternalNode -> buildMap {
|
||||
val innerDeclarations =
|
||||
if (node.irClass == valueClass) this@MultiFieldValueClassSpecificDeclarations
|
||||
else replacements.getDeclarations(node.irClass)!!
|
||||
put(node) { function ->
|
||||
irCall(innerDeclarations.boxMethod).apply {
|
||||
copyTypeArgumentsFromType(node.type, node.irClass, mapOf())
|
||||
indexesByInternalNode[node]!!.forEachIndexed { index, nodeIndex ->
|
||||
putValueArgument(index, fieldGetter(function.dispatchReceiverParameter!!, fields[nodeIndex]))
|
||||
}
|
||||
}
|
||||
}
|
||||
node.fields.forEach { putAll(proceed(it.node)) }
|
||||
}
|
||||
is Leaf -> mapOf(node to { fieldGetter(it.dispatchReceiverParameter!!, fields[indexByLeaf[node]!!]) })
|
||||
}
|
||||
return proceed(loweringRepresentation)
|
||||
}
|
||||
|
||||
data class VirtualProperty(
|
||||
val type: IrType,
|
||||
val makeGetter: ExpressionGenerator,
|
||||
val assigner: ExpressionSupplier?,
|
||||
val symbol: IrValueSymbol?
|
||||
) {
|
||||
constructor(declaration: IrValueDeclaration) : this(
|
||||
declaration.type,
|
||||
{ irGet(declaration) },
|
||||
if (declaration.isAssignable) { value -> irSet(declaration, value) } else null,
|
||||
declaration.symbol,
|
||||
)
|
||||
|
||||
val isAssignable: Boolean
|
||||
get() = assigner != null
|
||||
}
|
||||
|
||||
/**
|
||||
* Multi-field value class instance can be not only a standalone instance but also:
|
||||
* 1. A slice of fields in another multi-field class instance;
|
||||
* 2. A slice of fields in another regular class instance;
|
||||
* 3. Virtual instance constructed with local variables;
|
||||
* 4. Virtual instance constructed with local parameters;
|
||||
* 5. Virtual instance constructed with local fields;
|
||||
* 6. Some mix of the above ones.
|
||||
*/
|
||||
inner class ImplementationAgnostic constructor(val type: IrSimpleType, val virtualFields: List<VirtualProperty>) {
|
||||
val regularDeclarations = this@MultiFieldValueClassSpecificDeclarations
|
||||
val symbols = virtualFields.map { it.symbol }
|
||||
private val substitutionMap = valueClass.typeParameters.map { it.symbol }.zip(type.arguments.map { it.typeOrNull })
|
||||
.mapNotNull { (parameter, type) -> if (type != null) parameter to type else null }.toMap()
|
||||
|
||||
init {
|
||||
require(virtualFields.size == leaves.size) { "Wrong symbols number given for $leaves, got $virtualFields" }
|
||||
for ((actual, expected) in virtualFields.map { it.type } zip leaves.map { it.type }) {
|
||||
require(actual.upperBound.isSubtypeOf(expected.upperBound, typeSystemContext)) {
|
||||
"${actual.render()} is not a subtype of ${expected.render()} for MFVC ${valueClass.render()}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private val nodeToSymbols = indexesByInternalNode.mapValues { (_, indexes) -> virtualFields.slice(indexes) } +
|
||||
indexByLeaf.mapValues { (_, index) -> listOf(virtualFields[index]) }
|
||||
|
||||
private val internalNodeToExpressionGetters: Map<InternalNode, ExpressionGenerator> =
|
||||
indexesByInternalNode.mapValues { (node, indexes) ->
|
||||
{
|
||||
val arguments = virtualFields.slice(indexes).map { it.makeGetter(this) }
|
||||
val innerDeclarations = replacements.getDeclarations(node.irClass)!!
|
||||
irCall(innerDeclarations.boxMethod).apply {
|
||||
copyTypeArgumentsFromType(node.type, node.irClass, substitutionMap)
|
||||
for (i in arguments.indices) {
|
||||
putValueArgument(i, arguments[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private val leavesToExpressionGetters: Map<Leaf, ExpressionGenerator> =
|
||||
indexByLeaf.mapValues { (_, index) -> { virtualFields[index].makeGetter(this) } }
|
||||
|
||||
val nodeToExpressionGetters: Map<MultiFieldValueClassTree, ExpressionGenerator> =
|
||||
internalNodeToExpressionGetters + leavesToExpressionGetters
|
||||
|
||||
operator fun get(name: Name): Pair<ExpressionGenerator, ImplementationAgnostic?>? =
|
||||
when (val field = loweringRepresentation[name]) {
|
||||
null -> null
|
||||
else -> nodeToExpressionGetters[field.node]!! to when (field.node) {
|
||||
is Leaf -> null
|
||||
is InternalNode -> {
|
||||
val irClass = field.node.irClass
|
||||
val declarations = replacements.getDeclarations(irClass)!!
|
||||
declarations.ImplementationAgnostic(field.type as IrSimpleType, nodeToSymbols[field.node]!!)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val boxedExpression = nodeToExpressionGetters[loweringRepresentation]!!
|
||||
|
||||
// todo default parameters
|
||||
// todo annotations etc.
|
||||
// todo visibilities etc.
|
||||
// todo regenerate tests for not only jvm
|
||||
}
|
||||
}
|
||||
|
||||
typealias ExpressionGenerator = IrBuilderWithScope.() -> IrExpression
|
||||
typealias ExpressionSupplier = IrBuilderWithScope.(IrExpression) -> IrStatement
|
||||
@@ -8,10 +8,7 @@ package org.jetbrains.kotlin.backend.jvm.ir
|
||||
import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.kotlin.backend.common.lower.at
|
||||
import org.jetbrains.kotlin.backend.common.lower.irNot
|
||||
import org.jetbrains.kotlin.backend.jvm.CachedFieldsForObjectInstances
|
||||
import org.jetbrains.kotlin.backend.jvm.JvmBackendContext
|
||||
import org.jetbrains.kotlin.backend.jvm.JvmLoweredDeclarationOrigin
|
||||
import org.jetbrains.kotlin.backend.jvm.JvmSymbols
|
||||
import org.jetbrains.kotlin.backend.jvm.*
|
||||
import org.jetbrains.kotlin.builtins.StandardNames
|
||||
import org.jetbrains.kotlin.codegen.ASSERTIONS_DISABLED_FIELD_NAME
|
||||
import org.jetbrains.kotlin.codegen.AsmUtil
|
||||
@@ -246,6 +243,8 @@ fun IrSimpleFunction.copyCorrespondingPropertyFrom(source: IrSimpleFunction) {
|
||||
fun IrProperty.needsAccessor(accessor: IrSimpleFunction): Boolean = when {
|
||||
// Properties in annotation classes become abstract methods named after the property.
|
||||
(parent as? IrClass)?.kind == ClassKind.ANNOTATION_CLASS -> true
|
||||
// Multi-field value class getters must always be added. Getters for properties of MFVC itself follow general rules.
|
||||
accessor.isGetter && !accessor.parent.let { it is IrClass && it.isMultiFieldValueClass } && accessor.returnType.needsMfvcFlattening() -> true
|
||||
// @JvmField properties have no getters/setters
|
||||
resolveFakeOverride()?.backingField?.hasAnnotation(JvmAbi.JVM_FIELD_ANNOTATION_FQ_NAME) == true -> false
|
||||
// We do not produce default accessors for private fields
|
||||
|
||||
@@ -53,11 +53,13 @@ fun <T : IrElement> IrStatementsBuilder<T>.irTemporary(
|
||||
nameHint: String? = null,
|
||||
irType: IrType = value?.type!!, // either value or irType should be supplied at callsite
|
||||
isMutable: Boolean = false,
|
||||
origin: IrDeclarationOrigin = IrDeclarationOrigin.IR_TEMPORARY_VARIABLE,
|
||||
): IrVariable {
|
||||
val temporary = scope.createTemporaryVariableDeclaration(
|
||||
irType, nameHint, isMutable,
|
||||
startOffset = startOffset,
|
||||
endOffset = endOffset
|
||||
endOffset = endOffset,
|
||||
origin = origin,
|
||||
)
|
||||
value?.let { temporary.initializer = it }
|
||||
+temporary
|
||||
|
||||
@@ -44,6 +44,8 @@ interface IrDeclarationOrigin {
|
||||
object GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER : IrDeclarationOriginImpl("GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER")
|
||||
object GENERATED_MULTI_FIELD_VALUE_CLASS_MEMBER : IrDeclarationOriginImpl("GENERATED_MULTI_FIELD_VALUE_CLASS_MEMBER")
|
||||
object GENERATED_MULTI_FIELD_VALUE_CLASS_PARAMETER : IrDeclarationOriginImpl("GENERATED_MULTI_FIELD_VALUE_CLASS_PARAMETER")
|
||||
object TEMPORARY_MULTI_FIELD_VALUE_CLASS_VARIABLE : IrDeclarationOriginImpl("TEMPORARY_MULTI_FIELD_VALUE_CLASS_VARIABLE")
|
||||
object MULTI_FIELD_VALUE_CLASS_REPRESENTATION_VARIABLE : IrDeclarationOriginImpl("MULTI_FIELD_VALUE_CLASS_REPRESENTATION_VARIABLE")
|
||||
object LOCAL_FUNCTION : IrDeclarationOriginImpl("LOCAL_FUNCTION")
|
||||
object LOCAL_FUNCTION_FOR_LAMBDA : IrDeclarationOriginImpl("LOCAL_FUNCTION_FOR_LAMBDA")
|
||||
object CATCH_PARAMETER : IrDeclarationOriginImpl("CATCH_PARAMETER")
|
||||
|
||||
+27
-27
@@ -1,61 +1,61 @@
|
||||
@kotlin.Metadata
|
||||
public final class A {
|
||||
// source: 'MFVCFieldInitializationOrder.kt'
|
||||
private field x$x: double
|
||||
private field x$y: double
|
||||
// source: 'MfvcFieldInitializationOrder.kt'
|
||||
private field x-0: double
|
||||
private field x-1: double
|
||||
public method <init>(p0: double, p1: double): void
|
||||
public final method getX$x(): double
|
||||
public final method getX$y(): double
|
||||
public final @org.jetbrains.annotations.NotNull method getX(): DPoint
|
||||
public synthetic final method getX-0(): double
|
||||
public synthetic final method getX-1(): double
|
||||
public final method setX-sUp7gFk(p0: double, p1: double): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class B {
|
||||
// source: 'MFVCFieldInitializationOrder.kt'
|
||||
private field a$x: double
|
||||
private field a$y: double
|
||||
private field b$x: double
|
||||
private field b$y: double
|
||||
private field c$x: double
|
||||
private field c$y: double
|
||||
// source: 'MfvcFieldInitializationOrder.kt'
|
||||
private field a-0: double
|
||||
private field a-1: double
|
||||
private final field b-0: double
|
||||
private final field b-1: double
|
||||
private final field c-0: double
|
||||
private final field c-1: double
|
||||
public method <init>(): void
|
||||
public final method getA$x(): double
|
||||
public final method getA$y(): double
|
||||
public final @org.jetbrains.annotations.NotNull method getA(): DPoint
|
||||
public final method getB$x(): double
|
||||
public final method getB$y(): double
|
||||
public synthetic final method getA-0(): double
|
||||
public synthetic final method getA-1(): double
|
||||
public final @org.jetbrains.annotations.NotNull method getB(): DPoint
|
||||
public final method getC$x(): double
|
||||
public final method getC$y(): double
|
||||
public synthetic final method getB-0(): double
|
||||
public synthetic final method getB-1(): double
|
||||
public final @org.jetbrains.annotations.NotNull method getC(): DPoint
|
||||
public synthetic final method getC-0(): double
|
||||
public synthetic final method getC-1(): double
|
||||
public final method setA-sUp7gFk(p0: double, p1: double): void
|
||||
}
|
||||
|
||||
@kotlin.jvm.JvmInline
|
||||
@kotlin.Metadata
|
||||
public final class DPoint {
|
||||
// source: 'MFVCFieldInitializationOrder.kt'
|
||||
private field x: double
|
||||
private field y: double
|
||||
// source: 'MfvcFieldInitializationOrder.kt'
|
||||
private final field field-0: double
|
||||
private final field field-1: double
|
||||
private synthetic method <init>(p0: double, p1: double): void
|
||||
public synthetic final static method box-impl(p0: double, p1: double): DPoint
|
||||
public final static method constructor-impl(p0: double, p1: double): void
|
||||
public method equals(@org.jetbrains.annotations.Nullable p0: java.lang.Object): boolean
|
||||
public static method equals-impl(p0: double, p1: double, p2: java.lang.Object): boolean
|
||||
public final static method equals-impl0(p0: double, p1: double, p2: double, p3: double): boolean
|
||||
public final method getX(): double
|
||||
public final method getY(): double
|
||||
public final static method getX-impl(p0: double, p1: double): double
|
||||
public final static method getY-impl(p0: double, p1: double): double
|
||||
public method hashCode(): int
|
||||
public static method hashCode-impl(p0: double, p1: double): int
|
||||
public @org.jetbrains.annotations.NotNull method toString(): java.lang.String
|
||||
public static method toString-impl(p0: double, p1: double): java.lang.String
|
||||
public synthetic final method unbox-impl0(): double
|
||||
public synthetic final method unbox-impl1(): double
|
||||
public synthetic final method unbox-impl-0(): double
|
||||
public synthetic final method unbox-impl-1(): double
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class MFVCFieldInitializationOrderKt {
|
||||
// source: 'MFVCFieldInitializationOrder.kt'
|
||||
public final class MfvcFieldInitializationOrderKt {
|
||||
// source: 'MfvcFieldInitializationOrder.kt'
|
||||
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// WORKS_WHEN_VALUE_CLASS
|
||||
// LANGUAGE: +ValueClasses
|
||||
// CHECK_BYTECODE_LISTING
|
||||
|
||||
@JvmInline
|
||||
value class IC(val x: UInt)
|
||||
@@ -18,4 +19,12 @@ value class GreaterMFVC(val x: SimpleMFVC, val y: IC, val z: SimpleMFVC)
|
||||
|
||||
fun gmfvc(ic: IC, x: GreaterMFVC, ic1: UInt) = smfvc(ic, x.x, 0U) + ic(x.y) + smfvc(IC(0U), x.z, ic1)
|
||||
|
||||
fun box() = "OK" // todo real test
|
||||
fun box(): String {
|
||||
val o1 = IC(2U)
|
||||
require(ic(o1) == 2U)
|
||||
val o2 = SimpleMFVC(1U, o1, "3")
|
||||
require(smfvc(IC(4U), o2, 5U) == 12U)
|
||||
val o3 = GreaterMFVC(o2, IC(6U), SimpleMFVC(7U, IC(8U), "9"))
|
||||
require(gmfvc(IC(10U), o3, 11U) == 45U)
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
@kotlin.Metadata
|
||||
public final class ClassFlatteningKt {
|
||||
// source: 'classFlattening.kt'
|
||||
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
|
||||
public final static method gmfvc-Ket90g4(p0: int, p1: int, p2: int, @org.jetbrains.annotations.NotNull p3: java.lang.String, p4: int, p5: int, p6: int, @org.jetbrains.annotations.NotNull p7: java.lang.String, p8: int): int
|
||||
public final static method ic-K5cTq2M(p0: int): int
|
||||
public final static method smfvc-Ket90g4(p0: int, p1: int, p2: int, @org.jetbrains.annotations.NotNull p3: java.lang.String, p4: int): int
|
||||
}
|
||||
|
||||
@kotlin.jvm.JvmInline
|
||||
@kotlin.Metadata
|
||||
public final class GreaterMFVC {
|
||||
// source: 'classFlattening.kt'
|
||||
private final field field-0-0: int
|
||||
private final field field-0-1: int
|
||||
private final @org.jetbrains.annotations.NotNull field field-0-2: java.lang.String
|
||||
private final field field-1: int
|
||||
private final field field-2-0: int
|
||||
private final field field-2-1: int
|
||||
private final @org.jetbrains.annotations.NotNull field field-2-2: java.lang.String
|
||||
private synthetic method <init>(p0: int, p1: int, p2: java.lang.String, p3: int, p4: int, p5: int, p6: java.lang.String): void
|
||||
public synthetic final static method box-impl(p0: int, p1: int, p2: java.lang.String, p3: int, p4: int, p5: int, p6: java.lang.String): GreaterMFVC
|
||||
public final static method constructor-impl(p0: int, p1: int, @org.jetbrains.annotations.NotNull p2: java.lang.String, p3: int, p4: int, p5: int, @org.jetbrains.annotations.NotNull p6: java.lang.String): void
|
||||
public method equals(@org.jetbrains.annotations.Nullable p0: java.lang.Object): boolean
|
||||
public static method equals-impl(p0: int, p1: int, p2: java.lang.String, p3: int, p4: int, p5: int, p6: java.lang.String, p7: java.lang.Object): boolean
|
||||
public final static method equals-impl0(p0: int, p1: int, p2: java.lang.String, p3: int, p4: int, p5: int, p6: java.lang.String, p7: int, p8: int, p9: java.lang.String, p10: int, p11: int, p12: int, p13: java.lang.String): boolean
|
||||
public final static @org.jetbrains.annotations.NotNull method getX-impl(p0: int, p1: int, @org.jetbrains.annotations.NotNull p2: java.lang.String, p3: int, p4: int, p5: int, @org.jetbrains.annotations.NotNull p6: java.lang.String): SimpleMFVC
|
||||
public final static method getY-impl(p0: int, p1: int, @org.jetbrains.annotations.NotNull p2: java.lang.String, p3: int, p4: int, p5: int, @org.jetbrains.annotations.NotNull p6: java.lang.String): int
|
||||
public final static @org.jetbrains.annotations.NotNull method getZ-impl(p0: int, p1: int, @org.jetbrains.annotations.NotNull p2: java.lang.String, p3: int, p4: int, p5: int, @org.jetbrains.annotations.NotNull p6: java.lang.String): SimpleMFVC
|
||||
public method hashCode(): int
|
||||
public static method hashCode-impl(p0: int, p1: int, p2: java.lang.String, p3: int, p4: int, p5: int, p6: java.lang.String): int
|
||||
public @org.jetbrains.annotations.NotNull method toString(): java.lang.String
|
||||
public static method toString-impl(p0: int, p1: int, p2: java.lang.String, p3: int, p4: int, p5: int, p6: java.lang.String): java.lang.String
|
||||
public synthetic final method unbox-impl-0(): SimpleMFVC
|
||||
public synthetic final method unbox-impl-0-0(): int
|
||||
public synthetic final method unbox-impl-0-1(): int
|
||||
public synthetic final method unbox-impl-0-2(): java.lang.String
|
||||
public synthetic final method unbox-impl-1(): int
|
||||
public synthetic final method unbox-impl-2(): SimpleMFVC
|
||||
public synthetic final method unbox-impl-2-0(): int
|
||||
public synthetic final method unbox-impl-2-1(): int
|
||||
public synthetic final method unbox-impl-2-2(): java.lang.String
|
||||
}
|
||||
|
||||
@kotlin.jvm.JvmInline
|
||||
@kotlin.Metadata
|
||||
public final class IC {
|
||||
// source: 'classFlattening.kt'
|
||||
private final field x: int
|
||||
private synthetic method <init>(p0: int): void
|
||||
public synthetic final static method box-impl(p0: int): IC
|
||||
public static method constructor-impl(p0: int): int
|
||||
public method equals(p0: java.lang.Object): boolean
|
||||
public static method equals-impl(p0: int, p1: java.lang.Object): boolean
|
||||
public final static method equals-impl0(p0: int, p1: int): boolean
|
||||
public final method getX-pVg5ArA(): int
|
||||
public method hashCode(): int
|
||||
public static method hashCode-impl(p0: int): int
|
||||
public method toString(): java.lang.String
|
||||
public static method toString-impl(p0: int): java.lang.String
|
||||
public synthetic final method unbox-impl(): int
|
||||
}
|
||||
|
||||
@kotlin.jvm.JvmInline
|
||||
@kotlin.Metadata
|
||||
public final class SimpleMFVC {
|
||||
// source: 'classFlattening.kt'
|
||||
private final field field-0: int
|
||||
private final field field-1: int
|
||||
private final @org.jetbrains.annotations.NotNull field field-2: java.lang.String
|
||||
private synthetic method <init>(p0: int, p1: int, p2: java.lang.String): void
|
||||
public synthetic final static method box-impl(p0: int, p1: int, p2: java.lang.String): SimpleMFVC
|
||||
public final static method constructor-impl(p0: int, p1: int, @org.jetbrains.annotations.NotNull p2: java.lang.String): void
|
||||
public method equals(@org.jetbrains.annotations.Nullable p0: java.lang.Object): boolean
|
||||
public static method equals-impl(p0: int, p1: int, p2: java.lang.String, p3: java.lang.Object): boolean
|
||||
public final static method equals-impl0(p0: int, p1: int, p2: java.lang.String, p3: int, p4: int, p5: java.lang.String): boolean
|
||||
public final static method getX-impl(p0: int, p1: int, @org.jetbrains.annotations.NotNull p2: java.lang.String): int
|
||||
public final static method getY-impl(p0: int, p1: int, @org.jetbrains.annotations.NotNull p2: java.lang.String): int
|
||||
public final static @org.jetbrains.annotations.NotNull method getZ-impl(p0: int, p1: int, @org.jetbrains.annotations.NotNull p2: java.lang.String): java.lang.String
|
||||
public method hashCode(): int
|
||||
public static method hashCode-impl(p0: int, p1: int, p2: java.lang.String): int
|
||||
public @org.jetbrains.annotations.NotNull method toString(): java.lang.String
|
||||
public static method toString-impl(p0: int, p1: int, p2: java.lang.String): java.lang.String
|
||||
public synthetic final method unbox-impl-0(): int
|
||||
public synthetic final method unbox-impl-1(): int
|
||||
public synthetic final method unbox-impl-2(): java.lang.String
|
||||
}
|
||||
+139
-78
@@ -40,6 +40,15 @@ public final class B {
|
||||
public final class Base1$DefaultImpls {
|
||||
// source: 'complex.kt'
|
||||
public static @org.jetbrains.annotations.NotNull method getFakeOverrideMFVC(@org.jetbrains.annotations.NotNull p0: Base1): R
|
||||
public synthetic static method getFakeOverrideMFVC-0(p0: Base1): int
|
||||
public synthetic static method getFakeOverrideMFVC-1(p0: Base1): int
|
||||
public synthetic static method getFakeOverrideMFVC-2(p0: Base1): E
|
||||
public synthetic static method getFakeOverrideMFVC-2-0(p0: Base1): D
|
||||
public synthetic static method getFakeOverrideMFVC-2-0-0(p0: Base1): C
|
||||
public synthetic static method getFakeOverrideMFVC-2-0-0-0(p0: Base1): int
|
||||
public synthetic static method getFakeOverrideMFVC-2-0-0-1(p0: Base1): int
|
||||
public synthetic static method getFakeOverrideMFVC-2-0-0-2(p0: Base1): java.lang.String
|
||||
public synthetic static method getFakeOverrideMFVC-3(p0: Base1): java.util.List
|
||||
public static method getFakeOverrideRegular(@org.jetbrains.annotations.NotNull p0: Base1): int
|
||||
public final inner class Base1$DefaultImpls
|
||||
}
|
||||
@@ -48,6 +57,15 @@ public final class Base1$DefaultImpls {
|
||||
public interface Base1 {
|
||||
// source: 'complex.kt'
|
||||
public abstract @org.jetbrains.annotations.NotNull method getFakeOverrideMFVC(): R
|
||||
public synthetic abstract method getFakeOverrideMFVC-0(): int
|
||||
public synthetic abstract method getFakeOverrideMFVC-1(): int
|
||||
public synthetic abstract method getFakeOverrideMFVC-2(): E
|
||||
public synthetic abstract method getFakeOverrideMFVC-2-0(): D
|
||||
public synthetic abstract method getFakeOverrideMFVC-2-0-0(): C
|
||||
public synthetic abstract method getFakeOverrideMFVC-2-0-0-0(): int
|
||||
public synthetic abstract method getFakeOverrideMFVC-2-0-0-1(): int
|
||||
public synthetic abstract method getFakeOverrideMFVC-2-0-0-2(): java.lang.String
|
||||
public synthetic abstract method getFakeOverrideMFVC-3(): java.util.List
|
||||
public abstract method getFakeOverrideRegular(): int
|
||||
public final inner class Base1$DefaultImpls
|
||||
}
|
||||
@@ -56,6 +74,15 @@ public interface Base1 {
|
||||
public interface Base2 {
|
||||
// source: 'complex.kt'
|
||||
public abstract @org.jetbrains.annotations.NotNull method getL(): R
|
||||
public synthetic abstract method getL-0(): int
|
||||
public synthetic abstract method getL-1(): int
|
||||
public synthetic abstract method getL-2(): E
|
||||
public synthetic abstract method getL-2-0(): D
|
||||
public synthetic abstract method getL-2-0-0(): C
|
||||
public synthetic abstract method getL-2-0-0-0(): int
|
||||
public synthetic abstract method getL-2-0-0-1(): int
|
||||
public synthetic abstract method getL-2-0-0-2(): java.lang.String
|
||||
public synthetic abstract method getL-3(): java.util.List
|
||||
public abstract method setL-sUp7gFk(p0: int, p1: int, p2: int, p3: int, @org.jetbrains.annotations.NotNull p4: java.lang.String, @org.jetbrains.annotations.NotNull p5: java.util.List): void
|
||||
}
|
||||
|
||||
@@ -63,6 +90,11 @@ public interface Base2 {
|
||||
public interface Base3 {
|
||||
// source: 'complex.kt'
|
||||
public abstract @org.jetbrains.annotations.NotNull method getZ(): E
|
||||
public synthetic abstract method getZ-0(): D
|
||||
public synthetic abstract method getZ-0-0(): C
|
||||
public synthetic abstract method getZ-0-0-0(): int
|
||||
public synthetic abstract method getZ-0-0-1(): int
|
||||
public synthetic abstract method getZ-0-0-2(): java.lang.String
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
@@ -76,25 +108,25 @@ public interface Base4 {
|
||||
@kotlin.Metadata
|
||||
public final class C {
|
||||
// source: 'complex.kt'
|
||||
private field x: int
|
||||
private field y: int
|
||||
private @org.jetbrains.annotations.NotNull field z: java.lang.String
|
||||
private final field field-0: int
|
||||
private final field field-1: int
|
||||
private final @org.jetbrains.annotations.NotNull field field-2: java.lang.String
|
||||
private synthetic method <init>(p0: int, p1: int, p2: java.lang.String): void
|
||||
public synthetic final static method box-impl(p0: int, p1: int, p2: java.lang.String): C
|
||||
public final static method constructor-impl(p0: int, p1: int, @org.jetbrains.annotations.NotNull p2: java.lang.String): void
|
||||
public method equals(@org.jetbrains.annotations.Nullable p0: java.lang.Object): boolean
|
||||
public static method equals-impl(p0: int, p1: int, p2: java.lang.String, p3: java.lang.Object): boolean
|
||||
public final static method equals-impl0(p0: int, p1: int, p2: java.lang.String, p3: int, p4: int, p5: java.lang.String): boolean
|
||||
public final method getX(): int
|
||||
public final method getY-GsR9Xnw(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getZ(): java.lang.String
|
||||
public final static method getX-impl(p0: int, p1: int, @org.jetbrains.annotations.NotNull p2: java.lang.String): int
|
||||
public final static method getY-impl(p0: int, p1: int, @org.jetbrains.annotations.NotNull p2: java.lang.String): int
|
||||
public final static @org.jetbrains.annotations.NotNull method getZ-impl(p0: int, p1: int, @org.jetbrains.annotations.NotNull p2: java.lang.String): java.lang.String
|
||||
public method hashCode(): int
|
||||
public static method hashCode-impl(p0: int, p1: int, p2: java.lang.String): int
|
||||
public @org.jetbrains.annotations.NotNull method toString(): java.lang.String
|
||||
public static method toString-impl(p0: int, p1: int, p2: java.lang.String): java.lang.String
|
||||
public synthetic final method unbox-impl0(): int
|
||||
public synthetic final method unbox-impl1(): int
|
||||
public synthetic final method unbox-impl2(): java.lang.String
|
||||
public synthetic final method unbox-impl-0(): int
|
||||
public synthetic final method unbox-impl-1(): int
|
||||
public synthetic final method unbox-impl-2(): java.lang.String
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
@@ -118,9 +150,9 @@ public final class ComplexKt {
|
||||
@kotlin.Metadata
|
||||
public final class D {
|
||||
// source: 'complex.kt'
|
||||
private field x$x: int
|
||||
private field x$y: int
|
||||
private @org.jetbrains.annotations.NotNull field x$z: java.lang.String
|
||||
private final field field-0-0: int
|
||||
private final field field-0-1: int
|
||||
private final @org.jetbrains.annotations.NotNull field field-0-2: java.lang.String
|
||||
private synthetic method <init>(p0: int, p1: int, p2: java.lang.String): void
|
||||
public synthetic final static method box-impl(p0: int, p1: int, p2: java.lang.String): D
|
||||
public final static method constructor-impl(p0: int, p1: int, @org.jetbrains.annotations.NotNull p2: java.lang.String): void
|
||||
@@ -128,26 +160,24 @@ public final class D {
|
||||
public method equals(@org.jetbrains.annotations.Nullable p0: java.lang.Object): boolean
|
||||
public static method equals-impl(p0: int, p1: int, p2: java.lang.String, p3: java.lang.Object): boolean
|
||||
public final static method equals-impl0(p0: int, p1: int, p2: java.lang.String, p3: int, p4: int, p5: java.lang.String): boolean
|
||||
public final method getX$x(): int
|
||||
public final method getX$y-GsR9Xnw(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getX$z(): java.lang.String
|
||||
public final @org.jetbrains.annotations.NotNull method getX(): C
|
||||
public final static @org.jetbrains.annotations.NotNull method getX-impl(p0: int, p1: int, @org.jetbrains.annotations.NotNull p2: java.lang.String): C
|
||||
public method hashCode(): int
|
||||
public static method hashCode-impl(p0: int, p1: int, p2: java.lang.String): int
|
||||
public @org.jetbrains.annotations.NotNull method toString(): java.lang.String
|
||||
public static method toString-impl(p0: int, p1: int, p2: java.lang.String): java.lang.String
|
||||
public synthetic final method unbox-impl0(): int
|
||||
public synthetic final method unbox-impl1(): int
|
||||
public synthetic final method unbox-impl2(): java.lang.String
|
||||
public synthetic final method unbox-impl-0(): C
|
||||
public synthetic final method unbox-impl-0-0(): int
|
||||
public synthetic final method unbox-impl-0-1(): int
|
||||
public synthetic final method unbox-impl-0-2(): java.lang.String
|
||||
}
|
||||
|
||||
@kotlin.jvm.JvmInline
|
||||
@kotlin.Metadata
|
||||
public final class E {
|
||||
// source: 'complex.kt'
|
||||
private field x$x$x: int
|
||||
private field x$x$y: int
|
||||
private @org.jetbrains.annotations.NotNull field x$x$z: java.lang.String
|
||||
private final field field-0-0-0: int
|
||||
private final field field-0-0-1: int
|
||||
private final @org.jetbrains.annotations.NotNull field field-0-0-2: java.lang.String
|
||||
private synthetic method <init>(p0: int, p1: int, p2: java.lang.String): void
|
||||
public synthetic final static method box-impl(p0: int, p1: int, p2: java.lang.String): E
|
||||
public final static method constructor-impl(p0: int, p1: int, @org.jetbrains.annotations.NotNull p2: java.lang.String): void
|
||||
@@ -155,61 +185,86 @@ public final class E {
|
||||
public static method equals-impl(p0: int, p1: int, p2: java.lang.String, p3: java.lang.Object): boolean
|
||||
public final static method equals-impl0(p0: int, p1: int, p2: java.lang.String, p3: int, p4: int, p5: java.lang.String): boolean
|
||||
public final static @org.jetbrains.annotations.NotNull method getWithNonTrivialSetters-impl(p0: int, p1: int, @org.jetbrains.annotations.NotNull p2: java.lang.String): D
|
||||
public final method getX$x$x(): int
|
||||
public final method getX$x$y-GsR9Xnw(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getX$x$z(): java.lang.String
|
||||
public final @org.jetbrains.annotations.NotNull method getX$x(): C
|
||||
public final @org.jetbrains.annotations.NotNull method getX(): D
|
||||
public final static @org.jetbrains.annotations.NotNull method getX-impl(p0: int, p1: int, @org.jetbrains.annotations.NotNull p2: java.lang.String): D
|
||||
public method hashCode(): int
|
||||
public static method hashCode-impl(p0: int, p1: int, p2: java.lang.String): int
|
||||
public final static method setWithNonTrivialSetters-sUp7gFk(p0: int, p1: int, @org.jetbrains.annotations.NotNull p2: java.lang.String, p3: int, p4: int, @org.jetbrains.annotations.NotNull p5: java.lang.String): void
|
||||
public @org.jetbrains.annotations.NotNull method toString(): java.lang.String
|
||||
public static method toString-impl(p0: int, p1: int, p2: java.lang.String): java.lang.String
|
||||
public synthetic final method unbox-impl0(): int
|
||||
public synthetic final method unbox-impl1(): int
|
||||
public synthetic final method unbox-impl2(): java.lang.String
|
||||
public synthetic final method unbox-impl-0(): D
|
||||
public synthetic final method unbox-impl-0-0(): C
|
||||
public synthetic final method unbox-impl-0-0-0(): int
|
||||
public synthetic final method unbox-impl-0-0-1(): int
|
||||
public synthetic final method unbox-impl-0-0-2(): java.lang.String
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class NotInlined {
|
||||
// source: 'complex.kt'
|
||||
private @org.jetbrains.annotations.NotNull field l$t: java.util.List
|
||||
private field l$x: int
|
||||
private field l$y: int
|
||||
private field l$z$x$x$x: int
|
||||
private field l$z$x$x$y: int
|
||||
private @org.jetbrains.annotations.NotNull field l$z$x$x$z: java.lang.String
|
||||
private @org.jetbrains.annotations.NotNull field withNonTrivialGettersWithBF$t: java.util.List
|
||||
private field withNonTrivialGettersWithBF$x: int
|
||||
private field withNonTrivialGettersWithBF$y: int
|
||||
private field withNonTrivialGettersWithBF$z$x$x$x: int
|
||||
private field withNonTrivialGettersWithBF$z$x$x$y: int
|
||||
private @org.jetbrains.annotations.NotNull field withNonTrivialGettersWithBF$z$x$x$z: java.lang.String
|
||||
private @org.jetbrains.annotations.NotNull field withNonTrivialSettersWithBF$t: java.util.List
|
||||
private field withNonTrivialSettersWithBF$x: int
|
||||
private field withNonTrivialSettersWithBF$y: int
|
||||
private field withNonTrivialSettersWithBF$z$x$x$x: int
|
||||
private field withNonTrivialSettersWithBF$z$x$x$y: int
|
||||
private @org.jetbrains.annotations.NotNull field withNonTrivialSettersWithBF$z$x$x$z: java.lang.String
|
||||
private field l-0: int
|
||||
private field l-1: int
|
||||
private field l-2-0-0-0: int
|
||||
private field l-2-0-0-1: int
|
||||
private @org.jetbrains.annotations.NotNull field l-2-0-0-2: java.lang.String
|
||||
private @org.jetbrains.annotations.NotNull field l-3: java.util.List
|
||||
private final field withNonTrivialGettersWithBF-0: int
|
||||
private final field withNonTrivialGettersWithBF-1: int
|
||||
private final field withNonTrivialGettersWithBF-2-0-0-0: int
|
||||
private final field withNonTrivialGettersWithBF-2-0-0-1: int
|
||||
private final @org.jetbrains.annotations.NotNull field withNonTrivialGettersWithBF-2-0-0-2: java.lang.String
|
||||
private final @org.jetbrains.annotations.NotNull field withNonTrivialGettersWithBF-3: java.util.List
|
||||
private field withNonTrivialSettersWithBF-0: int
|
||||
private field withNonTrivialSettersWithBF-1: int
|
||||
private field withNonTrivialSettersWithBF-2-0-0-0: int
|
||||
private field withNonTrivialSettersWithBF-2-0-0-1: int
|
||||
private @org.jetbrains.annotations.NotNull field withNonTrivialSettersWithBF-2-0-0-2: java.lang.String
|
||||
private @org.jetbrains.annotations.NotNull field withNonTrivialSettersWithBF-3: java.util.List
|
||||
private field y: int
|
||||
private method <init>(p0: int, p1: int, p2: int, p3: int, p4: java.lang.String, p5: java.util.List, p6: int): void
|
||||
public synthetic method <init>(p0: int, p1: int, p2: int, p3: int, p4: java.lang.String, p5: java.util.List, p6: int, p7: kotlin.jvm.internal.DefaultConstructorMarker): void
|
||||
public @org.jetbrains.annotations.NotNull method getFakeOverrideMFVC(): R
|
||||
public method getFakeOverrideRegular(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getL$t-GKOAj6k(): java.util.List
|
||||
public final method getL$x(): int
|
||||
public final method getL$y-pVg5ArA(): int
|
||||
public final method getL$z$x$x$x(): int
|
||||
public final method getL$z$x$x$y-GsR9Xnw(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getL$z$x$x$z(): java.lang.String
|
||||
public final @org.jetbrains.annotations.NotNull method getL$z$x$x(): C
|
||||
public final @org.jetbrains.annotations.NotNull method getL$z$x(): D
|
||||
public final @org.jetbrains.annotations.NotNull method getL$z(): E
|
||||
public @org.jetbrains.annotations.NotNull method getL(): R
|
||||
public synthetic bridge method getL(): java.lang.Object
|
||||
public synthetic method getL-0(): int
|
||||
public synthetic method getL-1(): int
|
||||
public synthetic method getL-2(): E
|
||||
public synthetic method getL-2-0(): D
|
||||
public synthetic method getL-2-0-0(): C
|
||||
public synthetic method getL-2-0-0-0(): int
|
||||
public synthetic method getL-2-0-0-1(): int
|
||||
public synthetic method getL-2-0-0-2(): java.lang.String
|
||||
public synthetic method getL-3(): java.util.List
|
||||
public final @org.jetbrains.annotations.NotNull method getWithNonTrivialGettersWithBF(): R
|
||||
public synthetic final method getWithNonTrivialGettersWithBF-0(): int
|
||||
public synthetic final method getWithNonTrivialGettersWithBF-1(): int
|
||||
public synthetic final method getWithNonTrivialGettersWithBF-2(): E
|
||||
public synthetic final method getWithNonTrivialGettersWithBF-2-0(): D
|
||||
public synthetic final method getWithNonTrivialGettersWithBF-2-0-0(): C
|
||||
public synthetic final method getWithNonTrivialGettersWithBF-2-0-0-0(): int
|
||||
public synthetic final method getWithNonTrivialGettersWithBF-2-0-0-1(): int
|
||||
public synthetic final method getWithNonTrivialGettersWithBF-2-0-0-2(): java.lang.String
|
||||
public synthetic final method getWithNonTrivialGettersWithBF-3(): java.util.List
|
||||
public final @org.jetbrains.annotations.NotNull method getWithNonTrivialSetters(): R
|
||||
public synthetic final method getWithNonTrivialSetters-0(): int
|
||||
public synthetic final method getWithNonTrivialSetters-1(): int
|
||||
public synthetic final method getWithNonTrivialSetters-2(): E
|
||||
public synthetic final method getWithNonTrivialSetters-2-0(): D
|
||||
public synthetic final method getWithNonTrivialSetters-2-0-0(): C
|
||||
public synthetic final method getWithNonTrivialSetters-2-0-0-0(): int
|
||||
public synthetic final method getWithNonTrivialSetters-2-0-0-1(): int
|
||||
public synthetic final method getWithNonTrivialSetters-2-0-0-2(): java.lang.String
|
||||
public synthetic final method getWithNonTrivialSetters-3(): java.util.List
|
||||
public final @org.jetbrains.annotations.NotNull method getWithNonTrivialSettersWithBF(): R
|
||||
public synthetic final method getWithNonTrivialSettersWithBF-0(): int
|
||||
public synthetic final method getWithNonTrivialSettersWithBF-1(): int
|
||||
public synthetic final method getWithNonTrivialSettersWithBF-2(): E
|
||||
public synthetic final method getWithNonTrivialSettersWithBF-2-0(): D
|
||||
public synthetic final method getWithNonTrivialSettersWithBF-2-0-0(): C
|
||||
public synthetic final method getWithNonTrivialSettersWithBF-2-0-0-0(): int
|
||||
public synthetic final method getWithNonTrivialSettersWithBF-2-0-0-1(): int
|
||||
public synthetic final method getWithNonTrivialSettersWithBF-2-0-0-2(): java.lang.String
|
||||
public synthetic final method getWithNonTrivialSettersWithBF-3(): java.util.List
|
||||
public final method getY(): int
|
||||
public synthetic bridge method setL(p0: java.lang.Object): void
|
||||
public method setL-sUp7gFk(p0: int, p1: int, p2: int, p3: int, @org.jetbrains.annotations.NotNull p4: java.lang.String, @org.jetbrains.annotations.NotNull p5: java.util.List): void
|
||||
@@ -218,18 +273,19 @@ public final class NotInlined {
|
||||
public final method setY(p0: int): void
|
||||
public @org.jetbrains.annotations.NotNull method toString(): java.lang.String
|
||||
public final method trySetter(): void
|
||||
public final inner class Base1$DefaultImpls
|
||||
}
|
||||
|
||||
@kotlin.jvm.JvmInline
|
||||
@kotlin.Metadata
|
||||
public final class R {
|
||||
// source: 'complex.kt'
|
||||
private @org.jetbrains.annotations.NotNull field t: java.util.List
|
||||
private field x: int
|
||||
private field y: int
|
||||
private field z$x$x$x: int
|
||||
private field z$x$x$y: int
|
||||
private @org.jetbrains.annotations.NotNull field z$x$x$z: java.lang.String
|
||||
private final field field-0: int
|
||||
private final field field-1: int
|
||||
private final field field-2-0-0-0: int
|
||||
private final field field-2-0-0-1: int
|
||||
private final @org.jetbrains.annotations.NotNull field field-2-0-0-2: java.lang.String
|
||||
private final @org.jetbrains.annotations.NotNull field field-3: java.util.List
|
||||
private synthetic method <init>(p0: int, p1: int, p2: int, p3: int, p4: java.lang.String, p5: java.util.List): void
|
||||
public synthetic final static method box-impl(p0: int, p1: int, p2: int, p3: int, p4: java.lang.String, p5: java.util.List): R
|
||||
public final static method constructor-impl(p0: int, p1: int, p2: int, p3: int, @org.jetbrains.annotations.NotNull p4: java.lang.String, @org.jetbrains.annotations.NotNull p5: java.util.List): void
|
||||
@@ -240,23 +296,28 @@ public final class R {
|
||||
public static @org.jetbrains.annotations.NotNull method getFakeOverrideMFVC-impl(p0: int, p1: int, p2: int, p3: int, @org.jetbrains.annotations.NotNull p4: java.lang.String, @org.jetbrains.annotations.NotNull p5: java.util.List): R
|
||||
public method getFakeOverrideRegular(): int
|
||||
public static method getFakeOverrideRegular-impl(p0: int, p1: int, p2: int, p3: int, @org.jetbrains.annotations.NotNull p4: java.lang.String, @org.jetbrains.annotations.NotNull p5: java.util.List): int
|
||||
public final @org.jetbrains.annotations.NotNull method getT-GKOAj6k(): java.util.List
|
||||
public final method getX(): int
|
||||
public final method getY-pVg5ArA(): int
|
||||
public final method getZ$x$x$x(): int
|
||||
public final method getZ$x$x$y-GsR9Xnw(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getZ$x$x$z(): java.lang.String
|
||||
public final @org.jetbrains.annotations.NotNull method getZ$x$x(): C
|
||||
public final @org.jetbrains.annotations.NotNull method getZ$x(): D
|
||||
public final @org.jetbrains.annotations.NotNull method getZ(): E
|
||||
public final static @org.jetbrains.annotations.NotNull method getT-impl(p0: int, p1: int, p2: int, p3: int, @org.jetbrains.annotations.NotNull p4: java.lang.String, @org.jetbrains.annotations.NotNull p5: java.util.List): java.util.List
|
||||
public final static method getX-impl(p0: int, p1: int, p2: int, p3: int, @org.jetbrains.annotations.NotNull p4: java.lang.String, @org.jetbrains.annotations.NotNull p5: java.util.List): int
|
||||
public final static method getY-impl(p0: int, p1: int, p2: int, p3: int, @org.jetbrains.annotations.NotNull p4: java.lang.String, @org.jetbrains.annotations.NotNull p5: java.util.List): int
|
||||
public @org.jetbrains.annotations.NotNull method getZ(): E
|
||||
public synthetic bridge method getZ-0(): D
|
||||
public synthetic bridge method getZ-0-0(): C
|
||||
public synthetic bridge method getZ-0-0-0(): int
|
||||
public synthetic bridge method getZ-0-0-1(): int
|
||||
public synthetic bridge method getZ-0-0-2(): java.lang.String
|
||||
public static @org.jetbrains.annotations.NotNull method getZ-impl(p0: int, p1: int, p2: int, p3: int, @org.jetbrains.annotations.NotNull p4: java.lang.String, @org.jetbrains.annotations.NotNull p5: java.util.List): E
|
||||
public method hashCode(): int
|
||||
public static method hashCode-impl(p0: int, p1: int, p2: int, p3: int, p4: java.lang.String, p5: java.util.List): int
|
||||
public @org.jetbrains.annotations.NotNull method toString(): java.lang.String
|
||||
public static method toString-impl(p0: int, p1: int, p2: int, p3: int, p4: java.lang.String, p5: java.util.List): java.lang.String
|
||||
public synthetic final method unbox-impl0(): int
|
||||
public synthetic final method unbox-impl1(): int
|
||||
public synthetic final method unbox-impl2(): int
|
||||
public synthetic final method unbox-impl3(): int
|
||||
public synthetic final method unbox-impl4(): java.lang.String
|
||||
public synthetic final method unbox-impl5(): java.util.List
|
||||
public synthetic final method unbox-impl-0(): int
|
||||
public synthetic final method unbox-impl-1(): int
|
||||
public synthetic final method unbox-impl-2(): E
|
||||
public synthetic final method unbox-impl-2-0(): D
|
||||
public synthetic final method unbox-impl-2-0-0(): C
|
||||
public synthetic final method unbox-impl-2-0-0-0(): int
|
||||
public synthetic final method unbox-impl-2-0-0-1(): int
|
||||
public synthetic final method unbox-impl-2-0-0-2(): java.lang.String
|
||||
public synthetic final method unbox-impl-3(): java.util.List
|
||||
public final inner class Base1$DefaultImpls
|
||||
}
|
||||
|
||||
+82
-101
@@ -2,127 +2,108 @@
|
||||
@kotlin.Metadata
|
||||
public final class A {
|
||||
// source: 'equality.kt'
|
||||
private field f1: int
|
||||
private field f2: int
|
||||
private field f3$x: int
|
||||
private field f3$y: int
|
||||
private field f4: int
|
||||
private field f5: int
|
||||
private @org.jetbrains.annotations.NotNull field f6: java.lang.String
|
||||
private field f7: int
|
||||
private field f8: int
|
||||
private @org.jetbrains.annotations.NotNull field f9: java.lang.String
|
||||
private final field field-0: int
|
||||
private final field field-1: int
|
||||
private final field field-2-0: int
|
||||
private final field field-2-1: int
|
||||
private final field field-3: int
|
||||
private final field field-4: int
|
||||
private final @org.jetbrains.annotations.NotNull field field-5: java.lang.String
|
||||
private final field field-6: int
|
||||
private final field field-7: int
|
||||
private final @org.jetbrains.annotations.NotNull field field-8: java.lang.String
|
||||
private synthetic method <init>(p0: int, p1: int, p2: int, p3: int, p4: int, p5: int, p6: java.lang.String, p7: int, p8: int, p9: java.lang.String): void
|
||||
public synthetic final static method box-impl(p0: int, p1: int, p2: int, p3: int, p4: int, p5: int, p6: java.lang.String, p7: int, p8: int, p9: java.lang.String): A
|
||||
public final static method constructor-impl(p0: int, p1: int, p2: int, p3: int, p4: int, p5: int, @org.jetbrains.annotations.NotNull p6: java.lang.String, p7: int, p8: int, @org.jetbrains.annotations.NotNull p9: java.lang.String): void
|
||||
public method equals(@org.jetbrains.annotations.Nullable p0: java.lang.Object): boolean
|
||||
public static method equals-impl(p0: int, p1: int, p2: int, p3: int, p4: int, p5: int, p6: java.lang.String, p7: int, p8: int, p9: java.lang.String, p10: java.lang.Object): boolean
|
||||
public final static method equals-impl0(p0: int, p1: int, p2: int, p3: int, p4: int, p5: int, p6: java.lang.String, p7: int, p8: int, p9: java.lang.String, p10: int, p11: int, p12: int, p13: int, p14: int, p15: int, p16: java.lang.String, p17: int, p18: int, p19: java.lang.String): boolean
|
||||
public final method getF1-DbFnDB4(): int
|
||||
public final method getF2-ejSTSP4(): int
|
||||
public final method getF3$x-DbFnDB4(): int
|
||||
public final method getF3$y-ejSTSP4(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getF3(): F3
|
||||
public final method getF4-4yoqybc(): int
|
||||
public final method getF5-z3qHWqM(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getF6-OgMO970(): java.lang.String
|
||||
public final method getF7(): int
|
||||
public final method getF8-pVg5ArA(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getF9(): java.lang.String
|
||||
public final static method getF1-impl(p0: int, p1: int, p2: int, p3: int, p4: int, p5: int, @org.jetbrains.annotations.NotNull p6: java.lang.String, p7: int, p8: int, @org.jetbrains.annotations.NotNull p9: java.lang.String): int
|
||||
public final static method getF2-impl(p0: int, p1: int, p2: int, p3: int, p4: int, p5: int, @org.jetbrains.annotations.NotNull p6: java.lang.String, p7: int, p8: int, @org.jetbrains.annotations.NotNull p9: java.lang.String): int
|
||||
public final static @org.jetbrains.annotations.NotNull method getF3-impl(p0: int, p1: int, p2: int, p3: int, p4: int, p5: int, @org.jetbrains.annotations.NotNull p6: java.lang.String, p7: int, p8: int, @org.jetbrains.annotations.NotNull p9: java.lang.String): F3
|
||||
public final static method getF4-impl(p0: int, p1: int, p2: int, p3: int, p4: int, p5: int, @org.jetbrains.annotations.NotNull p6: java.lang.String, p7: int, p8: int, @org.jetbrains.annotations.NotNull p9: java.lang.String): int
|
||||
public final static method getF5-impl(p0: int, p1: int, p2: int, p3: int, p4: int, p5: int, @org.jetbrains.annotations.NotNull p6: java.lang.String, p7: int, p8: int, @org.jetbrains.annotations.NotNull p9: java.lang.String): int
|
||||
public final static @org.jetbrains.annotations.NotNull method getF6-impl(p0: int, p1: int, p2: int, p3: int, p4: int, p5: int, @org.jetbrains.annotations.NotNull p6: java.lang.String, p7: int, p8: int, @org.jetbrains.annotations.NotNull p9: java.lang.String): java.lang.String
|
||||
public final static method getF7-impl(p0: int, p1: int, p2: int, p3: int, p4: int, p5: int, @org.jetbrains.annotations.NotNull p6: java.lang.String, p7: int, p8: int, @org.jetbrains.annotations.NotNull p9: java.lang.String): int
|
||||
public final static method getF8-impl(p0: int, p1: int, p2: int, p3: int, p4: int, p5: int, @org.jetbrains.annotations.NotNull p6: java.lang.String, p7: int, p8: int, @org.jetbrains.annotations.NotNull p9: java.lang.String): int
|
||||
public final static @org.jetbrains.annotations.NotNull method getF9-impl(p0: int, p1: int, p2: int, p3: int, p4: int, p5: int, @org.jetbrains.annotations.NotNull p6: java.lang.String, p7: int, p8: int, @org.jetbrains.annotations.NotNull p9: java.lang.String): java.lang.String
|
||||
public method hashCode(): int
|
||||
public static method hashCode-impl(p0: int, p1: int, p2: int, p3: int, p4: int, p5: int, p6: java.lang.String, p7: int, p8: int, p9: java.lang.String): int
|
||||
public @org.jetbrains.annotations.NotNull method toString(): java.lang.String
|
||||
public static method toString-impl(p0: int, p1: int, p2: int, p3: int, p4: int, p5: int, p6: java.lang.String, p7: int, p8: int, p9: java.lang.String): java.lang.String
|
||||
public synthetic final method unbox-impl0(): int
|
||||
public synthetic final method unbox-impl1(): int
|
||||
public synthetic final method unbox-impl2(): int
|
||||
public synthetic final method unbox-impl3(): int
|
||||
public synthetic final method unbox-impl4(): int
|
||||
public synthetic final method unbox-impl5(): int
|
||||
public synthetic final method unbox-impl6(): java.lang.String
|
||||
public synthetic final method unbox-impl7(): int
|
||||
public synthetic final method unbox-impl8(): int
|
||||
public synthetic final method unbox-impl9(): java.lang.String
|
||||
public synthetic final method unbox-impl-0(): int
|
||||
public synthetic final method unbox-impl-1(): int
|
||||
public synthetic final method unbox-impl-2(): F3
|
||||
public synthetic final method unbox-impl-2-0(): int
|
||||
public synthetic final method unbox-impl-2-1(): int
|
||||
public synthetic final method unbox-impl-3(): int
|
||||
public synthetic final method unbox-impl-4(): int
|
||||
public synthetic final method unbox-impl-5(): java.lang.String
|
||||
public synthetic final method unbox-impl-6(): int
|
||||
public synthetic final method unbox-impl-7(): int
|
||||
public synthetic final method unbox-impl-8(): java.lang.String
|
||||
}
|
||||
|
||||
@kotlin.jvm.JvmInline
|
||||
@kotlin.Metadata
|
||||
public final class B {
|
||||
// source: 'equality.kt'
|
||||
private field a1$f1: int
|
||||
private field a1$f2: int
|
||||
private field a1$f3$x: int
|
||||
private field a1$f3$y: int
|
||||
private field a1$f4: int
|
||||
private field a1$f5: int
|
||||
private @org.jetbrains.annotations.NotNull field a1$f6: java.lang.String
|
||||
private field a1$f7: int
|
||||
private field a1$f8: int
|
||||
private @org.jetbrains.annotations.NotNull field a1$f9: java.lang.String
|
||||
private field a2$f1: int
|
||||
private field a2$f2: int
|
||||
private field a2$f3$x: int
|
||||
private field a2$f3$y: int
|
||||
private field a2$f4: int
|
||||
private field a2$f5: int
|
||||
private @org.jetbrains.annotations.NotNull field a2$f6: java.lang.String
|
||||
private field a2$f7: int
|
||||
private field a2$f8: int
|
||||
private @org.jetbrains.annotations.NotNull field a2$f9: java.lang.String
|
||||
private final field field-0-0: int
|
||||
private final field field-0-1: int
|
||||
private final field field-0-2-0: int
|
||||
private final field field-0-2-1: int
|
||||
private final field field-0-3: int
|
||||
private final field field-0-4: int
|
||||
private final @org.jetbrains.annotations.NotNull field field-0-5: java.lang.String
|
||||
private final field field-0-6: int
|
||||
private final field field-0-7: int
|
||||
private final @org.jetbrains.annotations.NotNull field field-0-8: java.lang.String
|
||||
private final field field-1-0: int
|
||||
private final field field-1-1: int
|
||||
private final field field-1-2-0: int
|
||||
private final field field-1-2-1: int
|
||||
private final field field-1-3: int
|
||||
private final field field-1-4: int
|
||||
private final @org.jetbrains.annotations.NotNull field field-1-5: java.lang.String
|
||||
private final field field-1-6: int
|
||||
private final field field-1-7: int
|
||||
private final @org.jetbrains.annotations.NotNull field field-1-8: java.lang.String
|
||||
private synthetic method <init>(p0: int, p1: int, p2: int, p3: int, p4: int, p5: int, p6: java.lang.String, p7: int, p8: int, p9: java.lang.String, p10: int, p11: int, p12: int, p13: int, p14: int, p15: int, p16: java.lang.String, p17: int, p18: int, p19: java.lang.String): void
|
||||
public synthetic final static method box-impl(p0: int, p1: int, p2: int, p3: int, p4: int, p5: int, p6: java.lang.String, p7: int, p8: int, p9: java.lang.String, p10: int, p11: int, p12: int, p13: int, p14: int, p15: int, p16: java.lang.String, p17: int, p18: int, p19: java.lang.String): B
|
||||
public final static method constructor-impl(p0: int, p1: int, p2: int, p3: int, p4: int, p5: int, @org.jetbrains.annotations.NotNull p6: java.lang.String, p7: int, p8: int, @org.jetbrains.annotations.NotNull p9: java.lang.String, p10: int, p11: int, p12: int, p13: int, p14: int, p15: int, @org.jetbrains.annotations.NotNull p16: java.lang.String, p17: int, p18: int, @org.jetbrains.annotations.NotNull p19: java.lang.String): void
|
||||
public method equals(@org.jetbrains.annotations.Nullable p0: java.lang.Object): boolean
|
||||
public static method equals-impl(p0: int, p1: int, p2: int, p3: int, p4: int, p5: int, p6: java.lang.String, p7: int, p8: int, p9: java.lang.String, p10: int, p11: int, p12: int, p13: int, p14: int, p15: int, p16: java.lang.String, p17: int, p18: int, p19: java.lang.String, p20: java.lang.Object): boolean
|
||||
public final static method equals-impl0(p0: int, p1: int, p2: int, p3: int, p4: int, p5: int, p6: java.lang.String, p7: int, p8: int, p9: java.lang.String, p10: int, p11: int, p12: int, p13: int, p14: int, p15: int, p16: java.lang.String, p17: int, p18: int, p19: java.lang.String, p20: int, p21: int, p22: int, p23: int, p24: int, p25: int, p26: java.lang.String, p27: int, p28: int, p29: java.lang.String, p30: int, p31: int, p32: int, p33: int, p34: int, p35: int, p36: java.lang.String, p37: int, p38: int, p39: java.lang.String): boolean
|
||||
public final method getA1$f1-DbFnDB4(): int
|
||||
public final method getA1$f2-ejSTSP4(): int
|
||||
public final method getA1$f3$x-DbFnDB4(): int
|
||||
public final method getA1$f3$y-ejSTSP4(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getA1$f3(): F3
|
||||
public final method getA1$f4-4yoqybc(): int
|
||||
public final method getA1$f5-z3qHWqM(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getA1$f6-OgMO970(): java.lang.String
|
||||
public final method getA1$f7(): int
|
||||
public final method getA1$f8-pVg5ArA(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getA1$f9(): java.lang.String
|
||||
public final @org.jetbrains.annotations.NotNull method getA1(): A
|
||||
public final method getA2$f1-DbFnDB4(): int
|
||||
public final method getA2$f2-ejSTSP4(): int
|
||||
public final method getA2$f3$x-DbFnDB4(): int
|
||||
public final method getA2$f3$y-ejSTSP4(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getA2$f3(): F3
|
||||
public final method getA2$f4-4yoqybc(): int
|
||||
public final method getA2$f5-z3qHWqM(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getA2$f6-OgMO970(): java.lang.String
|
||||
public final method getA2$f7(): int
|
||||
public final method getA2$f8-pVg5ArA(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getA2$f9(): java.lang.String
|
||||
public final @org.jetbrains.annotations.NotNull method getA2(): A
|
||||
public final static @org.jetbrains.annotations.NotNull method getA1-impl(p0: int, p1: int, p2: int, p3: int, p4: int, p5: int, @org.jetbrains.annotations.NotNull p6: java.lang.String, p7: int, p8: int, @org.jetbrains.annotations.NotNull p9: java.lang.String, p10: int, p11: int, p12: int, p13: int, p14: int, p15: int, @org.jetbrains.annotations.NotNull p16: java.lang.String, p17: int, p18: int, @org.jetbrains.annotations.NotNull p19: java.lang.String): A
|
||||
public final static @org.jetbrains.annotations.NotNull method getA2-impl(p0: int, p1: int, p2: int, p3: int, p4: int, p5: int, @org.jetbrains.annotations.NotNull p6: java.lang.String, p7: int, p8: int, @org.jetbrains.annotations.NotNull p9: java.lang.String, p10: int, p11: int, p12: int, p13: int, p14: int, p15: int, @org.jetbrains.annotations.NotNull p16: java.lang.String, p17: int, p18: int, @org.jetbrains.annotations.NotNull p19: java.lang.String): A
|
||||
public method hashCode(): int
|
||||
public static method hashCode-impl(p0: int, p1: int, p2: int, p3: int, p4: int, p5: int, p6: java.lang.String, p7: int, p8: int, p9: java.lang.String, p10: int, p11: int, p12: int, p13: int, p14: int, p15: int, p16: java.lang.String, p17: int, p18: int, p19: java.lang.String): int
|
||||
public @org.jetbrains.annotations.NotNull method toString(): java.lang.String
|
||||
public static @org.jetbrains.annotations.NotNull method toString-impl(p0: int, p1: int, p2: int, p3: int, p4: int, p5: int, @org.jetbrains.annotations.NotNull p6: java.lang.String, p7: int, p8: int, @org.jetbrains.annotations.NotNull p9: java.lang.String, p10: int, p11: int, p12: int, p13: int, p14: int, p15: int, @org.jetbrains.annotations.NotNull p16: java.lang.String, p17: int, p18: int, @org.jetbrains.annotations.NotNull p19: java.lang.String): java.lang.String
|
||||
public synthetic final method unbox-impl0(): int
|
||||
public synthetic final method unbox-impl1(): int
|
||||
public synthetic final method unbox-impl10(): int
|
||||
public synthetic final method unbox-impl11(): int
|
||||
public synthetic final method unbox-impl12(): int
|
||||
public synthetic final method unbox-impl13(): int
|
||||
public synthetic final method unbox-impl14(): int
|
||||
public synthetic final method unbox-impl15(): int
|
||||
public synthetic final method unbox-impl16(): java.lang.String
|
||||
public synthetic final method unbox-impl17(): int
|
||||
public synthetic final method unbox-impl18(): int
|
||||
public synthetic final method unbox-impl19(): java.lang.String
|
||||
public synthetic final method unbox-impl2(): int
|
||||
public synthetic final method unbox-impl3(): int
|
||||
public synthetic final method unbox-impl4(): int
|
||||
public synthetic final method unbox-impl5(): int
|
||||
public synthetic final method unbox-impl6(): java.lang.String
|
||||
public synthetic final method unbox-impl7(): int
|
||||
public synthetic final method unbox-impl8(): int
|
||||
public synthetic final method unbox-impl9(): java.lang.String
|
||||
public synthetic final method unbox-impl-0(): A
|
||||
public synthetic final method unbox-impl-0-0(): int
|
||||
public synthetic final method unbox-impl-0-1(): int
|
||||
public synthetic final method unbox-impl-0-2(): F3
|
||||
public synthetic final method unbox-impl-0-2-0(): int
|
||||
public synthetic final method unbox-impl-0-2-1(): int
|
||||
public synthetic final method unbox-impl-0-3(): int
|
||||
public synthetic final method unbox-impl-0-4(): int
|
||||
public synthetic final method unbox-impl-0-5(): java.lang.String
|
||||
public synthetic final method unbox-impl-0-6(): int
|
||||
public synthetic final method unbox-impl-0-7(): int
|
||||
public synthetic final method unbox-impl-0-8(): java.lang.String
|
||||
public synthetic final method unbox-impl-1(): A
|
||||
public synthetic final method unbox-impl-1-0(): int
|
||||
public synthetic final method unbox-impl-1-1(): int
|
||||
public synthetic final method unbox-impl-1-2(): F3
|
||||
public synthetic final method unbox-impl-1-2-0(): int
|
||||
public synthetic final method unbox-impl-1-2-1(): int
|
||||
public synthetic final method unbox-impl-1-3(): int
|
||||
public synthetic final method unbox-impl-1-4(): int
|
||||
public synthetic final method unbox-impl-1-5(): java.lang.String
|
||||
public synthetic final method unbox-impl-1-6(): int
|
||||
public synthetic final method unbox-impl-1-7(): int
|
||||
public synthetic final method unbox-impl-1-8(): java.lang.String
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
@@ -173,22 +154,22 @@ public final class F2 {
|
||||
@kotlin.Metadata
|
||||
public final class F3 {
|
||||
// source: 'equality.kt'
|
||||
private field x: int
|
||||
private field y: int
|
||||
private final field field-0: int
|
||||
private final field field-1: int
|
||||
private synthetic method <init>(p0: int, p1: int): void
|
||||
public synthetic final static method box-impl(p0: int, p1: int): F3
|
||||
public final static method constructor-impl(p0: int, p1: int): void
|
||||
public method equals(@org.jetbrains.annotations.Nullable p0: java.lang.Object): boolean
|
||||
public static method equals-impl(p0: int, p1: int, p2: java.lang.Object): boolean
|
||||
public final static method equals-impl0(p0: int, p1: int, p2: int, p3: int): boolean
|
||||
public final method getX-DbFnDB4(): int
|
||||
public final method getY-ejSTSP4(): int
|
||||
public final static method getX-impl(p0: int, p1: int): int
|
||||
public final static method getY-impl(p0: int, p1: int): int
|
||||
public method hashCode(): int
|
||||
public static method hashCode-impl(p0: int, p1: int): int
|
||||
public @org.jetbrains.annotations.NotNull method toString(): java.lang.String
|
||||
public static method toString-impl(p0: int, p1: int): java.lang.String
|
||||
public synthetic final method unbox-impl0(): int
|
||||
public synthetic final method unbox-impl1(): int
|
||||
public synthetic final method unbox-impl-0(): int
|
||||
public synthetic final method unbox-impl-1(): int
|
||||
}
|
||||
|
||||
@kotlin.jvm.JvmInline
|
||||
|
||||
+344
-304
File diff suppressed because it is too large
Load Diff
+344
-304
File diff suppressed because it is too large
Load Diff
+344
-304
File diff suppressed because it is too large
Load Diff
@@ -2,33 +2,33 @@
|
||||
@kotlin.Metadata
|
||||
public final class DPoint {
|
||||
// source: 'throwingMFVCReassignments.kt'
|
||||
private field x: double
|
||||
private field y: double
|
||||
private final field field-0: double
|
||||
private final field field-1: double
|
||||
private synthetic method <init>(p0: double, p1: double): void
|
||||
public synthetic final static method box-impl(p0: double, p1: double): DPoint
|
||||
public final static method constructor-impl(p0: double, p1: double): void
|
||||
public method equals(@org.jetbrains.annotations.Nullable p0: java.lang.Object): boolean
|
||||
public static method equals-impl(p0: double, p1: double, p2: java.lang.Object): boolean
|
||||
public final static method equals-impl0(p0: double, p1: double, p2: double, p3: double): boolean
|
||||
public final method getX(): double
|
||||
public final method getY(): double
|
||||
public final static method getX-impl(p0: double, p1: double): double
|
||||
public final static method getY-impl(p0: double, p1: double): double
|
||||
public method hashCode(): int
|
||||
public static method hashCode-impl(p0: double, p1: double): int
|
||||
public @org.jetbrains.annotations.NotNull method toString(): java.lang.String
|
||||
public static method toString-impl(p0: double, p1: double): java.lang.String
|
||||
public synthetic final method unbox-impl0(): double
|
||||
public synthetic final method unbox-impl1(): double
|
||||
public synthetic final method unbox-impl-0(): double
|
||||
public synthetic final method unbox-impl-1(): double
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class PointBox {
|
||||
// source: 'throwingMFVCReassignments.kt'
|
||||
private field value$x: double
|
||||
private field value$y: double
|
||||
private field value-0: double
|
||||
private field value-1: double
|
||||
public method <init>(p0: double, p1: double): void
|
||||
public final method getValue$x(): double
|
||||
public final method getValue$y(): double
|
||||
public final @org.jetbrains.annotations.NotNull method getValue(): DPoint
|
||||
public synthetic final method getValue-0(): double
|
||||
public synthetic final method getValue-1(): double
|
||||
public final method setValue-sUp7gFk(p0: double, p1: double): void
|
||||
}
|
||||
|
||||
|
||||
+171
-22
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// https://youtrack.jetbrains.com/issue/KT-52236/Different-modality-in-psi-and-fir
|
||||
// CHECK_BYTECODE_LISTING
|
||||
// WITH_STDLIB
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
@@ -9,15 +7,29 @@
|
||||
@JvmInline
|
||||
value class Public(val x: Int, val y: Int) {
|
||||
companion object {
|
||||
// TODO
|
||||
var x: Int = 0
|
||||
val y: Int
|
||||
get() = 1
|
||||
var z: Public = Public(0, 0)
|
||||
val t: Public
|
||||
get() = Public(0, 0)
|
||||
}
|
||||
}
|
||||
|
||||
@JvmInline
|
||||
value class Internal(internal val x: Int, internal val y: Int) {
|
||||
companion object {
|
||||
// @JvmStatic
|
||||
// TODO
|
||||
@JvmStatic
|
||||
var x: Int = 0
|
||||
|
||||
@JvmStatic
|
||||
val y: Int
|
||||
get() = 1
|
||||
var z: Internal = Internal(0, 0)
|
||||
|
||||
@JvmStatic
|
||||
val t: Internal
|
||||
get() = Internal(0, 0)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,11 +72,11 @@ class Regular {
|
||||
private set
|
||||
internal var x5: Public = Public(9, 10)
|
||||
private set
|
||||
|
||||
|
||||
var x6: Public = Public(11, 12)
|
||||
internal set
|
||||
|
||||
|
||||
|
||||
|
||||
var y1: Internal = Internal(13, 14)
|
||||
internal var y2: Internal = Internal(15, 16)
|
||||
private var y3: Internal = Internal(17, 18)
|
||||
@@ -73,11 +85,11 @@ class Regular {
|
||||
private set
|
||||
internal var y5: Internal = Internal(21, 22)
|
||||
private set
|
||||
|
||||
|
||||
var y6: Internal = Internal(23, 24)
|
||||
internal set
|
||||
|
||||
|
||||
|
||||
|
||||
var z1: Private = Private(25, 26)
|
||||
internal var z2: Private = Private(27, 28)
|
||||
private var z3: Private = Private(29, 30)
|
||||
@@ -86,12 +98,11 @@ class Regular {
|
||||
private set
|
||||
internal var z5: Private = Private(33, 34)
|
||||
private set
|
||||
|
||||
|
||||
var z6: Private = Private(35, 36)
|
||||
internal set
|
||||
|
||||
|
||||
companion object {
|
||||
// TODO @JvmStatic
|
||||
var staticX1: Public = Public(-1, -2)
|
||||
internal var staticX2: Public = Public(-3, -4)
|
||||
private var staticX3: Public = Public(-5, -6)
|
||||
@@ -129,19 +140,157 @@ class Regular {
|
||||
|
||||
var staticZ6: Private = Private(-35, -36)
|
||||
internal set
|
||||
|
||||
|
||||
@JvmStatic
|
||||
var jvmStaticX1: Public = Public(-1, -2)
|
||||
|
||||
@JvmStatic
|
||||
internal var jvmStaticX2: Public = Public(-3, -4)
|
||||
|
||||
@JvmStatic
|
||||
private var jvmStaticX3: Public = Public(-5, -6)
|
||||
|
||||
@JvmStatic
|
||||
var jvmStaticX4: Public = Public(-7, -8)
|
||||
private set
|
||||
|
||||
@JvmStatic
|
||||
internal var jvmStaticX5: Public = Public(-9, -10)
|
||||
private set
|
||||
|
||||
@JvmStatic
|
||||
var jvmStaticX6: Public = Public(-11, -12)
|
||||
internal set
|
||||
|
||||
|
||||
@JvmStatic
|
||||
var jvmStaticY1: Internal = Internal(-13, -14)
|
||||
|
||||
@JvmStatic
|
||||
internal var jvmStaticY2: Internal = Internal(-15, -16)
|
||||
|
||||
@JvmStatic
|
||||
private var jvmStaticY3: Internal = Internal(-17, -18)
|
||||
|
||||
@JvmStatic
|
||||
var jvmStaticY4: Internal = Internal(-19, -20)
|
||||
private set
|
||||
|
||||
@JvmStatic
|
||||
internal var jvmStaticY5: Internal = Internal(-21, -22)
|
||||
private set
|
||||
|
||||
@JvmStatic
|
||||
var jvmStaticY6: Internal = Internal(-23, -24)
|
||||
internal set
|
||||
|
||||
|
||||
@JvmStatic
|
||||
var jvmStaticZ1: Private = Private(-25, -26)
|
||||
|
||||
@JvmStatic
|
||||
internal var jvmStaticZ2: Private = Private(-27, -28)
|
||||
|
||||
@JvmStatic
|
||||
private var jvmStaticZ3: Private = Private(-29, -30)
|
||||
|
||||
@JvmStatic
|
||||
var jvmStaticZ4: Private = Private(-31, -32)
|
||||
private set
|
||||
|
||||
@JvmStatic
|
||||
internal var jvmStaticZ5: Private = Private(-33, -34)
|
||||
private set
|
||||
|
||||
@JvmStatic
|
||||
var jvmStaticZ6: Private = Private(-35, -36)
|
||||
internal set
|
||||
|
||||
}
|
||||
|
||||
// TODO statics
|
||||
|
||||
fun callAll() {
|
||||
z6
|
||||
x3
|
||||
x3.x
|
||||
x3.y
|
||||
x1; x2; x3; x4; x5; x6
|
||||
x1.x; x1.y; x2.x; x2.y; x3.x; x3.y; x4.x; x4.y; x5.x; x5.y; x6.x; x6.y
|
||||
x1 = x1; x2 = x2; x3 = x3; x4 = x4; x5 = x5; x6 = x6
|
||||
|
||||
y1; y2; y3; y4; y5; y6
|
||||
y1.x; y1.y; y2.x; y2.y; y3.x; y3.y; y4.x; y4.y; y5.x; y5.y; y6.x; y6.y
|
||||
y1 = y1; y2 = y2; y3 = y3; y4 = y4; y5 = y5; y6 = y6
|
||||
|
||||
z1; z2; z3; z4; z5; z6
|
||||
z1 = z1; z2 = z2; z3 = z3; z4 = z4; z5 = z5; z6 = z6
|
||||
|
||||
|
||||
staticX1; staticX2; staticX3; staticX4; staticX5; staticX6
|
||||
staticX1.x; staticX1.y; staticX2.x; staticX2.y; staticX3.x; staticX3.y; staticX4.x; staticX4.y; staticX5.x; staticX5.y; staticX6.x; staticX6.y
|
||||
staticX1 = staticX1; staticX2 = staticX2; staticX3 = staticX3; staticX4 = staticX4; staticX5 = staticX5; staticX6 = staticX6
|
||||
|
||||
staticY1; staticY2; staticY3; staticY4; staticY5; staticY6
|
||||
staticY1.x; staticY1.y; staticY2.x; staticY2.y; staticY3.x; staticY3.y; staticY4.x; staticY4.y; staticY5.x; staticY5.y; staticY6.x; staticY6.y
|
||||
staticY1 = staticY1; staticY2 = staticY2; staticY3 = staticY3; staticY4 = staticY4; staticY5 = staticY5; staticY6 = staticY6
|
||||
|
||||
staticZ1; staticZ2; staticZ3; staticZ4; staticZ5; staticZ6
|
||||
staticZ1 = staticZ1; staticZ2 = staticZ2; staticZ3 = staticZ3; staticZ4 = staticZ4; staticZ5 = staticZ5; staticZ6 = staticZ6
|
||||
|
||||
|
||||
jvmStaticX1; jvmStaticX2; jvmStaticX3; jvmStaticX4; jvmStaticX5; jvmStaticX6
|
||||
jvmStaticX1.x; jvmStaticX1.y; jvmStaticX2.x; jvmStaticX2.y; jvmStaticX3.x; jvmStaticX3.y; jvmStaticX4.x; jvmStaticX4.y; jvmStaticX5.x; jvmStaticX5.y; jvmStaticX6.x; jvmStaticX6.y
|
||||
jvmStaticX1 = jvmStaticX1; jvmStaticX2 = jvmStaticX2; jvmStaticX3 = jvmStaticX3; jvmStaticX4 = jvmStaticX4; jvmStaticX5 =
|
||||
jvmStaticX5; jvmStaticX6 = jvmStaticX6
|
||||
|
||||
jvmStaticY1; jvmStaticY2; jvmStaticY3; jvmStaticY4; jvmStaticY5; jvmStaticY6
|
||||
jvmStaticY1.x; jvmStaticY1.y; jvmStaticY2.x; jvmStaticY2.y; jvmStaticY3.x; jvmStaticY3.y; jvmStaticY4.x; jvmStaticY4.y; jvmStaticY5.x; jvmStaticY5.y; jvmStaticY6.x; jvmStaticY6.y
|
||||
jvmStaticY1 = jvmStaticY1; jvmStaticY2 = jvmStaticY2; jvmStaticY3 = jvmStaticY3; jvmStaticY4 = jvmStaticY4; jvmStaticY5 =
|
||||
jvmStaticY5; jvmStaticY6 = jvmStaticY6
|
||||
|
||||
jvmStaticZ1; jvmStaticZ2; jvmStaticZ3; jvmStaticZ4; jvmStaticZ5; jvmStaticZ6
|
||||
jvmStaticZ1 = jvmStaticZ1; jvmStaticZ2 = jvmStaticZ2; jvmStaticZ3 = jvmStaticZ3; jvmStaticZ4 = jvmStaticZ4; jvmStaticZ5 =
|
||||
jvmStaticZ5; jvmStaticZ6 = jvmStaticZ6
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
Regular().callAll()
|
||||
val r = Regular()
|
||||
r.apply {
|
||||
callAll()
|
||||
|
||||
|
||||
x1; x2; x4; x5; x6
|
||||
x1.x; x1.y; x2.x; x2.y; x4.x; x4.y; x5.x; x5.y; x6.x; x6.y
|
||||
x1 = x1; x2 = x2; x6 = x6
|
||||
|
||||
y1; y2; y4; y5; y6
|
||||
y1.x; y1.y; y2.x; y2.y; y4.x; y4.y; y5.x; y5.y; y6.x; y6.y
|
||||
y1 = y1; y2 = y2; y6 = y6
|
||||
|
||||
z1; z2; z4; z5; z6
|
||||
z1 = z1; z2 = z2; z6 = z6
|
||||
}
|
||||
|
||||
Regular.Companion.apply {
|
||||
staticX1; staticX2; staticX4; staticX5; staticX6
|
||||
staticX1.x; staticX1.y; staticX2.x; staticX2.y; staticX4.x; staticX4.y; staticX5.x; staticX5.y; staticX6.x; staticX6.y
|
||||
staticX1 = staticX1; staticX2 = staticX2; staticX6 = staticX6
|
||||
|
||||
staticY1; staticY2; staticY4; staticY5; staticY6
|
||||
staticY1.x; staticY1.y; staticY2.x; staticY2.y; staticY4.x; staticY4.y; staticY5.x; staticY5.y; staticY6.x; staticY6.y
|
||||
staticY1 = staticY1; staticY2 = staticY2; staticY6 = staticY6
|
||||
|
||||
staticZ1; staticZ2; staticZ4; staticZ5; staticZ6
|
||||
staticZ1 = staticZ1; staticZ2 = staticZ2; staticZ6 = staticZ6
|
||||
|
||||
|
||||
jvmStaticX1; jvmStaticX2; jvmStaticX4; jvmStaticX5; jvmStaticX6
|
||||
jvmStaticX1.x; jvmStaticX1.y; jvmStaticX2.x; jvmStaticX2.y; jvmStaticX4.x; jvmStaticX4.y; jvmStaticX5.x; jvmStaticX5.y; jvmStaticX6.x; jvmStaticX6.y
|
||||
jvmStaticX1 = jvmStaticX1; jvmStaticX2 = jvmStaticX2; jvmStaticX6 = jvmStaticX6
|
||||
|
||||
jvmStaticY1; jvmStaticY2; jvmStaticY4; jvmStaticY5; jvmStaticY6
|
||||
jvmStaticY1.x; jvmStaticY1.y; jvmStaticY2.x; jvmStaticY2.y; jvmStaticY4.x; jvmStaticY4.y; jvmStaticY5.x; jvmStaticY5.y; jvmStaticY6.x; jvmStaticY6.y
|
||||
jvmStaticY1 = jvmStaticY1; jvmStaticY2 = jvmStaticY2; jvmStaticY6 = jvmStaticY6
|
||||
|
||||
jvmStaticZ1; jvmStaticZ2; jvmStaticZ4; jvmStaticZ5; jvmStaticZ6
|
||||
jvmStaticZ1 = jvmStaticZ1; jvmStaticZ2 = jvmStaticZ2; jvmStaticZ6 = jvmStaticZ6
|
||||
}
|
||||
|
||||
return "OK"
|
||||
}
|
||||
+557
-146
@@ -1,377 +1,788 @@
|
||||
@kotlin.Metadata
|
||||
public final class Internal$Companion {
|
||||
// source: 'visibility.kt'
|
||||
private method <init>(): void
|
||||
public synthetic method <init>(p0: kotlin.jvm.internal.DefaultConstructorMarker): void
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method getT$annotations(): void
|
||||
public final @org.jetbrains.annotations.NotNull method getT(): Internal
|
||||
public synthetic final method getT-0(): int
|
||||
public synthetic final method getT-1(): int
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method getX$annotations(): void
|
||||
public final method getX(): int
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method getY$annotations(): void
|
||||
public final method getY(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getZ(): Internal
|
||||
public synthetic final method getZ-0(): int
|
||||
public synthetic final method getZ-1(): int
|
||||
public final method setX(p0: int): void
|
||||
public final method setZ-sUp7gFk(p0: int, p1: int): void
|
||||
public final inner class Internal$Companion
|
||||
}
|
||||
|
||||
@kotlin.jvm.JvmInline
|
||||
@kotlin.Metadata
|
||||
public final class Internal {
|
||||
// source: 'visibility.kt'
|
||||
private field x: int
|
||||
private field y: int
|
||||
public final static @org.jetbrains.annotations.NotNull field Companion: Internal$Companion
|
||||
private final field field-0: int
|
||||
private final field field-1: int
|
||||
static method <clinit>(): void
|
||||
private synthetic method <init>(p0: int, p1: int): void
|
||||
public synthetic final static method access$getX$cp(): int
|
||||
public synthetic final static method access$getZ-0$cp(): int
|
||||
public synthetic final static method access$getZ-1$cp(): int
|
||||
public synthetic final static method access$setX$cp(p0: int): void
|
||||
public synthetic final static method access$setZ-0$cp(p0: int): void
|
||||
public synthetic final static method access$setZ-1$cp(p0: int): void
|
||||
public synthetic final static method box-impl(p0: int, p1: int): Internal
|
||||
public final static method constructor-impl(p0: int, p1: int): void
|
||||
public method equals(@org.jetbrains.annotations.Nullable p0: java.lang.Object): boolean
|
||||
public static method equals-impl(p0: int, p1: int, p2: java.lang.Object): boolean
|
||||
public final static method equals-impl0(p0: int, p1: int, p2: int, p3: int): boolean
|
||||
public final method getX$main(): int
|
||||
public final method getY$main(): int
|
||||
public final static @org.jetbrains.annotations.NotNull method getT(): Internal
|
||||
public final static method getX(): int
|
||||
public final static method getX-impl$main(p0: int, p1: int): int
|
||||
public final static method getY(): int
|
||||
public final static method getY-impl$main(p0: int, p1: int): int
|
||||
public method hashCode(): int
|
||||
public static method hashCode-impl(p0: int, p1: int): int
|
||||
public final static method setX(p0: int): void
|
||||
public @org.jetbrains.annotations.NotNull method toString(): java.lang.String
|
||||
public static method toString-impl(p0: int, p1: int): java.lang.String
|
||||
public synthetic final method unbox-impl0(): int
|
||||
public synthetic final method unbox-impl1(): int
|
||||
public synthetic final method unbox-impl-0(): int
|
||||
public synthetic final method unbox-impl-1(): int
|
||||
public final inner class Internal$Companion
|
||||
}
|
||||
|
||||
@kotlin.jvm.JvmInline
|
||||
@kotlin.Metadata
|
||||
public final class InternalInternal {
|
||||
// source: 'visibility.kt'
|
||||
private field value$x: int
|
||||
private field value$y: int
|
||||
private final field field-0-0: int
|
||||
private final field field-0-1: int
|
||||
private synthetic method <init>(p0: int, p1: int): void
|
||||
public synthetic final static method box-impl(p0: int, p1: int): InternalInternal
|
||||
public final static method constructor-impl(p0: int, p1: int): void
|
||||
public method equals(@org.jetbrains.annotations.Nullable p0: java.lang.Object): boolean
|
||||
public static method equals-impl(p0: int, p1: int, p2: java.lang.Object): boolean
|
||||
public final static method equals-impl0(p0: int, p1: int, p2: int, p3: int): boolean
|
||||
public final @org.jetbrains.annotations.NotNull method getValue$main(): Internal
|
||||
public final method getValue$x$main(): int
|
||||
public final method getValue$y$main(): int
|
||||
public final static @org.jetbrains.annotations.NotNull method getValue-impl$main(p0: int, p1: int): Internal
|
||||
public method hashCode(): int
|
||||
public static method hashCode-impl(p0: int, p1: int): int
|
||||
public @org.jetbrains.annotations.NotNull method toString(): java.lang.String
|
||||
public static method toString-impl(p0: int, p1: int): java.lang.String
|
||||
public synthetic final method unbox-impl0(): int
|
||||
public synthetic final method unbox-impl1(): int
|
||||
public synthetic final method unbox-impl-0(): Internal
|
||||
public synthetic final method unbox-impl-0-0(): int
|
||||
public synthetic final method unbox-impl-0-1(): int
|
||||
}
|
||||
|
||||
@kotlin.jvm.JvmInline
|
||||
@kotlin.Metadata
|
||||
public final class InternalPrivate {
|
||||
// source: 'visibility.kt'
|
||||
private field value$x: int
|
||||
private field value$y: int
|
||||
private final field field-0-0: int
|
||||
private final field field-0-1: int
|
||||
private synthetic method <init>(p0: int, p1: int): void
|
||||
public synthetic final static method box-impl(p0: int, p1: int): InternalPrivate
|
||||
public final static method constructor-impl(p0: int, p1: int): void
|
||||
public method equals(@org.jetbrains.annotations.Nullable p0: java.lang.Object): boolean
|
||||
public static method equals-impl(p0: int, p1: int, p2: java.lang.Object): boolean
|
||||
public final static method equals-impl0(p0: int, p1: int, p2: int, p3: int): boolean
|
||||
public final @org.jetbrains.annotations.NotNull method getValue$main(): Private
|
||||
private final method getValue$x(): int
|
||||
private final method getValue$y(): int
|
||||
public final static @org.jetbrains.annotations.NotNull method getValue-impl$main(p0: int, p1: int): Private
|
||||
public method hashCode(): int
|
||||
public static method hashCode-impl(p0: int, p1: int): int
|
||||
public @org.jetbrains.annotations.NotNull method toString(): java.lang.String
|
||||
public static method toString-impl(p0: int, p1: int): java.lang.String
|
||||
public synthetic final method unbox-impl0(): int
|
||||
public synthetic final method unbox-impl1(): int
|
||||
public synthetic final method unbox-impl-0(): Private
|
||||
public synthetic final method unbox-impl-0-0(): int
|
||||
public synthetic final method unbox-impl-0-1(): int
|
||||
}
|
||||
|
||||
@kotlin.jvm.JvmInline
|
||||
@kotlin.Metadata
|
||||
public final class InternalPublic {
|
||||
// source: 'visibility.kt'
|
||||
private field value$x: int
|
||||
private field value$y: int
|
||||
private final field field-0-0: int
|
||||
private final field field-0-1: int
|
||||
private synthetic method <init>(p0: int, p1: int): void
|
||||
public synthetic final static method box-impl(p0: int, p1: int): InternalPublic
|
||||
public final static method constructor-impl(p0: int, p1: int): void
|
||||
public method equals(@org.jetbrains.annotations.Nullable p0: java.lang.Object): boolean
|
||||
public static method equals-impl(p0: int, p1: int, p2: java.lang.Object): boolean
|
||||
public final static method equals-impl0(p0: int, p1: int, p2: int, p3: int): boolean
|
||||
public final @org.jetbrains.annotations.NotNull method getValue$main(): Public
|
||||
public final method getValue$x$main(): int
|
||||
public final method getValue$y$main(): int
|
||||
public final static @org.jetbrains.annotations.NotNull method getValue-impl$main(p0: int, p1: int): Public
|
||||
public method hashCode(): int
|
||||
public static method hashCode-impl(p0: int, p1: int): int
|
||||
public @org.jetbrains.annotations.NotNull method toString(): java.lang.String
|
||||
public static method toString-impl(p0: int, p1: int): java.lang.String
|
||||
public synthetic final method unbox-impl0(): int
|
||||
public synthetic final method unbox-impl1(): int
|
||||
public synthetic final method unbox-impl-0(): Public
|
||||
public synthetic final method unbox-impl-0-0(): int
|
||||
public synthetic final method unbox-impl-0-1(): int
|
||||
}
|
||||
|
||||
@kotlin.jvm.JvmInline
|
||||
@kotlin.Metadata
|
||||
public final class Private {
|
||||
// source: 'visibility.kt'
|
||||
private field x: int
|
||||
private field y: int
|
||||
private final field field-0: int
|
||||
private final field field-1: int
|
||||
private synthetic method <init>(p0: int, p1: int): void
|
||||
public synthetic final static method box-impl(p0: int, p1: int): Private
|
||||
public final static method constructor-impl(p0: int, p1: int): void
|
||||
public method equals(@org.jetbrains.annotations.Nullable p0: java.lang.Object): boolean
|
||||
public static method equals-impl(p0: int, p1: int, p2: java.lang.Object): boolean
|
||||
public final static method equals-impl0(p0: int, p1: int, p2: int, p3: int): boolean
|
||||
private final method getX(): int
|
||||
private final method getY(): int
|
||||
public method hashCode(): int
|
||||
public static method hashCode-impl(p0: int, p1: int): int
|
||||
public @org.jetbrains.annotations.NotNull method toString(): java.lang.String
|
||||
public static method toString-impl(p0: int, p1: int): java.lang.String
|
||||
public synthetic final method unbox-impl0(): int
|
||||
public synthetic final method unbox-impl1(): int
|
||||
public synthetic final method unbox-impl-0(): int
|
||||
public synthetic final method unbox-impl-1(): int
|
||||
}
|
||||
|
||||
@kotlin.jvm.JvmInline
|
||||
@kotlin.Metadata
|
||||
public final class PrivateInternal {
|
||||
// source: 'visibility.kt'
|
||||
private field value$x: int
|
||||
private field value$y: int
|
||||
private final field field-0-0: int
|
||||
private final field field-0-1: int
|
||||
private synthetic method <init>(p0: int, p1: int): void
|
||||
public synthetic final static method box-impl(p0: int, p1: int): PrivateInternal
|
||||
public final static method constructor-impl(p0: int, p1: int): void
|
||||
public method equals(@org.jetbrains.annotations.Nullable p0: java.lang.Object): boolean
|
||||
public static method equals-impl(p0: int, p1: int, p2: java.lang.Object): boolean
|
||||
public final static method equals-impl0(p0: int, p1: int, p2: int, p3: int): boolean
|
||||
private final method getValue$x(): int
|
||||
private final method getValue$y(): int
|
||||
private final method getValue(): Internal
|
||||
public method hashCode(): int
|
||||
public static method hashCode-impl(p0: int, p1: int): int
|
||||
public @org.jetbrains.annotations.NotNull method toString(): java.lang.String
|
||||
public static method toString-impl(p0: int, p1: int): java.lang.String
|
||||
public synthetic final method unbox-impl0(): int
|
||||
public synthetic final method unbox-impl1(): int
|
||||
public synthetic final method unbox-impl-0(): Internal
|
||||
public synthetic final method unbox-impl-0-0(): int
|
||||
public synthetic final method unbox-impl-0-1(): int
|
||||
}
|
||||
|
||||
@kotlin.jvm.JvmInline
|
||||
@kotlin.Metadata
|
||||
public final class PrivatePrivate {
|
||||
// source: 'visibility.kt'
|
||||
private field value$x: int
|
||||
private field value$y: int
|
||||
private final field field-0-0: int
|
||||
private final field field-0-1: int
|
||||
private synthetic method <init>(p0: int, p1: int): void
|
||||
public synthetic final static method box-impl(p0: int, p1: int): PrivatePrivate
|
||||
public final static method constructor-impl(p0: int, p1: int): void
|
||||
public method equals(@org.jetbrains.annotations.Nullable p0: java.lang.Object): boolean
|
||||
public static method equals-impl(p0: int, p1: int, p2: java.lang.Object): boolean
|
||||
public final static method equals-impl0(p0: int, p1: int, p2: int, p3: int): boolean
|
||||
private final method getValue$x(): int
|
||||
private final method getValue$y(): int
|
||||
private final method getValue(): Private
|
||||
public method hashCode(): int
|
||||
public static method hashCode-impl(p0: int, p1: int): int
|
||||
public @org.jetbrains.annotations.NotNull method toString(): java.lang.String
|
||||
public static method toString-impl(p0: int, p1: int): java.lang.String
|
||||
public synthetic final method unbox-impl0(): int
|
||||
public synthetic final method unbox-impl1(): int
|
||||
public synthetic final method unbox-impl-0(): Private
|
||||
public synthetic final method unbox-impl-0-0(): int
|
||||
public synthetic final method unbox-impl-0-1(): int
|
||||
}
|
||||
|
||||
@kotlin.jvm.JvmInline
|
||||
@kotlin.Metadata
|
||||
public final class PrivatePublic {
|
||||
// source: 'visibility.kt'
|
||||
private field value$x: int
|
||||
private field value$y: int
|
||||
private final field field-0-0: int
|
||||
private final field field-0-1: int
|
||||
private synthetic method <init>(p0: int, p1: int): void
|
||||
public synthetic final static method box-impl(p0: int, p1: int): PrivatePublic
|
||||
public final static method constructor-impl(p0: int, p1: int): void
|
||||
public method equals(@org.jetbrains.annotations.Nullable p0: java.lang.Object): boolean
|
||||
public static method equals-impl(p0: int, p1: int, p2: java.lang.Object): boolean
|
||||
public final static method equals-impl0(p0: int, p1: int, p2: int, p3: int): boolean
|
||||
private final method getValue$x(): int
|
||||
private final method getValue$y(): int
|
||||
private final method getValue(): Public
|
||||
public method hashCode(): int
|
||||
public static method hashCode-impl(p0: int, p1: int): int
|
||||
public @org.jetbrains.annotations.NotNull method toString(): java.lang.String
|
||||
public static method toString-impl(p0: int, p1: int): java.lang.String
|
||||
public synthetic final method unbox-impl0(): int
|
||||
public synthetic final method unbox-impl1(): int
|
||||
public synthetic final method unbox-impl-0(): Public
|
||||
public synthetic final method unbox-impl-0-0(): int
|
||||
public synthetic final method unbox-impl-0-1(): int
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class Public$Companion {
|
||||
// source: 'visibility.kt'
|
||||
private method <init>(): void
|
||||
public synthetic method <init>(p0: kotlin.jvm.internal.DefaultConstructorMarker): void
|
||||
public final @org.jetbrains.annotations.NotNull method getT(): Public
|
||||
public synthetic final method getT-0(): int
|
||||
public synthetic final method getT-1(): int
|
||||
public final method getX(): int
|
||||
public final method getY(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getZ(): Public
|
||||
public synthetic final method getZ-0(): int
|
||||
public synthetic final method getZ-1(): int
|
||||
public final method setX(p0: int): void
|
||||
public final method setZ-sUp7gFk(p0: int, p1: int): void
|
||||
public final inner class Public$Companion
|
||||
}
|
||||
|
||||
@kotlin.jvm.JvmInline
|
||||
@kotlin.Metadata
|
||||
public final class Public {
|
||||
// source: 'visibility.kt'
|
||||
private field x: int
|
||||
private field y: int
|
||||
public final static @org.jetbrains.annotations.NotNull field Companion: Public$Companion
|
||||
private final field field-0: int
|
||||
private final field field-1: int
|
||||
static method <clinit>(): void
|
||||
private synthetic method <init>(p0: int, p1: int): void
|
||||
public synthetic final static method access$getX$cp(): int
|
||||
public synthetic final static method access$getZ-0$cp(): int
|
||||
public synthetic final static method access$getZ-1$cp(): int
|
||||
public synthetic final static method access$setX$cp(p0: int): void
|
||||
public synthetic final static method access$setZ-0$cp(p0: int): void
|
||||
public synthetic final static method access$setZ-1$cp(p0: int): void
|
||||
public synthetic final static method box-impl(p0: int, p1: int): Public
|
||||
public final static method constructor-impl(p0: int, p1: int): void
|
||||
public method equals(@org.jetbrains.annotations.Nullable p0: java.lang.Object): boolean
|
||||
public static method equals-impl(p0: int, p1: int, p2: java.lang.Object): boolean
|
||||
public final static method equals-impl0(p0: int, p1: int, p2: int, p3: int): boolean
|
||||
public final method getX(): int
|
||||
public final method getY(): int
|
||||
public final static method getX-impl(p0: int, p1: int): int
|
||||
public final static method getY-impl(p0: int, p1: int): int
|
||||
public method hashCode(): int
|
||||
public static method hashCode-impl(p0: int, p1: int): int
|
||||
public @org.jetbrains.annotations.NotNull method toString(): java.lang.String
|
||||
public static method toString-impl(p0: int, p1: int): java.lang.String
|
||||
public synthetic final method unbox-impl0(): int
|
||||
public synthetic final method unbox-impl1(): int
|
||||
public synthetic final method unbox-impl-0(): int
|
||||
public synthetic final method unbox-impl-1(): int
|
||||
public final inner class Public$Companion
|
||||
}
|
||||
|
||||
@kotlin.jvm.JvmInline
|
||||
@kotlin.Metadata
|
||||
public final class PublicInternal {
|
||||
// source: 'visibility.kt'
|
||||
private field value$x: int
|
||||
private field value$y: int
|
||||
private final field field-0-0: int
|
||||
private final field field-0-1: int
|
||||
private synthetic method <init>(p0: int, p1: int): void
|
||||
public synthetic final static method box-impl(p0: int, p1: int): PublicInternal
|
||||
public final static method constructor-impl(p0: int, p1: int): void
|
||||
public method equals(@org.jetbrains.annotations.Nullable p0: java.lang.Object): boolean
|
||||
public static method equals-impl(p0: int, p1: int, p2: java.lang.Object): boolean
|
||||
public final static method equals-impl0(p0: int, p1: int, p2: int, p3: int): boolean
|
||||
public final method getValue$x$main(): int
|
||||
public final method getValue$y$main(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getValue(): Internal
|
||||
public final static @org.jetbrains.annotations.NotNull method getValue-impl(p0: int, p1: int): Internal
|
||||
public method hashCode(): int
|
||||
public static method hashCode-impl(p0: int, p1: int): int
|
||||
public @org.jetbrains.annotations.NotNull method toString(): java.lang.String
|
||||
public static method toString-impl(p0: int, p1: int): java.lang.String
|
||||
public synthetic final method unbox-impl0(): int
|
||||
public synthetic final method unbox-impl1(): int
|
||||
public synthetic final method unbox-impl-0(): Internal
|
||||
public synthetic final method unbox-impl-0-0(): int
|
||||
public synthetic final method unbox-impl-0-1(): int
|
||||
}
|
||||
|
||||
@kotlin.jvm.JvmInline
|
||||
@kotlin.Metadata
|
||||
public final class PublicPrivate {
|
||||
// source: 'visibility.kt'
|
||||
private field value$x: int
|
||||
private field value$y: int
|
||||
private final field field-0-0: int
|
||||
private final field field-0-1: int
|
||||
private synthetic method <init>(p0: int, p1: int): void
|
||||
public synthetic final static method box-impl(p0: int, p1: int): PublicPrivate
|
||||
public final static method constructor-impl(p0: int, p1: int): void
|
||||
public method equals(@org.jetbrains.annotations.Nullable p0: java.lang.Object): boolean
|
||||
public static method equals-impl(p0: int, p1: int, p2: java.lang.Object): boolean
|
||||
public final static method equals-impl0(p0: int, p1: int, p2: int, p3: int): boolean
|
||||
private final method getValue$x(): int
|
||||
private final method getValue$y(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getValue(): Private
|
||||
public final static @org.jetbrains.annotations.NotNull method getValue-impl(p0: int, p1: int): Private
|
||||
public method hashCode(): int
|
||||
public static method hashCode-impl(p0: int, p1: int): int
|
||||
public @org.jetbrains.annotations.NotNull method toString(): java.lang.String
|
||||
public static method toString-impl(p0: int, p1: int): java.lang.String
|
||||
public synthetic final method unbox-impl0(): int
|
||||
public synthetic final method unbox-impl1(): int
|
||||
public synthetic final method unbox-impl-0(): Private
|
||||
public synthetic final method unbox-impl-0-0(): int
|
||||
public synthetic final method unbox-impl-0-1(): int
|
||||
}
|
||||
|
||||
@kotlin.jvm.JvmInline
|
||||
@kotlin.Metadata
|
||||
public final class PublicPublic {
|
||||
// source: 'visibility.kt'
|
||||
private field value$x: int
|
||||
private field value$y: int
|
||||
private final field field-0-0: int
|
||||
private final field field-0-1: int
|
||||
private synthetic method <init>(p0: int, p1: int): void
|
||||
public synthetic final static method box-impl(p0: int, p1: int): PublicPublic
|
||||
public final static method constructor-impl(p0: int, p1: int): void
|
||||
public method equals(@org.jetbrains.annotations.Nullable p0: java.lang.Object): boolean
|
||||
public static method equals-impl(p0: int, p1: int, p2: java.lang.Object): boolean
|
||||
public final static method equals-impl0(p0: int, p1: int, p2: int, p3: int): boolean
|
||||
public final method getValue$x(): int
|
||||
public final method getValue$y(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getValue(): Public
|
||||
public final static @org.jetbrains.annotations.NotNull method getValue-impl(p0: int, p1: int): Public
|
||||
public method hashCode(): int
|
||||
public static method hashCode-impl(p0: int, p1: int): int
|
||||
public @org.jetbrains.annotations.NotNull method toString(): java.lang.String
|
||||
public static method toString-impl(p0: int, p1: int): java.lang.String
|
||||
public synthetic final method unbox-impl0(): int
|
||||
public synthetic final method unbox-impl1(): int
|
||||
public synthetic final method unbox-impl-0(): Public
|
||||
public synthetic final method unbox-impl-0-0(): int
|
||||
public synthetic final method unbox-impl-0-1(): int
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class Regular$Companion {
|
||||
// source: 'visibility.kt'
|
||||
private method <init>(): void
|
||||
public synthetic method <init>(p0: kotlin.jvm.internal.DefaultConstructorMarker): void
|
||||
public synthetic final static method access$getJvmStaticX3(p0: Regular$Companion): Public
|
||||
public synthetic final static method access$getJvmStaticY3(p0: Regular$Companion): Internal
|
||||
public synthetic final static method access$getJvmStaticZ3(p0: Regular$Companion): Private
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method getJvmStaticX1$annotations(): void
|
||||
public final @org.jetbrains.annotations.NotNull method getJvmStaticX1(): Public
|
||||
public synthetic final method getJvmStaticX1-0(): int
|
||||
public synthetic final method getJvmStaticX1-1(): int
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method getJvmStaticX2$main$annotations(): void
|
||||
public final @org.jetbrains.annotations.NotNull method getJvmStaticX2$main(): Public
|
||||
public synthetic final method getJvmStaticX2-0(): int
|
||||
public synthetic final method getJvmStaticX2-1(): int
|
||||
private synthetic deprecated static @kotlin.jvm.JvmStatic method getJvmStaticX3$annotations(): void
|
||||
private final method getJvmStaticX3(): Public
|
||||
public synthetic final method getJvmStaticX3-0(): int
|
||||
public synthetic final method getJvmStaticX3-1(): int
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method getJvmStaticX4$annotations(): void
|
||||
public final @org.jetbrains.annotations.NotNull method getJvmStaticX4(): Public
|
||||
public synthetic final method getJvmStaticX4-0(): int
|
||||
public synthetic final method getJvmStaticX4-1(): int
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method getJvmStaticX5$main$annotations(): void
|
||||
public final @org.jetbrains.annotations.NotNull method getJvmStaticX5$main(): Public
|
||||
public synthetic final method getJvmStaticX5-0(): int
|
||||
public synthetic final method getJvmStaticX5-1(): int
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method getJvmStaticX6$annotations(): void
|
||||
public final @org.jetbrains.annotations.NotNull method getJvmStaticX6(): Public
|
||||
public synthetic final method getJvmStaticX6-0(): int
|
||||
public synthetic final method getJvmStaticX6-1(): int
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method getJvmStaticY1$annotations(): void
|
||||
public final @org.jetbrains.annotations.NotNull method getJvmStaticY1(): Internal
|
||||
public synthetic final method getJvmStaticY1-0(): int
|
||||
public synthetic final method getJvmStaticY1-1(): int
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method getJvmStaticY2$main$annotations(): void
|
||||
public final @org.jetbrains.annotations.NotNull method getJvmStaticY2$main(): Internal
|
||||
public synthetic final method getJvmStaticY2-0(): int
|
||||
public synthetic final method getJvmStaticY2-1(): int
|
||||
private synthetic deprecated static @kotlin.jvm.JvmStatic method getJvmStaticY3$annotations(): void
|
||||
private final method getJvmStaticY3(): Internal
|
||||
public synthetic final method getJvmStaticY3-0(): int
|
||||
public synthetic final method getJvmStaticY3-1(): int
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method getJvmStaticY4$annotations(): void
|
||||
public final @org.jetbrains.annotations.NotNull method getJvmStaticY4(): Internal
|
||||
public synthetic final method getJvmStaticY4-0(): int
|
||||
public synthetic final method getJvmStaticY4-1(): int
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method getJvmStaticY5$main$annotations(): void
|
||||
public final @org.jetbrains.annotations.NotNull method getJvmStaticY5$main(): Internal
|
||||
public synthetic final method getJvmStaticY5-0(): int
|
||||
public synthetic final method getJvmStaticY5-1(): int
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method getJvmStaticY6$annotations(): void
|
||||
public final @org.jetbrains.annotations.NotNull method getJvmStaticY6(): Internal
|
||||
public synthetic final method getJvmStaticY6-0(): int
|
||||
public synthetic final method getJvmStaticY6-1(): int
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method getJvmStaticZ1$annotations(): void
|
||||
public final @org.jetbrains.annotations.NotNull method getJvmStaticZ1(): Private
|
||||
public synthetic final method getJvmStaticZ1-0(): int
|
||||
public synthetic final method getJvmStaticZ1-1(): int
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method getJvmStaticZ2$main$annotations(): void
|
||||
public final @org.jetbrains.annotations.NotNull method getJvmStaticZ2$main(): Private
|
||||
public synthetic final method getJvmStaticZ2-0(): int
|
||||
public synthetic final method getJvmStaticZ2-1(): int
|
||||
private synthetic deprecated static @kotlin.jvm.JvmStatic method getJvmStaticZ3$annotations(): void
|
||||
private final method getJvmStaticZ3(): Private
|
||||
public synthetic final method getJvmStaticZ3-0(): int
|
||||
public synthetic final method getJvmStaticZ3-1(): int
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method getJvmStaticZ4$annotations(): void
|
||||
public final @org.jetbrains.annotations.NotNull method getJvmStaticZ4(): Private
|
||||
public synthetic final method getJvmStaticZ4-0(): int
|
||||
public synthetic final method getJvmStaticZ4-1(): int
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method getJvmStaticZ5$main$annotations(): void
|
||||
public final @org.jetbrains.annotations.NotNull method getJvmStaticZ5$main(): Private
|
||||
public synthetic final method getJvmStaticZ5-0(): int
|
||||
public synthetic final method getJvmStaticZ5-1(): int
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method getJvmStaticZ6$annotations(): void
|
||||
public final @org.jetbrains.annotations.NotNull method getJvmStaticZ6(): Private
|
||||
public synthetic final method getJvmStaticZ6-0(): int
|
||||
public synthetic final method getJvmStaticZ6-1(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getStaticX1(): Public
|
||||
public synthetic final method getStaticX1-0(): int
|
||||
public synthetic final method getStaticX1-1(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getStaticX2$main(): Public
|
||||
public synthetic final method getStaticX2-0(): int
|
||||
public synthetic final method getStaticX2-1(): int
|
||||
private final method getStaticX3(): Public
|
||||
public synthetic final method getStaticX3-0(): int
|
||||
public synthetic final method getStaticX3-1(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getStaticX4(): Public
|
||||
public synthetic final method getStaticX4-0(): int
|
||||
public synthetic final method getStaticX4-1(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getStaticX5$main(): Public
|
||||
public synthetic final method getStaticX5-0(): int
|
||||
public synthetic final method getStaticX5-1(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getStaticX6(): Public
|
||||
public synthetic final method getStaticX6-0(): int
|
||||
public synthetic final method getStaticX6-1(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getStaticY1(): Internal
|
||||
public synthetic final method getStaticY1-0(): int
|
||||
public synthetic final method getStaticY1-1(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getStaticY2$main(): Internal
|
||||
public synthetic final method getStaticY2-0(): int
|
||||
public synthetic final method getStaticY2-1(): int
|
||||
private final method getStaticY3(): Internal
|
||||
public synthetic final method getStaticY3-0(): int
|
||||
public synthetic final method getStaticY3-1(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getStaticY4(): Internal
|
||||
public synthetic final method getStaticY4-0(): int
|
||||
public synthetic final method getStaticY4-1(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getStaticY5$main(): Internal
|
||||
public synthetic final method getStaticY5-0(): int
|
||||
public synthetic final method getStaticY5-1(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getStaticY6(): Internal
|
||||
public synthetic final method getStaticY6-0(): int
|
||||
public synthetic final method getStaticY6-1(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getStaticZ1(): Private
|
||||
public synthetic final method getStaticZ1-0(): int
|
||||
public synthetic final method getStaticZ1-1(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getStaticZ2$main(): Private
|
||||
public synthetic final method getStaticZ2-0(): int
|
||||
public synthetic final method getStaticZ2-1(): int
|
||||
private final method getStaticZ3(): Private
|
||||
public synthetic final method getStaticZ3-0(): int
|
||||
public synthetic final method getStaticZ3-1(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getStaticZ4(): Private
|
||||
public synthetic final method getStaticZ4-0(): int
|
||||
public synthetic final method getStaticZ4-1(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getStaticZ5$main(): Private
|
||||
public synthetic final method getStaticZ5-0(): int
|
||||
public synthetic final method getStaticZ5-1(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getStaticZ6(): Private
|
||||
public synthetic final method getStaticZ6-0(): int
|
||||
public synthetic final method getStaticZ6-1(): int
|
||||
public final method setJvmStaticX1-sUp7gFk(p0: int, p1: int): void
|
||||
public final method setJvmStaticX2-sUp7gFk$main(p0: int, p1: int): void
|
||||
public final method setJvmStaticX6-sUp7gFk$main(p0: int, p1: int): void
|
||||
public final method setJvmStaticY1-sUp7gFk(p0: int, p1: int): void
|
||||
public final method setJvmStaticY2-sUp7gFk$main(p0: int, p1: int): void
|
||||
public final method setJvmStaticY6-sUp7gFk$main(p0: int, p1: int): void
|
||||
public final method setJvmStaticZ1-sUp7gFk(p0: int, p1: int): void
|
||||
public final method setJvmStaticZ2-sUp7gFk$main(p0: int, p1: int): void
|
||||
public final method setJvmStaticZ6-sUp7gFk$main(p0: int, p1: int): void
|
||||
public final method setStaticX1-sUp7gFk(p0: int, p1: int): void
|
||||
public final method setStaticX2-sUp7gFk$main(p0: int, p1: int): void
|
||||
public final method setStaticX6-sUp7gFk$main(p0: int, p1: int): void
|
||||
public final method setStaticY1-sUp7gFk(p0: int, p1: int): void
|
||||
public final method setStaticY2-sUp7gFk$main(p0: int, p1: int): void
|
||||
public final method setStaticY6-sUp7gFk$main(p0: int, p1: int): void
|
||||
public final method setStaticZ1-sUp7gFk(p0: int, p1: int): void
|
||||
public final method setStaticZ2-sUp7gFk$main(p0: int, p1: int): void
|
||||
public final method setStaticZ6-sUp7gFk$main(p0: int, p1: int): void
|
||||
public final inner class Regular$Companion
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class Regular {
|
||||
// source: 'visibility.kt'
|
||||
private field x1$x: int
|
||||
private field x1$y: int
|
||||
private field x2$x: int
|
||||
private field x2$y: int
|
||||
private field x3$x: int
|
||||
private field x3$y: int
|
||||
private field x4$x: int
|
||||
private field x4$y: int
|
||||
private field x5$x: int
|
||||
private field x5$y: int
|
||||
private field x6$x: int
|
||||
private field x6$y: int
|
||||
private field y1$x: int
|
||||
private field y1$y: int
|
||||
private field y2$x: int
|
||||
private field y2$y: int
|
||||
private field y3$x: int
|
||||
private field y3$y: int
|
||||
private field y4$x: int
|
||||
private field y4$y: int
|
||||
private field y5$x: int
|
||||
private field y5$y: int
|
||||
private field y6$x: int
|
||||
private field y6$y: int
|
||||
private field z1$x: int
|
||||
private field z1$y: int
|
||||
private field z2$x: int
|
||||
private field z2$y: int
|
||||
private field z3$x: int
|
||||
private field z3$y: int
|
||||
private field z4$x: int
|
||||
private field z4$y: int
|
||||
private field z5$x: int
|
||||
private field z5$y: int
|
||||
private field z6$x: int
|
||||
private field z6$y: int
|
||||
public final static @org.jetbrains.annotations.NotNull field Companion: Regular$Companion
|
||||
private static field jvmStaticX1-0: int
|
||||
private static field jvmStaticX1-1: int
|
||||
private static field jvmStaticX2-0: int
|
||||
private static field jvmStaticX2-1: int
|
||||
private static field jvmStaticX3-0: int
|
||||
private static field jvmStaticX3-1: int
|
||||
private static field jvmStaticX4-0: int
|
||||
private static field jvmStaticX4-1: int
|
||||
private static field jvmStaticX5-0: int
|
||||
private static field jvmStaticX5-1: int
|
||||
private static field jvmStaticX6-0: int
|
||||
private static field jvmStaticX6-1: int
|
||||
private static field jvmStaticY1-0: int
|
||||
private static field jvmStaticY1-1: int
|
||||
private static field jvmStaticY2-0: int
|
||||
private static field jvmStaticY2-1: int
|
||||
private static field jvmStaticY3-0: int
|
||||
private static field jvmStaticY3-1: int
|
||||
private static field jvmStaticY4-0: int
|
||||
private static field jvmStaticY4-1: int
|
||||
private static field jvmStaticY5-0: int
|
||||
private static field jvmStaticY5-1: int
|
||||
private static field jvmStaticY6-0: int
|
||||
private static field jvmStaticY6-1: int
|
||||
private static field jvmStaticZ1-0: int
|
||||
private static field jvmStaticZ1-1: int
|
||||
private static field jvmStaticZ2-0: int
|
||||
private static field jvmStaticZ2-1: int
|
||||
private static field jvmStaticZ3-0: int
|
||||
private static field jvmStaticZ3-1: int
|
||||
private static field jvmStaticZ4-0: int
|
||||
private static field jvmStaticZ4-1: int
|
||||
private static field jvmStaticZ5-0: int
|
||||
private static field jvmStaticZ5-1: int
|
||||
private static field jvmStaticZ6-0: int
|
||||
private static field jvmStaticZ6-1: int
|
||||
private static field staticX1-0: int
|
||||
private static field staticX1-1: int
|
||||
private static field staticX2-0: int
|
||||
private static field staticX2-1: int
|
||||
private static field staticX3-0: int
|
||||
private static field staticX3-1: int
|
||||
private static field staticX4-0: int
|
||||
private static field staticX4-1: int
|
||||
private static field staticX5-0: int
|
||||
private static field staticX5-1: int
|
||||
private static field staticX6-0: int
|
||||
private static field staticX6-1: int
|
||||
private static field staticY1-0: int
|
||||
private static field staticY1-1: int
|
||||
private static field staticY2-0: int
|
||||
private static field staticY2-1: int
|
||||
private static field staticY3-0: int
|
||||
private static field staticY3-1: int
|
||||
private static field staticY4-0: int
|
||||
private static field staticY4-1: int
|
||||
private static field staticY5-0: int
|
||||
private static field staticY5-1: int
|
||||
private static field staticY6-0: int
|
||||
private static field staticY6-1: int
|
||||
private static field staticZ1-0: int
|
||||
private static field staticZ1-1: int
|
||||
private static field staticZ2-0: int
|
||||
private static field staticZ2-1: int
|
||||
private static field staticZ3-0: int
|
||||
private static field staticZ3-1: int
|
||||
private static field staticZ4-0: int
|
||||
private static field staticZ4-1: int
|
||||
private static field staticZ5-0: int
|
||||
private static field staticZ5-1: int
|
||||
private static field staticZ6-0: int
|
||||
private static field staticZ6-1: int
|
||||
private field x1-0: int
|
||||
private field x1-1: int
|
||||
private field x2-0: int
|
||||
private field x2-1: int
|
||||
private field x3-0: int
|
||||
private field x3-1: int
|
||||
private field x4-0: int
|
||||
private field x4-1: int
|
||||
private field x5-0: int
|
||||
private field x5-1: int
|
||||
private field x6-0: int
|
||||
private field x6-1: int
|
||||
private field y1-0: int
|
||||
private field y1-1: int
|
||||
private field y2-0: int
|
||||
private field y2-1: int
|
||||
private field y3-0: int
|
||||
private field y3-1: int
|
||||
private field y4-0: int
|
||||
private field y4-1: int
|
||||
private field y5-0: int
|
||||
private field y5-1: int
|
||||
private field y6-0: int
|
||||
private field y6-1: int
|
||||
private field z1-0: int
|
||||
private field z1-1: int
|
||||
private field z2-0: int
|
||||
private field z2-1: int
|
||||
private field z3-0: int
|
||||
private field z3-1: int
|
||||
private field z4-0: int
|
||||
private field z4-1: int
|
||||
private field z5-0: int
|
||||
private field z5-1: int
|
||||
private field z6-0: int
|
||||
private field z6-1: int
|
||||
static method <clinit>(): void
|
||||
public method <init>(): void
|
||||
public synthetic final static method access$getJvmStaticX1-0$cp(): int
|
||||
public synthetic final static method access$getJvmStaticX1-1$cp(): int
|
||||
public synthetic final static method access$getJvmStaticX2-0$cp(): int
|
||||
public synthetic final static method access$getJvmStaticX2-1$cp(): int
|
||||
public synthetic final static method access$getJvmStaticX3-0$cp(): int
|
||||
public synthetic final static method access$getJvmStaticX3-1$cp(): int
|
||||
public synthetic final static method access$getJvmStaticX4-0$cp(): int
|
||||
public synthetic final static method access$getJvmStaticX4-1$cp(): int
|
||||
public synthetic final static method access$getJvmStaticX5-0$cp(): int
|
||||
public synthetic final static method access$getJvmStaticX5-1$cp(): int
|
||||
public synthetic final static method access$getJvmStaticX6-0$cp(): int
|
||||
public synthetic final static method access$getJvmStaticX6-1$cp(): int
|
||||
public synthetic final static method access$getJvmStaticY1-0$cp(): int
|
||||
public synthetic final static method access$getJvmStaticY1-1$cp(): int
|
||||
public synthetic final static method access$getJvmStaticY2-0$cp(): int
|
||||
public synthetic final static method access$getJvmStaticY2-1$cp(): int
|
||||
public synthetic final static method access$getJvmStaticY3-0$cp(): int
|
||||
public synthetic final static method access$getJvmStaticY3-1$cp(): int
|
||||
public synthetic final static method access$getJvmStaticY4-0$cp(): int
|
||||
public synthetic final static method access$getJvmStaticY4-1$cp(): int
|
||||
public synthetic final static method access$getJvmStaticY5-0$cp(): int
|
||||
public synthetic final static method access$getJvmStaticY5-1$cp(): int
|
||||
public synthetic final static method access$getJvmStaticY6-0$cp(): int
|
||||
public synthetic final static method access$getJvmStaticY6-1$cp(): int
|
||||
public synthetic final static method access$getJvmStaticZ1-0$cp(): int
|
||||
public synthetic final static method access$getJvmStaticZ1-1$cp(): int
|
||||
public synthetic final static method access$getJvmStaticZ2-0$cp(): int
|
||||
public synthetic final static method access$getJvmStaticZ2-1$cp(): int
|
||||
public synthetic final static method access$getJvmStaticZ3-0$cp(): int
|
||||
public synthetic final static method access$getJvmStaticZ3-1$cp(): int
|
||||
public synthetic final static method access$getJvmStaticZ4-0$cp(): int
|
||||
public synthetic final static method access$getJvmStaticZ4-1$cp(): int
|
||||
public synthetic final static method access$getJvmStaticZ5-0$cp(): int
|
||||
public synthetic final static method access$getJvmStaticZ5-1$cp(): int
|
||||
public synthetic final static method access$getJvmStaticZ6-0$cp(): int
|
||||
public synthetic final static method access$getJvmStaticZ6-1$cp(): int
|
||||
public synthetic final static method access$getStaticX1-0$cp(): int
|
||||
public synthetic final static method access$getStaticX1-1$cp(): int
|
||||
public synthetic final static method access$getStaticX2-0$cp(): int
|
||||
public synthetic final static method access$getStaticX2-1$cp(): int
|
||||
public synthetic final static method access$getStaticX3-0$cp(): int
|
||||
public synthetic final static method access$getStaticX3-1$cp(): int
|
||||
public synthetic final static method access$getStaticX4-0$cp(): int
|
||||
public synthetic final static method access$getStaticX4-1$cp(): int
|
||||
public synthetic final static method access$getStaticX5-0$cp(): int
|
||||
public synthetic final static method access$getStaticX5-1$cp(): int
|
||||
public synthetic final static method access$getStaticX6-0$cp(): int
|
||||
public synthetic final static method access$getStaticX6-1$cp(): int
|
||||
public synthetic final static method access$getStaticY1-0$cp(): int
|
||||
public synthetic final static method access$getStaticY1-1$cp(): int
|
||||
public synthetic final static method access$getStaticY2-0$cp(): int
|
||||
public synthetic final static method access$getStaticY2-1$cp(): int
|
||||
public synthetic final static method access$getStaticY3-0$cp(): int
|
||||
public synthetic final static method access$getStaticY3-1$cp(): int
|
||||
public synthetic final static method access$getStaticY4-0$cp(): int
|
||||
public synthetic final static method access$getStaticY4-1$cp(): int
|
||||
public synthetic final static method access$getStaticY5-0$cp(): int
|
||||
public synthetic final static method access$getStaticY5-1$cp(): int
|
||||
public synthetic final static method access$getStaticY6-0$cp(): int
|
||||
public synthetic final static method access$getStaticY6-1$cp(): int
|
||||
public synthetic final static method access$getStaticZ1-0$cp(): int
|
||||
public synthetic final static method access$getStaticZ1-1$cp(): int
|
||||
public synthetic final static method access$getStaticZ2-0$cp(): int
|
||||
public synthetic final static method access$getStaticZ2-1$cp(): int
|
||||
public synthetic final static method access$getStaticZ3-0$cp(): int
|
||||
public synthetic final static method access$getStaticZ3-1$cp(): int
|
||||
public synthetic final static method access$getStaticZ4-0$cp(): int
|
||||
public synthetic final static method access$getStaticZ4-1$cp(): int
|
||||
public synthetic final static method access$getStaticZ5-0$cp(): int
|
||||
public synthetic final static method access$getStaticZ5-1$cp(): int
|
||||
public synthetic final static method access$getStaticZ6-0$cp(): int
|
||||
public synthetic final static method access$getStaticZ6-1$cp(): int
|
||||
public synthetic final static method access$setJvmStaticX1-0$cp(p0: int): void
|
||||
public synthetic final static method access$setJvmStaticX1-1$cp(p0: int): void
|
||||
public synthetic final static method access$setJvmStaticX2-0$cp(p0: int): void
|
||||
public synthetic final static method access$setJvmStaticX2-1$cp(p0: int): void
|
||||
public synthetic final static method access$setJvmStaticX6-0$cp(p0: int): void
|
||||
public synthetic final static method access$setJvmStaticX6-1$cp(p0: int): void
|
||||
public synthetic final static method access$setJvmStaticY1-0$cp(p0: int): void
|
||||
public synthetic final static method access$setJvmStaticY1-1$cp(p0: int): void
|
||||
public synthetic final static method access$setJvmStaticY2-0$cp(p0: int): void
|
||||
public synthetic final static method access$setJvmStaticY2-1$cp(p0: int): void
|
||||
public synthetic final static method access$setJvmStaticY6-0$cp(p0: int): void
|
||||
public synthetic final static method access$setJvmStaticY6-1$cp(p0: int): void
|
||||
public synthetic final static method access$setJvmStaticZ1-0$cp(p0: int): void
|
||||
public synthetic final static method access$setJvmStaticZ1-1$cp(p0: int): void
|
||||
public synthetic final static method access$setJvmStaticZ2-0$cp(p0: int): void
|
||||
public synthetic final static method access$setJvmStaticZ2-1$cp(p0: int): void
|
||||
public synthetic final static method access$setJvmStaticZ6-0$cp(p0: int): void
|
||||
public synthetic final static method access$setJvmStaticZ6-1$cp(p0: int): void
|
||||
public synthetic final static method access$setStaticX1-0$cp(p0: int): void
|
||||
public synthetic final static method access$setStaticX1-1$cp(p0: int): void
|
||||
public synthetic final static method access$setStaticX2-0$cp(p0: int): void
|
||||
public synthetic final static method access$setStaticX2-1$cp(p0: int): void
|
||||
public synthetic final static method access$setStaticX6-0$cp(p0: int): void
|
||||
public synthetic final static method access$setStaticX6-1$cp(p0: int): void
|
||||
public synthetic final static method access$setStaticY1-0$cp(p0: int): void
|
||||
public synthetic final static method access$setStaticY1-1$cp(p0: int): void
|
||||
public synthetic final static method access$setStaticY2-0$cp(p0: int): void
|
||||
public synthetic final static method access$setStaticY2-1$cp(p0: int): void
|
||||
public synthetic final static method access$setStaticY6-0$cp(p0: int): void
|
||||
public synthetic final static method access$setStaticY6-1$cp(p0: int): void
|
||||
public synthetic final static method access$setStaticZ1-0$cp(p0: int): void
|
||||
public synthetic final static method access$setStaticZ1-1$cp(p0: int): void
|
||||
public synthetic final static method access$setStaticZ2-0$cp(p0: int): void
|
||||
public synthetic final static method access$setStaticZ2-1$cp(p0: int): void
|
||||
public synthetic final static method access$setStaticZ6-0$cp(p0: int): void
|
||||
public synthetic final static method access$setStaticZ6-1$cp(p0: int): void
|
||||
public final method callAll(): void
|
||||
public final method getX1$x(): int
|
||||
public final method getX1$y(): int
|
||||
public final static @org.jetbrains.annotations.NotNull method getJvmStaticX1(): Public
|
||||
public final static @org.jetbrains.annotations.NotNull method getJvmStaticX2$main(): Public
|
||||
private final static method getJvmStaticX3(): Public
|
||||
public final static @org.jetbrains.annotations.NotNull method getJvmStaticX4(): Public
|
||||
public final static @org.jetbrains.annotations.NotNull method getJvmStaticX5$main(): Public
|
||||
public final static @org.jetbrains.annotations.NotNull method getJvmStaticX6(): Public
|
||||
public final static @org.jetbrains.annotations.NotNull method getJvmStaticY1(): Internal
|
||||
public final static @org.jetbrains.annotations.NotNull method getJvmStaticY2$main(): Internal
|
||||
private final static method getJvmStaticY3(): Internal
|
||||
public final static @org.jetbrains.annotations.NotNull method getJvmStaticY4(): Internal
|
||||
public final static @org.jetbrains.annotations.NotNull method getJvmStaticY5$main(): Internal
|
||||
public final static @org.jetbrains.annotations.NotNull method getJvmStaticY6(): Internal
|
||||
public final static @org.jetbrains.annotations.NotNull method getJvmStaticZ1(): Private
|
||||
public final static @org.jetbrains.annotations.NotNull method getJvmStaticZ2$main(): Private
|
||||
private final static method getJvmStaticZ3(): Private
|
||||
public final static @org.jetbrains.annotations.NotNull method getJvmStaticZ4(): Private
|
||||
public final static @org.jetbrains.annotations.NotNull method getJvmStaticZ5$main(): Private
|
||||
public final static @org.jetbrains.annotations.NotNull method getJvmStaticZ6(): Private
|
||||
public final @org.jetbrains.annotations.NotNull method getX1(): Public
|
||||
public synthetic final method getX1-0(): int
|
||||
public synthetic final method getX1-1(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getX2$main(): Public
|
||||
public final method getX2$x$main(): int
|
||||
public final method getX2$y$main(): int
|
||||
public synthetic final method getX2-0(): int
|
||||
public synthetic final method getX2-1(): int
|
||||
private final method getX3(): Public
|
||||
public final method getX4$x(): int
|
||||
public final method getX4$y(): int
|
||||
public synthetic final method getX3-0(): int
|
||||
public synthetic final method getX3-1(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getX4(): Public
|
||||
public synthetic final method getX4-0(): int
|
||||
public synthetic final method getX4-1(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getX5$main(): Public
|
||||
public final method getX5$x$main(): int
|
||||
public final method getX5$y$main(): int
|
||||
public final method getX6$x(): int
|
||||
public final method getX6$y(): int
|
||||
public synthetic final method getX5-0(): int
|
||||
public synthetic final method getX5-1(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getX6(): Public
|
||||
public final method getY1$x$main(): int
|
||||
public final method getY1$y$main(): int
|
||||
public synthetic final method getX6-0(): int
|
||||
public synthetic final method getX6-1(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getY1(): Internal
|
||||
public synthetic final method getY1-0(): int
|
||||
public synthetic final method getY1-1(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getY2$main(): Internal
|
||||
public final method getY2$x$main(): int
|
||||
public final method getY2$y$main(): int
|
||||
public synthetic final method getY2-0(): int
|
||||
public synthetic final method getY2-1(): int
|
||||
private final method getY3(): Internal
|
||||
public final method getY4$x$main(): int
|
||||
public final method getY4$y$main(): int
|
||||
public synthetic final method getY3-0(): int
|
||||
public synthetic final method getY3-1(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getY4(): Internal
|
||||
public synthetic final method getY4-0(): int
|
||||
public synthetic final method getY4-1(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getY5$main(): Internal
|
||||
public final method getY5$x$main(): int
|
||||
public final method getY5$y$main(): int
|
||||
public final method getY6$x$main(): int
|
||||
public final method getY6$y$main(): int
|
||||
public synthetic final method getY5-0(): int
|
||||
public synthetic final method getY5-1(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getY6(): Internal
|
||||
public synthetic final method getY6-0(): int
|
||||
public synthetic final method getY6-1(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getZ1(): Private
|
||||
public synthetic final method getZ1-0(): int
|
||||
public synthetic final method getZ1-1(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getZ2$main(): Private
|
||||
public synthetic final method getZ2-0(): int
|
||||
public synthetic final method getZ2-1(): int
|
||||
private final method getZ3(): Private
|
||||
public synthetic final method getZ3-0(): int
|
||||
public synthetic final method getZ3-1(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getZ4(): Private
|
||||
public synthetic final method getZ4-0(): int
|
||||
public synthetic final method getZ4-1(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getZ5$main(): Private
|
||||
public synthetic final method getZ5-0(): int
|
||||
public synthetic final method getZ5-1(): int
|
||||
public final @org.jetbrains.annotations.NotNull method getZ6(): Private
|
||||
public synthetic final method getZ6-0(): int
|
||||
public synthetic final method getZ6-1(): int
|
||||
public final method setX1-sUp7gFk(p0: int, p1: int): void
|
||||
public final method setX2-sUp7gFk$main(p0: int, p1: int): void
|
||||
private final method setX3-sUp7gFk(p0: int, p1: int): void
|
||||
private final method setX4-sUp7gFk(p0: int, p1: int): void
|
||||
private final method setX5-sUp7gFk(p0: int, p1: int): void
|
||||
public final method setX6-sUp7gFk$main(p0: int, p1: int): void
|
||||
public final method setY1-sUp7gFk(p0: int, p1: int): void
|
||||
public final method setY2-sUp7gFk$main(p0: int, p1: int): void
|
||||
private final method setY3-sUp7gFk(p0: int, p1: int): void
|
||||
private final method setY4-sUp7gFk(p0: int, p1: int): void
|
||||
private final method setY5-sUp7gFk(p0: int, p1: int): void
|
||||
public final method setY6-sUp7gFk$main(p0: int, p1: int): void
|
||||
public final method setZ1-sUp7gFk(p0: int, p1: int): void
|
||||
public final method setZ2-sUp7gFk$main(p0: int, p1: int): void
|
||||
private final method setZ3-sUp7gFk(p0: int, p1: int): void
|
||||
private final method setZ4-sUp7gFk(p0: int, p1: int): void
|
||||
private final method setZ5-sUp7gFk(p0: int, p1: int): void
|
||||
public final method setZ6-sUp7gFk$main(p0: int, p1: int): void
|
||||
public final inner class Regular$Companion
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class VisibilityKt {
|
||||
// source: 'visibility.kt'
|
||||
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
|
||||
public final inner class Regular$Companion
|
||||
}
|
||||
|
||||
@@ -41,28 +41,27 @@ fun functionWithoutBoxes(x: D, y: D) {
|
||||
// 2 public final static constructor-impl\(IILjava/lang/String;\)V
|
||||
// 2 INVOKESTATIC D.constructor-impl \(IILjava/lang/String;\)V
|
||||
// 2 INVOKESTATIC C.constructor-impl \(IILjava/lang/String;\)V
|
||||
// 1 public final getX\(\)LC;
|
||||
// 1 public final getX\$x\(\)I
|
||||
// 1 public final getX\$y-\w*\(\)I
|
||||
// 1 public final getX\$z\(\)Ljava/lang/String;
|
||||
// 1 public final static getX-impl\(.+\)LC;
|
||||
// 1 public final synthetic unbox-impl-0-0\(\)I
|
||||
// 1 public final synthetic unbox-impl-0-1\(\)I
|
||||
// 1 public final synthetic unbox-impl-0-2\(\)Ljava/lang/String;
|
||||
// 2 private synthetic <init>\(IILjava/lang/String;\)V
|
||||
// 1 public final static synthetic box-impl\(IILjava/lang/String;\)LD;
|
||||
// 1 public final static synthetic box-impl\(IILjava/lang/String;\)LC;
|
||||
// 2 public final synthetic unbox-impl0\(\)I
|
||||
// 2 public final synthetic unbox-impl1\(\)I
|
||||
// 2 public final synthetic unbox-impl2\(\)Ljava/lang/String;
|
||||
// 1 private I x\$x
|
||||
// 1 private I x\$y
|
||||
// 1 private Ljava/lang/String; x\$z
|
||||
// 0 private LC; x
|
||||
// 3 private I x
|
||||
// 1 private I y
|
||||
// 1 private Ljava/lang/String; z
|
||||
// 1 public final synthetic unbox-impl-0\(\)I
|
||||
// 1 public final synthetic unbox-impl-1\(\)I
|
||||
// 1 public final synthetic unbox-impl-2\(\)Ljava/lang/String;
|
||||
// 1 private final I field-0-0\n
|
||||
// 1 private final I field-0-1\n
|
||||
// 1 private final Ljava/lang/String; field-0-2\n
|
||||
// 0 private final LC; (field.*)x\n
|
||||
// 1 private final I x\n
|
||||
// 1 private final I field-0\n
|
||||
// 1 private final I field-1\n
|
||||
// 1 private final Ljava/lang/String; field-2\n
|
||||
// 1 INVOKESPECIAL C.<init> \(IILjava/lang/String;\)V
|
||||
// 1 INVOKESPECIAL D.<init> \(IILjava/lang/String;\)V
|
||||
// 1 INVOKESTATIC D.box-impl \(IILjava/lang/String;\)LD;
|
||||
// 1 INVOKESTATIC D.box-impl \(IILjava/lang/String;\)LD;\n ARETURN
|
||||
// 1 INVOKESTATIC C.box-impl \(IILjava/lang/String;\)LC;
|
||||
// 1 INVOKESTATIC C.box-impl \(IILjava/lang/String;\)LC;\n ARETURN
|
||||
// 2 INVOKESTATIC C.box-impl \(IILjava/lang/String;\)LC;
|
||||
// 1 public final static functionWithoutBoxes-GPBa7dw\(IILjava/lang/String;IILjava/lang/String;\)V
|
||||
// 0 functionWithoutBoxes.*(\n {3}.*)*(\n {4}(NEW [ABCD]|.*(box|[ABCD]\.<init>|LA;|LB;|LC;|LD;)))
|
||||
|
||||
@@ -62,12 +62,10 @@ fun reassignField(x: DPoint, box: Box) {
|
||||
// 1 107(\D|\d\D|\d\d\D)*(DSTORE(\D|\d\D|\d\d\D)*){2}108
|
||||
// 0 107(\D|\d\D|\d\d\D)*(DSTORE(\D|\d\D|\d\d\D)*){3}108
|
||||
// 0 108(\D|\d\D|\d\d\D)*(DSTORE(\D|\d\D|\d\d\D)*){1}109
|
||||
// 1 109(\D|\d\D|\d\d\D)*(DSTORE(\D|\d\D|\d\d\D)*){2}110
|
||||
// 0 109(\D|\d\D|\d\d\D)*(DSTORE(\D|\d\D|\d\d\D)*){3}110
|
||||
// 0 109(\D|\d\D|\d\d\D)*([DA]STORE(\D|\d\D|\d\d\D)*){1}110
|
||||
// 1 110(\D|\d\D|\d\d\D)*(DSTORE(\D|\d\D|\d\d\D)*){2}111
|
||||
// 0 110(\D|\d\D|\d\d\D)*(DSTORE(\D|\d\D|\d\d\D)*){3}111
|
||||
// 0 111(\D|\d\D|\d\d\D)*(DSTORE(\D|\d\D|\d\d\D)*){1}112
|
||||
// 1 112(\D|\d\D|\d\d\D)*(DSTORE(\D|\d\D|\d\d\D)*){2}113
|
||||
// 0 112(\D|\d\D|\d\d\D)*(DSTORE(\D|\d\D|\d\d\D)*){3}113
|
||||
// 1 113(\D|\d\D|\d\d\D)*(DSTORE(\D|\d\D|\d\d\D)*){2}114
|
||||
// 0 113(\D|\d\D|\d\d\D)*(DSTORE(\D|\d\D|\d\d\D)*){3}114
|
||||
// 0 112(\D|\d\D|\d\d\D)*([DA]STORE(\D|\d\D|\d\d\D)*){1}113
|
||||
// 1 113(\D|\d\D|\d\d\D)*(ASTORE(\D|\d\D|\d\d\D)*){1}114
|
||||
// 0 113(\D|\d\D|\d\d\D)*(ASTORE(\D|\d\D|\d\d\D)*){2}114
|
||||
|
||||
@@ -13,18 +13,43 @@ fun DPoint.toObject() = this as Any
|
||||
fun DPoint.toDPointOrNull() = this as DPoint?
|
||||
fun Nothing?.toDPointOrNull() = this as DPoint?
|
||||
|
||||
fun equalsChecks(left: DPoint, right: DPoint) {
|
||||
// separate to escape from StackOverflow in regex
|
||||
|
||||
fun equalsChecks1(left: DPoint, right: DPoint) {
|
||||
require(100, left == right)
|
||||
}
|
||||
|
||||
fun equalsChecks2(left: DPoint, right: DPoint) {
|
||||
require(101, left.toObject() == right)
|
||||
}
|
||||
fun equalsChecks3(left: DPoint, right: DPoint) {
|
||||
require(102, left == right.toObject())
|
||||
}
|
||||
fun equalsChecks4(left: DPoint, right: DPoint) {
|
||||
require(103, left.toObject() == right.toObject())
|
||||
}
|
||||
fun equalsChecks5(left: DPoint, right: DPoint) {
|
||||
require(104, null == right)
|
||||
}
|
||||
fun equalsChecks6(left: DPoint, right: DPoint) {
|
||||
require(105, left == null)
|
||||
}
|
||||
fun equalsChecks7(left: DPoint, right: DPoint) {
|
||||
require(106, null as Any? == right)
|
||||
}
|
||||
fun equalsChecks8(left: DPoint, right: DPoint) {
|
||||
require(107, left == null as Any?)
|
||||
}
|
||||
fun equalsChecks9(left: DPoint, right: DPoint) {
|
||||
require(108, null.toDPointOrNull() == right)
|
||||
}
|
||||
fun equalsChecks10(left: DPoint, right: DPoint) {
|
||||
require(109, left == null.toDPointOrNull())
|
||||
}
|
||||
fun equalsChecks11(left: DPoint, right: DPoint) {
|
||||
require(110, left.toDPointOrNull() == right)
|
||||
}
|
||||
fun equalsChecks12(left: DPoint, right: DPoint) {
|
||||
require(111, left == right.toDPointOrNull())
|
||||
}
|
||||
|
||||
@@ -36,7 +61,7 @@ fun equalsChecks(left: DPoint, right: DPoint) {
|
||||
// 1 BIPUSH 105\n {4}DLOAD 0\n {4}DLOAD 2\n {4}ACONST_NULL\n {4}INVOKESTATIC .*equals-impl .*\n {4}INVOKESTATIC .*require
|
||||
// 1 BIPUSH 106\n {4}ACONST_NULL\n {4}DLOAD 4\n {4}DLOAD 6\n {4}.*box.*\n {4}INVOKESTATIC .*Intrinsics.areEqual.*\n {4}INVOKESTATIC .*require
|
||||
// 1 BIPUSH 107\n {4}DLOAD 0\n {4}DLOAD 2\n {4}ACONST_NULL\n {4}INVOKESTATIC .*equals-impl .*\n {4}INVOKESTATIC .*require
|
||||
// 1 BIPUSH 108\n {4}ACONST_NULL\n {4}.*toDPointOrNull.*\n {4}DUP\n {4}IFNONNULL.*(\n {3}([^b\n]|b[^o\n]|bo[^x\n]|box-impl\d)*)*\n {4}INVOKESTATIC .*require
|
||||
// 1 BIPUSH 108\n {4}ACONST_NULL\n {4}.*toDPointOrNull.*\n {4}ASTORE.*\n {4}ALOAD.*\n {4}DUP\n {4}IFNONNULL.*(\n {3}([^b\n]|b[^o\n]|bo[^x\n]|box-impl-\d)+)*\n {4}INVOKESTATIC .*require
|
||||
// 1 BIPUSH 109\n {4}DLOAD 0\n {4}DLOAD 2\n {4}ACONST_NULL\n {4}.*toDPointOrNull.*\n {4}INVOKESTATIC .*equals-impl .*\n {4}INVOKESTATIC .*require
|
||||
// 1 BIPUSH 110\n {4}DLOAD 0\n {4}DLOAD 2\n {4}.*toDPointOrNull.*\n {4}DUP\n {4}IFNONNULL.*(\n {3}([^b\n]|b[^o\n]|bo[^x\n]|box-impl\d)*)*\n {4}INVOKESTATIC .*require
|
||||
// 1 BIPUSH 110\n {4}DLOAD 0\n {4}DLOAD 2\n {4}.*toDPointOrNull.*\n {4}ASTORE.*\n {4}ALOAD.*\n {4}DUP\n {4}IFNONNULL.*(\n {3}([^b\n]|b[^o\n]|bo[^x\n]|box-impl-\d)+)*\n {4}INVOKESTATIC .*require
|
||||
// 1 BIPUSH 111\n {4}DLOAD 0\n {4}DLOAD 2\n {4}DLOAD 4\n {4}DLOAD 6\n {4}.*toDPointOrNull.*\n {4}INVOKESTATIC .*equals-impl .*\n {4}INVOKESTATIC .*require
|
||||
|
||||
+25
-30
@@ -74,20 +74,20 @@ fun trySetSegment(segment: DSegment) {
|
||||
|
||||
// 0 public final getOpposite\(\)LDPoint;
|
||||
// 1 public final static getOpposite-impl\(DD\)LDPoint;
|
||||
// 1 private D p1\$x
|
||||
// 1 private D p1\$y
|
||||
// 1 private D p1-0
|
||||
// 1 private D p1-1
|
||||
// 0 private DPoint; p1
|
||||
// 1 private D p2\$x
|
||||
// 1 private D p2\$y
|
||||
// 1 private D p2-0
|
||||
// 1 private D p2-1
|
||||
// 0 private DPoint; p2
|
||||
// 1 private D point1WithBackingFieldAndDefaultGetter\$x
|
||||
// 1 private D point1WithBackingFieldAndDefaultGetter\$y
|
||||
// 1 private D point1WithBackingFieldAndDefaultGetter-0
|
||||
// 1 private D point1WithBackingFieldAndDefaultGetter-1
|
||||
// 0 private DPoint; point1WithBackingFieldAndDefaultGetter
|
||||
// 1 private D point2WithBackingFieldAndDefaultGetter\$x
|
||||
// 1 private D point2WithBackingFieldAndDefaultGetter\$y
|
||||
// 1 private D point2WithBackingFieldAndDefaultGetter-0
|
||||
// 1 private D point2WithBackingFieldAndDefaultGetter-1
|
||||
// 0 private DPoint; point2WithBackingFieldAndDefaultGetter
|
||||
// 1 private D pointWithBackingFieldAndCustomGetter\$x
|
||||
// 1 private D pointWithBackingFieldAndCustomGetter\$y
|
||||
// 1 private D pointWithBackingFieldAndCustomGetter-0
|
||||
// 1 private D pointWithBackingFieldAndCustomGetter-1
|
||||
// 0 private DPoint; pointWithBackingFieldAndCustomGetter
|
||||
// 0 private DPoint; notImplemented
|
||||
// 0 private D notImplemented
|
||||
@@ -108,22 +108,22 @@ fun trySetSegment(segment: DSegment) {
|
||||
// 1 public final setPoint2WithBackingFieldAndDefaultGetter-sUp7gFk\(DD\)V
|
||||
// 1 public final getPointWithBackingFieldAndCustomGetter\(\)LDPoint;
|
||||
// 1 public final setPointWithBackingFieldAndCustomGetter-sUp7gFk\(DD\)V
|
||||
// 1 public final getP1\$x\(\)D
|
||||
// 1 public final getP1\$y\(\)D
|
||||
// 1 public final getP2\$x\(\)D
|
||||
// 1 public final getP2\$y\(\)D
|
||||
// 1 public final getPoint1WithBackingFieldAndDefaultGetter\$x\(\)D
|
||||
// 1 public final getPoint1WithBackingFieldAndDefaultGetter\$y\(\)D
|
||||
// 1 public final getPoint2WithBackingFieldAndDefaultGetter\$x\(\)D
|
||||
// 1 public final getPoint2WithBackingFieldAndDefaultGetter\$y\(\)D
|
||||
// 1 public final synthetic getP1-0\(\)D
|
||||
// 1 public final synthetic getP1-1\(\)D
|
||||
// 1 public final synthetic getP2-0\(\)D
|
||||
// 1 public final synthetic getP2-1\(\)D
|
||||
// 1 public final synthetic getPoint1WithBackingFieldAndDefaultGetter-0\(\)D
|
||||
// 1 public final synthetic getPoint1WithBackingFieldAndDefaultGetter-1\(\)D
|
||||
// 1 public final synthetic getPoint2WithBackingFieldAndDefaultGetter-0\(\)D
|
||||
// 1 public final synthetic getPoint2WithBackingFieldAndDefaultGetter-1\(\)D
|
||||
// 0 public final getCenter\$
|
||||
// 0 public final getNotImplemented\$
|
||||
// 0 public final getPointWithBackingFieldAndCustomGetter\$
|
||||
// 0 ^ {2}\b.*get.*\$.*(\n {3}.*)*(\n {4}.*\.box)
|
||||
// 1 tryGetSegment\(LDSegment;\)V
|
||||
// 0 try[GS]etSegment\(LDSegment;\)V.*(\n {3}.*)*(\n {4}.*\.box)
|
||||
// 1 tryGetSegment\(LDSegment;\)V.*((\n {3}.*)*(\n {4}.*LDPoint;)){13}
|
||||
// 0 tryGetSegment\(LDSegment;\)V.*((\n {3}.*)*(\n {4}.*LDPoint;)){14}
|
||||
// 1 tryGetSegment\(LDSegment;\)V.*((\n {3}.*)*(\n {4}.*LDPoint;)){7}
|
||||
// 0 tryGetSegment\(LDSegment;\)V.*((\n {3}.*)*(\n {4}.*LDPoint;)){8}
|
||||
// 0 trySetSegment\(LDSegment;\)V.*(\n {3}.*)*(\n {4}.*LDPoint;)
|
||||
// 1 trySetSegment\(LDSegment;\)V.*((\n {3}.*)*(\n {4}INVOKEVIRTUAL DSegment\.setNotImplemented-sUp7gFk \(DD\)V)){1}
|
||||
// 0 trySetSegment\(LDSegment;\)V.*((\n {3}.*)*(\n {4}INVOKEVIRTUAL DSegment\.setNotImplemented-sUp7gFk \(DD\)V)){2}
|
||||
@@ -137,13 +137,8 @@ fun trySetSegment(segment: DSegment) {
|
||||
// 0 trySetSegment\(LDSegment;\)V.*((\n {3}.*)*(\n {4}INVOKEVIRTUAL DSegment\.setP1-sUp7gFk \(DD\)V)){2}
|
||||
// 1 trySetSegment\(LDSegment;\)V.*((\n {3}.*)*(\n {4}INVOKEVIRTUAL DSegment\.setP2-sUp7gFk \(DD\)V)){1}
|
||||
// 0 trySetSegment\(LDSegment;\)V.*((\n {3}.*)*(\n {4}INVOKEVIRTUAL DSegment\.setP2-sUp7gFk \(DD\)V)){2}
|
||||
// 1 tryGetSegment\(LDSegment;\)V.*((\n {3}.*)*(\n {4}INVOKEVIRTUAL DPoint\.getX \(\)D)){3}
|
||||
// 0 tryGetSegment\(LDSegment;\)V.*((\n {3}.*)*(\n {4}INVOKEVIRTUAL DPoint\.getX \(\)D)){4}
|
||||
// 0 trySetSegment\(LDSegment;\)V.*(\n {3}.*)*(\n {4}INVOKEVIRTUAL DPoint\.getX \(\)D)
|
||||
// 1 tryGetSegment\(LDSegment;\)V.*((\n {3}.*)*(\n {4}INVOKEVIRTUAL DPoint\.getY \(\)D)){3}
|
||||
// 0 tryGetSegment\(LDSegment;\)V.*((\n {3}.*)*(\n {4}INVOKEVIRTUAL DPoint\.getY \(\)D)){4}
|
||||
// 0 trySetSegment\(LDSegment;\)V.*(\n {3}.*)*(\n {4}INVOKEVIRTUAL DPoint\.getY \(\)D)
|
||||
// 1 tryGetSegment\(LDSegment;\)V.*((\n {3}.*)*?(\n {4}INVOKEVIRTUAL DSegment\.get.*\$[xy] \(\)D)){8}
|
||||
// 0 tryGetSegment\(LDSegment;\)V.*((\n {3}.*)*?(\n {4}INVOKEVIRTUAL DSegment\.get.*\$[xy] \(\)D)){9}
|
||||
// 1 trySetSegment\(LDSegment;\)V.*((\n {3}.*)*?(\n {4}INVOKEVIRTUAL DSegment\.get.*\$[xy] \(\)D)){12}
|
||||
// 0 trySetSegment\(LDSegment;\)V.*((\n {3}.*)*?(\n {4}INVOKEVIRTUAL DSegment\.get.*\$[xy] \(\)D)){13}
|
||||
// 0 try[GS]etSegment\(LDSegment;\)V.*(\n {3}.*)*(\n {4}INVOKEVIRTUAL DPoint\.get[XY] \(\)D)
|
||||
// 1 tryGetSegment\(LDSegment;\)V.*((\n {3}.*)*?(\n {4}INVOKEVIRTUAL DSegment\.get.*-[01] \(\)D)){14}
|
||||
// 0 tryGetSegment\(LDSegment;\)V.*((\n {3}.*)*?(\n {4}INVOKEVIRTUAL DSegment\.get.*-[01] \(\)D)){15}
|
||||
// 1 trySetSegment\(LDSegment;\)V.*((\n {3}.*)*?(\n {4}INVOKEVIRTUAL DSegment\.get.*-[01] \(\)D)){12}
|
||||
// 0 trySetSegment\(LDSegment;\)V.*((\n {3}.*)*?(\n {4}INVOKEVIRTUAL DSegment\.get.*-[01] \(\)D)){13}
|
||||
|
||||
+3
-3
@@ -50202,9 +50202,9 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("MFVCFieldInitializationOrder.kt")
|
||||
public void testMFVCFieldInitializationOrder() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/valueClasses/MFVCFieldInitializationOrder.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal());
|
||||
@TestMetadata("MfvcFieldInitializationOrder.kt")
|
||||
public void testMfvcFieldInitializationOrder() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/valueClasses/MfvcFieldInitializationOrder.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user