Introduce IrGetValue as a replacement for IrThisReference / IrGetExtensionReceiver / IrGetVariable.

This commit is contained in:
Dmitry Petrov
2016-09-30 17:45:41 +03:00
parent 8efe326904
commit a51efaacc9
82 changed files with 409 additions and 457 deletions
@@ -31,7 +31,7 @@ import java.util.*
class Closure(
val capturedThisReferences: List<ClassDescriptor>,
val capturedReceiverParameters: List<ReceiverParameterDescriptor>,
val capturedVariables: List<VariableDescriptor>
val capturedValues: List<ValueDescriptor>
)
abstract class AbstractClosureAnnotator : IrElementVisitorVoid {
@@ -41,18 +41,18 @@ abstract class AbstractClosureAnnotator : IrElementVisitorVoid {
private class ClosureBuilder(val owner: DeclarationDescriptor) {
val capturedThisReferences = mutableSetOf<ClassDescriptor>()
val capturedReceiverParameters = mutableSetOf<ReceiverParameterDescriptor>()
val capturedVariables = mutableSetOf<VariableDescriptor>()
val capturedValues = mutableSetOf<ValueDescriptor>()
fun buildClosure() = Closure(
capturedThisReferences.toList(),
capturedReceiverParameters.toList(),
capturedVariables.toList()
capturedValues.toList()
)
fun addNested(closure: Closure) {
fillInCapturedThisReferences(closure)
fillInNestedClosure(capturedReceiverParameters, closure.capturedReceiverParameters)
fillInNestedClosure(capturedVariables, closure.capturedVariables)
fillInNestedClosure(capturedValues, closure.capturedValues)
}
private fun fillInCapturedThisReferences(closure: Closure) {
@@ -126,25 +126,14 @@ abstract class AbstractClosureAnnotator : IrElementVisitorVoid {
declaration.delegate.initializer?.acceptVoid(this)
}
override fun visitThisReference(expression: IrThisReference) {
closuresStack.peek().addCapturedThis(expression.classDescriptor)
}
override fun visitVariableAccess(expression: IrVariableAccessExpression) {
override fun visitVariableAccess(expression: IrValueAccessExpression) {
val closureBuilder = closuresStack.peek()
val variableDescriptor = expression.descriptor
if (variableDescriptor.containingDeclaration != closureBuilder.owner) {
closureBuilder.capturedVariables.add(variableDescriptor)
closureBuilder.capturedValues.add(variableDescriptor)
}
expression.acceptChildrenVoid(this)
}
override fun visitGetExtensionReceiver(expression: IrGetExtensionReceiver) {
val closureBuilder = closuresStack.peek()
val receiverDescriptor = expression.descriptor
if (receiverDescriptor.containingDeclaration != closureBuilder.owner) {
closureBuilder.capturedReceiverParameters.add(receiverDescriptor)
}
}
}
@@ -238,11 +238,7 @@ class ExpressionCodegen(
return expression.accept(this, data)
}
override fun visitGetExtensionReceiver(expression: IrGetExtensionReceiver, data: BlockInfo): StackValue {
return generateLocal(expression.descriptor, expression.asmType)
}
override fun visitGetVariable(expression: IrGetVariable, data: BlockInfo): StackValue {
override fun visitGetValue(expression: IrGetValue, data: BlockInfo): StackValue {
return generateLocal(expression.descriptor, expression.asmType)
}
@@ -286,11 +282,6 @@ class ExpressionCodegen(
return expression.onStack
}
override fun visitThisReference(expression: IrThisReference, data: BlockInfo): StackValue {
StackValue.local(0, expression.asmType).put(expression.asmType, mv)
return expression.onStack
}
override fun <T> visitConst(expression: IrConst<T>, data: BlockInfo): StackValue {
val value = expression.value
val type = expression.asmType
@@ -19,11 +19,17 @@ package org.jetbrains.kotlin.backend.jvm.codegen
import org.jetbrains.kotlin.backend.jvm.lower.InitializersLowering
import org.jetbrains.kotlin.codegen.AsmUtil
import org.jetbrains.kotlin.codegen.AsmUtil.isStaticMethod
import org.jetbrains.kotlin.codegen.FunctionCodegen.createFrameMap
import org.jetbrains.kotlin.codegen.FrameMap
import org.jetbrains.kotlin.codegen.JvmCodegenUtil
import org.jetbrains.kotlin.codegen.OwnerKind
import org.jetbrains.kotlin.codegen.state.GenerationState
import org.jetbrains.kotlin.descriptors.ClassConstructorDescriptor
import org.jetbrains.kotlin.descriptors.FunctionDescriptor
import org.jetbrains.kotlin.ir.declarations.IrFunction
import org.jetbrains.kotlin.resolve.DescriptorUtils
import org.jetbrains.kotlin.resolve.jvm.AsmTypes
import org.jetbrains.kotlin.resolve.jvm.jvmSignature.JvmMethodParameterKind
import org.jetbrains.kotlin.resolve.jvm.jvmSignature.JvmMethodSignature
import org.jetbrains.org.objectweb.asm.Opcodes
import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter
@@ -36,7 +42,7 @@ class FunctionCodegen(val irFunction: IrFunction, val classCodegen: ClassCodegen
fun generate() {
val signature = classCodegen.typeMapper.mapSignatureWithGeneric(descriptor, OwnerKind.IMPLEMENTATION)
val isStatic = isStaticMethod(classCodegen.descriptor.getMemberOwnerKind(), descriptor) || DescriptorUtils.isStaticDeclaration(descriptor)
val frameMap = createFrameMap(classCodegen.state, descriptor, signature, isStatic)
val frameMap = createFrameMapWithReceivers(classCodegen.state, descriptor, signature, isStatic)
var flags = AsmUtil.getMethodAsmFlags(descriptor, OwnerKind.IMPLEMENTATION, state).or(if (isStatic) Opcodes.ACC_STATIC else 0)
val interfaceClInit = JvmCodegenUtil.isJvmInterface(classCodegen.descriptor) && InitializersLowering.clinitName == descriptor.name
@@ -57,3 +63,42 @@ class FunctionCodegen(val irFunction: IrFunction, val classCodegen: ClassCodegen
ExpressionCodegen(irFunction, frameMap, InstructionAdapter(methodVisitor), classCodegen).generate()
}
}
fun createFrameMapWithReceivers(
state: GenerationState,
function: FunctionDescriptor,
signature: JvmMethodSignature,
isStatic: Boolean
): FrameMap {
val frameMap = FrameMap()
if (!isStatic) {
val descriptorForThis =
if (function is ClassConstructorDescriptor)
function.containingDeclaration.thisAsReceiverParameter
else
function.dispatchReceiverParameter
frameMap.enter(descriptorForThis, AsmTypes.OBJECT_TYPE)
}
for (parameter in signature.valueParameters) {
if (parameter.kind == JvmMethodParameterKind.RECEIVER) {
val receiverParameter = function.extensionReceiverParameter
if (receiverParameter != null) {
frameMap.enter(receiverParameter, state.typeMapper.mapType(receiverParameter))
}
else {
frameMap.enterTemp(parameter.asmType)
}
}
else if (parameter.kind != JvmMethodParameterKind.VALUE) {
frameMap.enterTemp(parameter.asmType)
}
}
for (parameter in function.valueParameters) {
frameMap.enter(parameter, state.typeMapper.mapType(parameter))
}
return frameMap
}
@@ -282,8 +282,8 @@ class EnumClassLowering(val context: JvmBackendContext) : ClassLoweringPass {
throw AssertionError("No 'ordinal' parameter in enum constructor: $enumClassConstructor")
}
result.putValueArgument(0, IrGetVariableImpl(startOffset, endOffset, nameParameter, origin))
result.putValueArgument(1, IrGetVariableImpl(startOffset, endOffset, ordinalParameter, origin))
result.putValueArgument(0, IrGetValueImpl(startOffset, endOffset, nameParameter, origin))
result.putValueArgument(1, IrGetValueImpl(startOffset, endOffset, ordinalParameter, origin))
return result
}
@@ -299,8 +299,8 @@ class EnumClassLowering(val context: JvmBackendContext) : ClassLoweringPass {
val result = IrDelegatingConstructorCallImpl(startOffset, endOffset, loweredDelegatedConstructor)
result.putValueArgument(0, IrGetVariableImpl(startOffset, endOffset, enumClassConstructor.valueParameters[0]))
result.putValueArgument(1, IrGetVariableImpl(startOffset, endOffset, enumClassConstructor.valueParameters[1]))
result.putValueArgument(0, IrGetValueImpl(startOffset, endOffset, enumClassConstructor.valueParameters[0]))
result.putValueArgument(1, IrGetValueImpl(startOffset, endOffset, enumClassConstructor.valueParameters[1]))
descriptor.valueParameters.forEach { valueParameter ->
val i = valueParameter.index
@@ -422,10 +422,10 @@ class EnumClassLowering(val context: JvmBackendContext) : ClassLoweringPass {
return expression
}
override fun visitGetVariable(expression: IrGetVariable): IrExpression {
override fun visitGetValue(expression: IrGetValue): IrExpression {
val loweredParameter = loweredEnumConstructorParameters[expression.descriptor]
if (loweredParameter != null) {
return IrGetVariableImpl(expression.startOffset, expression.endOffset, loweredParameter, expression.origin)
return IrGetValueImpl(expression.startOffset, expression.endOffset, loweredParameter, expression.origin)
}
else {
return expression
@@ -452,7 +452,7 @@ class EnumClassLowering(val context: JvmBackendContext) : ClassLoweringPass {
val irValueOfCall = IrCallImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, substitutedValueOf, mapOf(typeParameterT to enumClassType))
irValueOfCall.putValueArgument(
0, IrGetVariableImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, valueOfFunctionDescriptor.valueParameters[0]))
0, IrGetValueImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, valueOfFunctionDescriptor.valueParameters[0]))
return IrBlockBodyImpl(
UNDEFINED_OFFSET, UNDEFINED_OFFSET,
@@ -19,24 +19,25 @@ package org.jetbrains.kotlin.backend.jvm.lower
import org.jetbrains.kotlin.backend.jvm.ClassLoweringPass
import org.jetbrains.kotlin.backend.jvm.JvmBackendContext
import org.jetbrains.kotlin.backend.jvm.JvmLoweredDeclarationOrigin
import org.jetbrains.kotlin.backend.jvm.codegen.getMemberOwnerKind
import org.jetbrains.kotlin.codegen.AsmUtil
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor
import org.jetbrains.kotlin.descriptors.Modality
import org.jetbrains.kotlin.descriptors.SourceElement
import org.jetbrains.kotlin.descriptors.Visibilities
import org.jetbrains.kotlin.descriptors.annotations.Annotations
import org.jetbrains.kotlin.descriptors.impl.SimpleFunctionDescriptorImpl
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.IrStatement
import org.jetbrains.kotlin.ir.declarations.*
import org.jetbrains.kotlin.ir.declarations.IrAnonymousInitializer
import org.jetbrains.kotlin.ir.declarations.IrClass
import org.jetbrains.kotlin.ir.declarations.IrField
import org.jetbrains.kotlin.ir.declarations.impl.IrFunctionImpl
import org.jetbrains.kotlin.ir.expressions.IrBlockBody
import org.jetbrains.kotlin.ir.expressions.IrExpression
import org.jetbrains.kotlin.ir.expressions.IrInstanceInitializerCall
import org.jetbrains.kotlin.ir.expressions.impl.IrBlockBodyImpl
import org.jetbrains.kotlin.ir.expressions.impl.IrBlockImpl
import org.jetbrains.kotlin.ir.expressions.impl.IrGetValueImpl
import org.jetbrains.kotlin.ir.expressions.impl.IrSetFieldImpl
import org.jetbrains.kotlin.ir.expressions.impl.IrThisReferenceImpl
import org.jetbrains.kotlin.ir.util.DeepCopyIrTree
import org.jetbrains.kotlin.ir.util.dump
import org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid
import org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid
import org.jetbrains.kotlin.ir.visitors.acceptChildrenVoid
@@ -71,8 +72,8 @@ class InitializersLowering(val context: JvmBackendContext) : ClassLoweringPass {
val receiver =
if (declaration.descriptor.dispatchReceiverParameter != null) // TODO isStaticField
IrThisReferenceImpl(irFieldInitializer.startOffset, irFieldInitializer.endOffset,
irClass.descriptor.defaultType, irClass.descriptor)
IrGetValueImpl(irFieldInitializer.startOffset, irFieldInitializer.endOffset,
irClass.descriptor.thisAsReceiverParameter)
else null
val irSetField = IrSetFieldImpl(
irFieldInitializer.startOffset, irFieldInitializer.endOffset,
@@ -79,11 +79,11 @@ class InterfaceDelegationLowering(val state: GenerationState) : IrElementTransfo
var shift = 0
if (inheritedFun.dispatchReceiverParameter != null) {
irCallImpl.putValueArgument(0, IrThisReferenceImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, irClass.descriptor.defaultType, irClass.descriptor))
irCallImpl.putValueArgument(0, IrGetValueImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, irClass.descriptor.thisAsReceiverParameter))
shift = 1
}
inheritedFun.valueParameters.mapIndexed { i, valueParameterDescriptor ->
irCallImpl.putValueArgument(i + shift, IrGetVariableImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, valueParameterDescriptor, null))
irCallImpl.putValueArgument(i + shift, IrGetValueImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, valueParameterDescriptor, null))
}
}
@@ -31,8 +31,8 @@ import org.jetbrains.kotlin.ir.declarations.IrVariable
import org.jetbrains.kotlin.ir.declarations.impl.IrClassImpl
import org.jetbrains.kotlin.ir.declarations.impl.IrFunctionImpl
import org.jetbrains.kotlin.ir.expressions.IrExpression
import org.jetbrains.kotlin.ir.expressions.IrGetVariable
import org.jetbrains.kotlin.ir.expressions.impl.IrGetVariableImpl
import org.jetbrains.kotlin.ir.expressions.IrGetValue
import org.jetbrains.kotlin.ir.expressions.impl.IrGetValueImpl
import org.jetbrains.kotlin.ir.util.transform
import org.jetbrains.kotlin.ir.visitors.IrElementTransformer
import org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid
@@ -76,8 +76,8 @@ class InterfaceLowering(val state: GenerationState) : IrElementTransformerVoid()
irClass.transformChildrenVoid(this)
}
override fun visitGetVariable(expression: IrGetVariable): IrExpression {
return super.visitGetVariable(expression)
override fun visitGetValue(expression: IrGetValue): IrExpression {
return super.visitGetValue(expression)
}
companion object {
@@ -118,8 +118,8 @@ class InterfaceLowering(val state: GenerationState) : IrElementTransformerVoid()
class VariableRemapper(val mapping: Map<DeclarationDescriptor, VariableDescriptor>): IrElementTransformerVoid() {
override fun visitGetVariable(expression: IrGetVariable): IrExpression =
override fun visitGetValue(expression: IrGetValue): IrExpression =
mapping[expression.descriptor]?.let { loweredParameter ->
IrGetVariableImpl(expression.startOffset, expression.endOffset, loweredParameter, expression.origin)
IrGetValueImpl(expression.startOffset, expression.endOffset, loweredParameter, expression.origin)
} ?: expression
}
@@ -19,7 +19,7 @@ package org.jetbrains.kotlin.psi2ir
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
import org.jetbrains.kotlin.ir.declarations.IrVariable
import org.jetbrains.kotlin.ir.expressions.*
import org.jetbrains.kotlin.ir.expressions.impl.IrGetVariableImpl
import org.jetbrains.kotlin.ir.expressions.impl.IrGetValueImpl
import org.jetbrains.kotlin.psi2ir.containsNull
import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.types.checker.KotlinTypeChecker
@@ -28,5 +28,5 @@ import org.jetbrains.kotlin.types.typeUtil.makeNotNullable
import org.jetbrains.kotlin.types.upperIfFlexible
fun IrVariable.defaultLoad(): IrExpression =
IrGetVariableImpl(startOffset, endOffset, descriptor)
IrGetValueImpl(startOffset, endOffset, descriptor)
@@ -74,11 +74,11 @@ fun IrBuilderWithScope.irIfThenReturnFalse(condition: IrExpression) =
fun IrBuilderWithScope.irThis() =
scope.classOwner().let { classOwner ->
IrThisReferenceImpl(startOffset, endOffset, classOwner.defaultType, classOwner)
IrGetValueImpl(startOffset, endOffset, classOwner.thisAsReceiverParameter)
}
fun IrBuilderWithScope.irGet(variable: VariableDescriptor) =
IrGetVariableImpl(startOffset, endOffset, variable)
IrGetValueImpl(startOffset, endOffset, variable)
fun IrBuilderWithScope.irSetVar(variable: VariableDescriptor, value: IrExpression) =
IrSetVariableImpl(startOffset, endOffset, variable, value, IrStatementOrigin.EQ)
@@ -43,7 +43,7 @@ fun StatementGenerator.generateReceiver(ktDefaultElement: KtElement, receiver: R
val receiverExpression = when (receiver) {
is ImplicitClassReceiver ->
IrThisReferenceImpl(ktDefaultElement.startOffset, ktDefaultElement.startOffset, receiver.type, receiver.classDescriptor)
IrGetValueImpl(ktDefaultElement.startOffset, ktDefaultElement.startOffset, receiver.classDescriptor.thisAsReceiverParameter)
is ThisClassReceiver ->
generateThisOrSuperReceiver(receiver, receiver.classDescriptor)
is SuperCallReceiverValue ->
@@ -54,8 +54,8 @@ fun StatementGenerator.generateReceiver(ktDefaultElement: KtElement, receiver: R
IrGetObjectValueImpl(receiver.expression.startOffset, receiver.expression.endOffset, receiver.type,
receiver.classQualifier.descriptor)
is ExtensionReceiver ->
IrGetExtensionReceiverImpl(ktDefaultElement.startOffset, ktDefaultElement.startOffset,
receiver.declarationDescriptor.extensionReceiverParameter!!)
IrGetValueImpl(ktDefaultElement.startOffset, ktDefaultElement.startOffset,
receiver.declarationDescriptor.extensionReceiverParameter!!)
else ->
TODO("Receiver: ${receiver.javaClass.simpleName}")
}
@@ -70,7 +70,7 @@ private fun generateThisOrSuperReceiver(receiver: ReceiverValue, classDescriptor
val expressionReceiver = receiver as? ExpressionReceiver ?:
throw AssertionError("'this' or 'super' receiver should be an expression receiver")
val ktReceiver = expressionReceiver.expression
return IrThisReferenceImpl(ktReceiver.startOffset, ktReceiver.endOffset, receiver.type, classDescriptor)
return IrGetValueImpl(ktReceiver.startOffset, ktReceiver.endOffset, classDescriptor.thisAsReceiverParameter)
}
fun StatementGenerator.generateCallReceiver(
@@ -21,7 +21,7 @@ import org.jetbrains.kotlin.descriptors.impl.LocalVariableDescriptor
import org.jetbrains.kotlin.descriptors.impl.SyntheticFieldDescriptor
import org.jetbrains.kotlin.ir.expressions.IrExpression
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
import org.jetbrains.kotlin.ir.expressions.impl.IrThisReferenceImpl
import org.jetbrains.kotlin.ir.expressions.impl.IrGetValueImpl
import org.jetbrains.kotlin.psi.*
import org.jetbrains.kotlin.psi.psiUtil.endOffset
import org.jetbrains.kotlin.psi.psiUtil.startOffset
@@ -139,7 +139,7 @@ class AssignmentGenerator(statementGenerator: StatementGenerator) : StatementGen
): AssignmentReceiver {
if (isValInitializationInConstructor(descriptor, resolvedCall)) {
val thisClass = getThisClass()
val irThis = IrThisReferenceImpl(ktLeft.startOffset, ktLeft.endOffset, thisClass.defaultType, thisClass)
val irThis = IrGetValueImpl(ktLeft.startOffset, ktLeft.endOffset, thisClass.thisAsReceiverParameter)
return BackingFieldLValue(ktLeft.startOffset, ktLeft.endOffset, descriptor,
RematerializableValue(irThis), null)
}
@@ -54,7 +54,7 @@ class CallGenerator(statementGenerator: StatementGenerator): StatementGeneratorE
if (descriptor is LocalVariableDescriptor && descriptor.isDelegated)
IrCallImpl(startOffset, endOffset, descriptor.type, descriptor.getter!!, typeArguments, origin ?: IrStatementOrigin.GET_LOCAL_PROPERTY)
else
IrGetVariableImpl(startOffset, endOffset, descriptor, origin)
IrGetValueImpl(startOffset, endOffset, descriptor, origin)
fun generateDelegatingConstructorCall(startOffset: Int, endOffset: Int, call: CallBuilder) : IrExpression {
val descriptor = call.descriptor
@@ -18,15 +18,19 @@ package org.jetbrains.kotlin.psi2ir.generators
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.ir.declarations.*
import org.jetbrains.kotlin.ir.declarations.IrClass
import org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin
import org.jetbrains.kotlin.ir.declarations.IrEnumEntry
import org.jetbrains.kotlin.ir.declarations.impl.*
import org.jetbrains.kotlin.ir.descriptors.IrImplementingDelegateDescriptorImpl
import org.jetbrains.kotlin.ir.expressions.*
import org.jetbrains.kotlin.ir.expressions.impl.*
import org.jetbrains.kotlin.ir.expressions.impl.IrBlockBodyImpl
import org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl
import org.jetbrains.kotlin.ir.expressions.impl.IrGetValueImpl
import org.jetbrains.kotlin.ir.expressions.impl.IrReturnImpl
import org.jetbrains.kotlin.ir.expressions.mapValueParameters
import org.jetbrains.kotlin.psi.KtClassOrObject
import org.jetbrains.kotlin.psi.KtDelegatedSuperTypeEntry
import org.jetbrains.kotlin.psi.KtEnumEntry
import org.jetbrains.kotlin.psi.KtParameter
import org.jetbrains.kotlin.psi.psiUtil.endOffset
import org.jetbrains.kotlin.psi.psiUtil.startOffset
import org.jetbrains.kotlin.renderer.ClassifierNamePolicy
@@ -164,13 +168,13 @@ class ClassGenerator(val declarationGenerator: DeclarationGenerator) : Generator
val irBlockBody = IrBlockBodyImpl(irDelegate.startOffset, irDelegate.endOffset)
val returnType = overridden.returnType!!
val irCall = IrCallImpl(irDelegate.startOffset, irDelegate.endOffset, returnType, overridden, null)
irCall.dispatchReceiver = IrGetVariableImpl(irDelegate.startOffset, irDelegate.endOffset, irDelegate.descriptor)
irCall.dispatchReceiver = IrGetValueImpl(irDelegate.startOffset, irDelegate.endOffset, irDelegate.descriptor)
irCall.extensionReceiver = delegated.extensionReceiverParameter?.let { extensionReceiver ->
IrGetExtensionReceiverImpl(irDelegate.startOffset, irDelegate.endOffset, extensionReceiver)
IrGetValueImpl(irDelegate.startOffset, irDelegate.endOffset, extensionReceiver)
}
irCall.mapValueParameters { overriddenValueParameter ->
val delegatedValueParameter = delegated.valueParameters[overriddenValueParameter.index]
IrGetVariableImpl(irDelegate.startOffset, irDelegate.endOffset, delegatedValueParameter)
IrGetValueImpl(irDelegate.startOffset, irDelegate.endOffset, delegatedValueParameter)
}
if (KotlinBuiltIns.isUnit(returnType) || KotlinBuiltIns.isNothing(returnType)) {
irBlockBody.statements.add(irCall)
@@ -26,7 +26,7 @@ import org.jetbrains.kotlin.ir.descriptors.IrPropertyDelegateDescriptor
import org.jetbrains.kotlin.ir.descriptors.IrPropertyDelegateDescriptorImpl
import org.jetbrains.kotlin.ir.expressions.*
import org.jetbrains.kotlin.ir.expressions.impl.IrCallableReferenceImpl
import org.jetbrains.kotlin.ir.expressions.impl.IrThisReferenceImpl
import org.jetbrains.kotlin.ir.expressions.impl.IrGetValueImpl
import org.jetbrains.kotlin.psi.KtElement
import org.jetbrains.kotlin.psi.KtProperty
import org.jetbrains.kotlin.psi.KtPropertyDelegate
@@ -82,7 +82,7 @@ class DelegatedPropertyGenerator(override val context: GeneratorContext) : Gener
private fun createBackingFieldValueForDelegate(delegateDescriptor: IrPropertyDelegateDescriptor, ktDelegate: KtPropertyDelegate): IntermediateValue {
val thisClass = delegateDescriptor.correspondingProperty.containingDeclaration as? ClassDescriptor
val thisValue = thisClass?.let {
RematerializableValue(IrThisReferenceImpl(ktDelegate.startOffset, ktDelegate.endOffset, thisClass.defaultType, thisClass))
RematerializableValue(IrGetValueImpl(ktDelegate.startOffset, ktDelegate.endOffset, thisClass.thisAsReceiverParameter))
}
return BackingFieldLValue(ktDelegate.startOffset, ktDelegate.endOffset, delegateDescriptor, thisValue, null)
}
@@ -28,6 +28,7 @@ import org.jetbrains.kotlin.ir.declarations.impl.IrFieldImpl
import org.jetbrains.kotlin.ir.declarations.impl.IrFunctionImpl
import org.jetbrains.kotlin.ir.declarations.impl.IrPropertyImpl
import org.jetbrains.kotlin.ir.expressions.IrBlockBody
import org.jetbrains.kotlin.ir.expressions.IrExpression
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
import org.jetbrains.kotlin.ir.expressions.impl.*
import org.jetbrains.kotlin.psi.KtElement
@@ -37,7 +38,6 @@ import org.jetbrains.kotlin.psi.KtPropertyDelegate
import org.jetbrains.kotlin.psi.psiUtil.endOffset
import org.jetbrains.kotlin.psi.psiUtil.startOffset
import org.jetbrains.kotlin.resolve.BindingContext
import org.jetbrains.kotlin.resolve.DescriptorUtils
class PropertyGenerator(val declarationGenerator: DeclarationGenerator) : Generator {
override val context: GeneratorContext get() = declarationGenerator.context
@@ -58,8 +58,8 @@ class PropertyGenerator(val declarationGenerator: DeclarationGenerator) : Genera
val irProperty = IrPropertyImpl(ktParameter.startOffset, ktParameter.endOffset, IrDeclarationOrigin.DEFINED, false, propertyDescriptor)
val irField = IrFieldImpl(ktParameter.startOffset, ktParameter.endOffset, IrDeclarationOrigin.PROPERTY_BACKING_FIELD, propertyDescriptor)
val irGetParameter = IrGetVariableImpl(ktParameter.startOffset, ktParameter.endOffset,
valueParameterDescriptor, IrStatementOrigin.INITIALIZE_PROPERTY_FROM_PARAMETER)
val irGetParameter = IrGetValueImpl(ktParameter.startOffset, ktParameter.endOffset,
valueParameterDescriptor, IrStatementOrigin.INITIALIZE_PROPERTY_FROM_PARAMETER)
irField.initializer = IrExpressionBodyImpl(ktParameter.startOffset, ktParameter.endOffset, irGetParameter)
irProperty.backingField = irField
@@ -160,16 +160,15 @@ class PropertyGenerator(val declarationGenerator: DeclarationGenerator) : Genera
val setterParameter = setter.valueParameters.single()
irBody.statements.add(IrSetFieldImpl(ktProperty.startOffset, ktProperty.endOffset, property, receiver,
IrGetVariableImpl(ktProperty.startOffset, ktProperty.endOffset, setterParameter)))
IrGetValueImpl(ktProperty.startOffset, ktProperty.endOffset, setterParameter)))
return irBody
}
private fun generateReceiverExpressionForDefaultPropertyAccessor(ktProperty: KtElement, property: PropertyDescriptor): IrThisReferenceImpl? {
private fun generateReceiverExpressionForDefaultPropertyAccessor(ktProperty: KtElement, property: PropertyDescriptor): IrExpression? {
val containingDeclaration = property.containingDeclaration
val receiver =
if (containingDeclaration is ClassDescriptor)
IrThisReferenceImpl(ktProperty.startOffset, ktProperty.endOffset, containingDeclaration.defaultType,
containingDeclaration)
IrGetValueImpl(ktProperty.startOffset, ktProperty.endOffset, containingDeclaration.thisAsReceiverParameter)
else
null
return receiver
@@ -316,14 +316,10 @@ class StatementGenerator(
val referenceTarget = getOrFail(BindingContext.REFERENCE_TARGET, expression.instanceReference) { "No reference target for this" }
return when (referenceTarget) {
is ClassDescriptor ->
IrThisReferenceImpl(
expression.startOffset, expression.endOffset,
referenceTarget.defaultType, // TODO substituted type for 'this'?
referenceTarget
)
IrGetValueImpl(expression.startOffset, expression.endOffset, referenceTarget.thisAsReceiverParameter)
is CallableDescriptor -> {
val extensionReceiver = referenceTarget.extensionReceiverParameter ?: TODO("No extension receiver: $referenceTarget")
IrGetExtensionReceiverImpl(expression.startOffset, expression.endOffset, extensionReceiver)
IrGetValueImpl(expression.startOffset, expression.endOffset, extensionReceiver)
}
else ->
error("Expected this or receiver: $referenceTarget")
@@ -20,7 +20,7 @@ import org.jetbrains.kotlin.descriptors.VariableDescriptor
import org.jetbrains.kotlin.ir.declarations.IrVariable
import org.jetbrains.kotlin.ir.expressions.IrExpression
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
import org.jetbrains.kotlin.ir.expressions.impl.IrGetVariableImpl
import org.jetbrains.kotlin.ir.expressions.impl.IrGetValueImpl
import org.jetbrains.kotlin.ir.expressions.impl.IrSetVariableImpl
import org.jetbrains.kotlin.types.KotlinType
@@ -36,7 +36,7 @@ class VariableLValue(
override val type: KotlinType get() = descriptor.type
override fun load(): IrExpression =
IrGetVariableImpl(startOffset, endOffset, descriptor, origin)
IrGetValueImpl(startOffset, endOffset, descriptor, origin)
override fun store(irExpression: IrExpression): IrExpression =
IrSetVariableImpl(startOffset, endOffset, descriptor, irExpression, origin)
@@ -1,26 +0,0 @@
/*
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.ir.expressions
import org.jetbrains.kotlin.descriptors.ReceiverParameterDescriptor
interface IrGetExtensionReceiver : IrDeclarationReference, IrExpressionWithCopy {
override val descriptor: ReceiverParameterDescriptor
override fun copy(): IrGetExtensionReceiver
}
@@ -1,29 +0,0 @@
/*
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.ir.expressions
import org.jetbrains.kotlin.descriptors.ClassDescriptor
import org.jetbrains.kotlin.descriptors.ReceiverParameterDescriptor
interface IrThisReference : IrExpression, IrExpressionWithCopy {
val classDescriptor: ClassDescriptor
override fun copy(): IrThisReference
}
val IrThisReference.receiverParameter: ReceiverParameterDescriptor
get() = classDescriptor.thisAsReceiverParameter
@@ -16,18 +16,20 @@
package org.jetbrains.kotlin.ir.expressions
import org.jetbrains.kotlin.descriptors.ValueDescriptor
import org.jetbrains.kotlin.descriptors.VariableDescriptor
interface IrVariableAccessExpression : IrDeclarationReference {
override val descriptor: VariableDescriptor
interface IrValueAccessExpression : IrDeclarationReference {
override val descriptor: ValueDescriptor
val origin: IrStatementOrigin?
}
interface IrGetVariable : IrVariableAccessExpression, IrExpressionWithCopy {
override fun copy(): IrGetVariable
interface IrGetValue : IrValueAccessExpression, IrExpressionWithCopy {
override fun copy(): IrGetValue
}
interface IrSetVariable : IrVariableAccessExpression {
interface IrSetVariable : IrValueAccessExpression {
override val descriptor: VariableDescriptor
var value: IrExpression
}
@@ -1,33 +0,0 @@
/*
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.ir.expressions.impl
import org.jetbrains.kotlin.descriptors.ReceiverParameterDescriptor
import org.jetbrains.kotlin.ir.expressions.IrGetExtensionReceiver
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
class IrGetExtensionReceiverImpl(
startOffset: Int,
endOffset: Int,
descriptor: ReceiverParameterDescriptor
) : IrTerminalDeclarationReferenceBase<ReceiverParameterDescriptor>(startOffset, endOffset, descriptor.type, descriptor), IrGetExtensionReceiver {
override fun <R, D> accept(visitor: IrElementVisitor<R, D>, data: D): R =
visitor.visitGetExtensionReceiver(this, data)
override fun copy(): IrGetExtensionReceiver =
IrGetExtensionReceiverImpl(startOffset, endOffset, descriptor)
}
@@ -16,19 +16,18 @@
package org.jetbrains.kotlin.ir.expressions.impl
import org.jetbrains.kotlin.descriptors.VariableDescriptor
import org.jetbrains.kotlin.ir.expressions.IrGetVariable
import org.jetbrains.kotlin.descriptors.ValueDescriptor
import org.jetbrains.kotlin.ir.expressions.IrGetValue
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
import org.jetbrains.kotlin.ir.expressions.impl.IrTerminalDeclarationReferenceBase
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
class IrGetVariableImpl(
startOffset: Int, endOffset: Int, descriptor: VariableDescriptor,
class IrGetValueImpl(
startOffset: Int, endOffset: Int, descriptor: ValueDescriptor,
override val origin: IrStatementOrigin? = null
) : IrTerminalDeclarationReferenceBase<VariableDescriptor>(startOffset, endOffset, descriptor.type, descriptor), IrGetVariable {
) : IrTerminalDeclarationReferenceBase<ValueDescriptor>(startOffset, endOffset, descriptor.type, descriptor), IrGetValue {
override fun <R, D> accept(visitor: IrElementVisitor<R, D>, data: D): R =
visitor.visitGetVariable(this, data)
visitor.visitGetValue(this, data)
override fun copy(): IrGetVariable =
IrGetVariableImpl(startOffset, endOffset, descriptor, origin)
override fun copy(): IrGetValue =
IrGetValueImpl(startOffset, endOffset, descriptor, origin)
}
@@ -1,35 +0,0 @@
/*
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.ir.expressions.impl
import org.jetbrains.kotlin.descriptors.ClassDescriptor
import org.jetbrains.kotlin.ir.expressions.IrThisReference
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
import org.jetbrains.kotlin.types.KotlinType
class IrThisReferenceImpl(
startOffset: Int,
endOffset: Int,
type: KotlinType,
override val classDescriptor: ClassDescriptor
) : IrTerminalExpressionBase(startOffset, endOffset, type), IrThisReference {
override fun <R, D> accept(visitor: IrElementVisitor<R, D>, data: D): R =
visitor.visitThisReference(this, data)
override fun copy(): IrThisReference =
IrThisReferenceImpl(startOffset, endOffset, type, classDescriptor)
}
@@ -48,6 +48,7 @@ open class DeepCopyIrTree : IrElementTransformerVoid() {
protected open fun mapSuperQualifier(qualifier: ClassDescriptor?) = qualifier
protected open fun mapClassReference(descriptor: ClassDescriptor) = descriptor
protected open fun mapValueReference(descriptor: ValueDescriptor) = descriptor
protected open fun mapVariableReference(descriptor: VariableDescriptor) = descriptor
protected open fun mapPropertyReference(descriptor: PropertyDescriptor) = descriptor
protected open fun mapReceiverParameterReference(descriptor: ReceiverParameterDescriptor) = descriptor
@@ -234,13 +235,6 @@ open class DeepCopyIrTree : IrElementTransformerVoid() {
expression.arguments.map { it.transform(this, null) }
)
override fun visitThisReference(expression: IrThisReference): IrThisReference =
IrThisReferenceImpl(
expression.startOffset, expression.endOffset,
expression.type,
mapClassReference(expression.classDescriptor)
)
override fun visitGetObjectValue(expression: IrGetObjectValue): IrGetObjectValue =
IrGetObjectValueImpl(
expression.startOffset, expression.endOffset,
@@ -255,10 +249,10 @@ open class DeepCopyIrTree : IrElementTransformerVoid() {
mapClassReference(expression.descriptor)
)
override fun visitGetVariable(expression: IrGetVariable): IrGetVariable =
IrGetVariableImpl(
override fun visitGetValue(expression: IrGetValue): IrGetValue =
IrGetValueImpl(
expression.startOffset, expression.endOffset,
mapVariableReference(expression.descriptor),
mapValueReference(expression.descriptor),
mapStatementOrigin(expression.origin)
)
@@ -289,12 +283,6 @@ open class DeepCopyIrTree : IrElementTransformerVoid() {
mapSuperQualifier(expression.superQualifier)
)
override fun visitGetExtensionReceiver(expression: IrGetExtensionReceiver): IrGetExtensionReceiver =
IrGetExtensionReceiverImpl(
expression.startOffset, expression.endOffset,
mapReceiverParameterReference(expression.descriptor)
)
override fun visitCall(expression: IrCall): IrCall =
shallowCopyCall(expression).transformValueArguments(expression)
@@ -17,6 +17,7 @@
package org.jetbrains.kotlin.ir.util
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
import org.jetbrains.kotlin.descriptors.ReceiverParameterDescriptor
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.declarations.*
import org.jetbrains.kotlin.ir.expressions.*
@@ -102,12 +103,6 @@ class RenderIrElementVisitor : IrElementVisitor<String, Nothing?> {
override fun visitReturn(expression: IrReturn, data: Nothing?): String =
"RETURN type=${expression.type.render()} from='${expression.returnTarget.ref()}'"
override fun visitGetExtensionReceiver(expression: IrGetExtensionReceiver, data: Nothing?): String =
"\$RECEIVER of '${expression.descriptor.containingDeclaration.ref()}' type=${expression.type.render()}"
override fun visitThisReference(expression: IrThisReference, data: Nothing?): String =
"THIS of '${expression.classDescriptor.ref()}' type=${expression.type.render()}"
override fun visitCall(expression: IrCall, data: Nothing?): String =
"CALL '${expression.descriptor.ref()}' ${expression.renderSuperQualifier()}" +
"type=${expression.type.render()} origin=${expression.origin}"
@@ -124,7 +119,7 @@ class RenderIrElementVisitor : IrElementVisitor<String, Nothing?> {
override fun visitInstanceInitializerCall(expression: IrInstanceInitializerCall, data: Nothing?): String =
"INSTANCE_INITIALIZER_CALL classDescriptor='${expression.classDescriptor.ref()}'"
override fun visitGetVariable(expression: IrGetVariable, data: Nothing?): String =
override fun visitGetValue(expression: IrGetValue, data: Nothing?): String =
"GET_VAR '${expression.descriptor.ref()}' type=${expression.type.render()} origin=${expression.origin}"
override fun visitSetVariable(expression: IrSetVariable, data: Nothing?): String =
@@ -212,7 +207,10 @@ class RenderIrElementVisitor : IrElementVisitor<String, Nothing?> {
DECLARATION_RENDERER.render(this.descriptor)
internal fun DeclarationDescriptor.ref(): String =
REFERENCE_RENDERER.render(this)
if (this is ReceiverParameterDescriptor)
"<receiver: ${containingDeclaration.ref()}>"
else
REFERENCE_RENDERER.render(this)
internal fun KotlinType.render(): String =
DECLARATION_RENDERER.renderType(this)
@@ -65,19 +65,17 @@ interface IrElementTransformer<in D> : IrElementVisitor<IrElement, D> {
override fun visitBlock(expression: IrBlock, data: D) = visitContainerExpression(expression, data)
override fun visitComposite(expression: IrComposite, data: D) = visitContainerExpression(expression, data)
override fun visitStringConcatenation(expression: IrStringConcatenation, data: D) = visitExpression(expression, data)
override fun visitThisReference(expression: IrThisReference, data: D) = visitExpression(expression, data)
override fun visitDeclarationReference(expression: IrDeclarationReference, data: D) = visitExpression(expression, data)
override fun visitSingletonReference(expression: IrGetSingletonValue, data: D) = visitDeclarationReference(expression, data)
override fun visitGetObjectValue(expression: IrGetObjectValue, data: D) = visitSingletonReference(expression, data)
override fun visitGetEnumValue(expression: IrGetEnumValue, data: D) = visitSingletonReference(expression, data)
override fun visitVariableAccess(expression: IrVariableAccessExpression, data: D) = visitDeclarationReference(expression, data)
override fun visitGetVariable(expression: IrGetVariable, data: D) = visitVariableAccess(expression, data)
override fun visitSetVariable(expression: IrSetVariable, data: D) = visitVariableAccess(expression, data)
override fun visitValueAccess(expression: IrValueAccessExpression, data: D) = visitDeclarationReference(expression, data)
override fun visitGetValue(expression: IrGetValue, data: D) = visitValueAccess(expression, data)
override fun visitSetVariable(expression: IrSetVariable, data: D) = visitValueAccess(expression, data)
override fun visitFieldAccess(expression: IrFieldAccessExpression, data: D) = visitDeclarationReference(expression, data)
override fun visitGetField(expression: IrGetField, data: D) = visitFieldAccess(expression, data)
override fun visitSetField(expression: IrSetField, data: D) = visitFieldAccess(expression, data)
override fun visitGetExtensionReceiver(expression: IrGetExtensionReceiver, data: D) = visitDeclarationReference(expression, data)
override fun visitMemberAccess(expression: IrMemberAccessExpression, data: D): IrElement = visitDeclarationReference(expression, data)
override fun visitCall(expression: IrCall, data: D) = visitMemberAccess(expression, data)
override fun visitDelegatingConstructorCall(expression: IrDelegatingConstructorCall, data: D) = visitMemberAccess(expression, data)
@@ -101,9 +101,6 @@ abstract class IrElementTransformerVoid : IrElementTransformer<Nothing?> {
open fun visitStringConcatenation(expression: IrStringConcatenation) = visitExpression(expression)
override final fun visitStringConcatenation(expression: IrStringConcatenation, data: Nothing?) = visitStringConcatenation(expression)
open fun visitThisReference(expression: IrThisReference) = visitExpression(expression)
override final fun visitThisReference(expression: IrThisReference, data: Nothing?) = visitThisReference(expression)
open fun visitDeclarationReference(expression: IrDeclarationReference) = visitExpression(expression)
override final fun visitDeclarationReference(expression: IrDeclarationReference, data: Nothing?) = visitDeclarationReference(expression)
@@ -116,13 +113,13 @@ abstract class IrElementTransformerVoid : IrElementTransformer<Nothing?> {
open fun visitGetEnumValue(expression: IrGetEnumValue) = visitSingletonReference(expression)
override final fun visitGetEnumValue(expression: IrGetEnumValue, data: Nothing?) = visitGetEnumValue(expression)
open fun visitVariableAccess(expression: IrVariableAccessExpression) = visitDeclarationReference(expression)
override final fun visitVariableAccess(expression: IrVariableAccessExpression, data: Nothing?) = visitVariableAccess(expression)
open fun visitValueAccess(expression: IrValueAccessExpression) = visitDeclarationReference(expression)
override final fun visitValueAccess(expression: IrValueAccessExpression, data: Nothing?) = visitValueAccess(expression)
open fun visitGetVariable(expression: IrGetVariable) = visitVariableAccess(expression)
override final fun visitGetVariable(expression: IrGetVariable, data: Nothing?) = visitGetVariable(expression)
open fun visitGetValue(expression: IrGetValue) = visitValueAccess(expression)
override final fun visitGetValue(expression: IrGetValue, data: Nothing?) = visitGetValue(expression)
open fun visitSetVariable(expression: IrSetVariable) = visitVariableAccess(expression)
open fun visitSetVariable(expression: IrSetVariable) = visitValueAccess(expression)
override final fun visitSetVariable(expression: IrSetVariable, data: Nothing?) = visitSetVariable(expression)
open fun visitFieldAccess(expression: IrFieldAccessExpression) = visitDeclarationReference(expression)
@@ -134,9 +131,6 @@ abstract class IrElementTransformerVoid : IrElementTransformer<Nothing?> {
open fun visitSetField(expression: IrSetField) = visitFieldAccess(expression)
override final fun visitSetField(expression: IrSetField, data: Nothing?) = visitSetField(expression)
open fun visitGetExtensionReceiver(expression: IrGetExtensionReceiver) = visitDeclarationReference(expression)
override final fun visitGetExtensionReceiver(expression: IrGetExtensionReceiver, data: Nothing?) = visitGetExtensionReceiver(expression)
open fun visitMemberAccess(expression: IrMemberAccessExpression) = visitDeclarationReference(expression)
override final fun visitMemberAccess(expression: IrMemberAccessExpression, data: Nothing?) = visitMemberAccess(expression)
@@ -51,19 +51,17 @@ interface IrElementVisitor<out R, in D> {
fun visitBlock(expression: IrBlock, data: D) = visitContainerExpression(expression, data)
fun visitComposite(expression: IrComposite, data: D) = visitContainerExpression(expression, data)
fun visitStringConcatenation(expression: IrStringConcatenation, data: D) = visitExpression(expression, data)
fun visitThisReference(expression: IrThisReference, data: D) = visitExpression(expression, data)
fun visitDeclarationReference(expression: IrDeclarationReference, data: D) = visitExpression(expression, data)
fun visitSingletonReference(expression: IrGetSingletonValue, data: D) = visitDeclarationReference(expression, data)
fun visitGetObjectValue(expression: IrGetObjectValue, data: D) = visitSingletonReference(expression, data)
fun visitGetEnumValue(expression: IrGetEnumValue, data: D) = visitSingletonReference(expression, data)
fun visitVariableAccess(expression: IrVariableAccessExpression, data: D) = visitDeclarationReference(expression, data)
fun visitGetVariable(expression: IrGetVariable, data: D) = visitVariableAccess(expression, data)
fun visitSetVariable(expression: IrSetVariable, data: D) = visitVariableAccess(expression, data)
fun visitValueAccess(expression: IrValueAccessExpression, data: D) = visitDeclarationReference(expression, data)
fun visitGetValue(expression: IrGetValue, data: D) = visitValueAccess(expression, data)
fun visitSetVariable(expression: IrSetVariable, data: D) = visitValueAccess(expression, data)
fun visitFieldAccess(expression: IrFieldAccessExpression, data: D) = visitDeclarationReference(expression, data)
fun visitGetField(expression: IrGetField, data: D) = visitFieldAccess(expression, data)
fun visitSetField(expression: IrSetField, data: D) = visitFieldAccess(expression, data)
fun visitGetExtensionReceiver(expression: IrGetExtensionReceiver, data: D) = visitDeclarationReference(expression, data)
fun visitMemberAccess(expression: IrMemberAccessExpression, data: D) = visitDeclarationReference(expression, data)
fun visitCall(expression: IrCall, data: D) = visitMemberAccess(expression, data)
fun visitDelegatingConstructorCall(expression: IrDelegatingConstructorCall, data: D) = visitMemberAccess(expression, data)
@@ -99,9 +99,6 @@ interface IrElementVisitorVoid : IrElementVisitor<Unit, Nothing?> {
fun visitStringConcatenation(expression: IrStringConcatenation) = visitExpression(expression)
override fun visitStringConcatenation(expression: IrStringConcatenation, data: Nothing?) = visitStringConcatenation(expression)
fun visitThisReference(expression: IrThisReference) = visitExpression(expression)
override fun visitThisReference(expression: IrThisReference, data: Nothing?) = visitThisReference(expression)
fun visitDeclarationReference(expression: IrDeclarationReference) = visitExpression(expression)
override fun visitDeclarationReference(expression: IrDeclarationReference, data: Nothing?) = visitDeclarationReference(expression)
@@ -114,11 +111,11 @@ interface IrElementVisitorVoid : IrElementVisitor<Unit, Nothing?> {
fun visitGetEnumValue(expression: IrGetEnumValue) = visitSingletonReference(expression)
override fun visitGetEnumValue(expression: IrGetEnumValue, data: Nothing?) = visitGetEnumValue(expression)
fun visitVariableAccess(expression: IrVariableAccessExpression) = visitDeclarationReference(expression)
override fun visitVariableAccess(expression: IrVariableAccessExpression, data: Nothing?) = visitVariableAccess(expression)
fun visitVariableAccess(expression: IrValueAccessExpression) = visitDeclarationReference(expression)
override fun visitValueAccess(expression: IrValueAccessExpression, data: Nothing?) = visitVariableAccess(expression)
fun visitGetVariable(expression: IrGetVariable) = visitVariableAccess(expression)
override fun visitGetVariable(expression: IrGetVariable, data: Nothing?) = visitGetVariable(expression)
fun visitGetVariable(expression: IrGetValue) = visitVariableAccess(expression)
override fun visitGetValue(expression: IrGetValue, data: Nothing?) = visitGetVariable(expression)
fun visitSetVariable(expression: IrSetVariable) = visitVariableAccess(expression)
override fun visitSetVariable(expression: IrSetVariable, data: Nothing?) = visitSetVariable(expression)
@@ -132,9 +129,6 @@ interface IrElementVisitorVoid : IrElementVisitor<Unit, Nothing?> {
fun visitSetField(expression: IrSetField) = visitFieldAccess(expression)
override fun visitSetField(expression: IrSetField, data: Nothing?) = visitSetField(expression)
fun visitGetExtensionReceiver(expression: IrGetExtensionReceiver) = visitDeclarationReference(expression)
override fun visitGetExtensionReceiver(expression: IrGetExtensionReceiver, data: Nothing?) = visitGetExtensionReceiver(expression)
fun visitMemberAccess(expression: IrMemberAccessExpression) = visitDeclarationReference(expression)
override fun visitMemberAccess(expression: IrMemberAccessExpression, data: Nothing?) = visitMemberAccess(expression)
+3
View File
@@ -0,0 +1,3 @@
class Test(val ok: String)
fun box() = Test("OK").ok
@@ -12,7 +12,7 @@ FILE /argumentReorderingInDelegatingConstructorCall.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
GET_FIELD 'x: Int' type=kotlin.Int origin=null
receiver: THIS of 'Base' type=Base
receiver: GET_VAR '<receiver: Base>' type=Base origin=null
PROPERTY public final val y: kotlin.Int
FIELD PROPERTY_BACKING_FIELD public final val y: kotlin.Int
EXPRESSION_BODY
@@ -21,7 +21,7 @@ FILE /argumentReorderingInDelegatingConstructorCall.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-y>(): Int'
GET_FIELD 'y: Int' type=kotlin.Int origin=null
receiver: THIS of 'Base' type=Base
receiver: GET_VAR '<receiver: Base>' type=Base origin=null
CLASS CLASS Test1
CONSTRUCTOR public constructor Test1(xx: kotlin.Int, yy: kotlin.Int)
BLOCK_BODY
+7 -7
View File
@@ -14,7 +14,7 @@ FILE /classMembers.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-y>(): Int'
GET_FIELD 'y: Int' type=kotlin.Int origin=null
receiver: THIS of 'C' type=C
receiver: GET_VAR '<receiver: C>' type=C origin=null
PROPERTY public final var z: kotlin.Int
FIELD PROPERTY_BACKING_FIELD public final var z: kotlin.Int
EXPRESSION_BODY
@@ -23,11 +23,11 @@ FILE /classMembers.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-z>(): Int'
GET_FIELD 'z: Int' type=kotlin.Int origin=null
receiver: THIS of 'C' type=C
receiver: GET_VAR '<receiver: C>' type=C origin=null
FUN DEFAULT_PROPERTY_ACCESSOR public final fun <set-z>(<set-?>: kotlin.Int): kotlin.Unit
BLOCK_BODY
SET_FIELD 'z: Int' type=kotlin.Unit origin=null
receiver: THIS of 'C' type=C
receiver: GET_VAR '<receiver: C>' type=C origin=null
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int origin=null
CONSTRUCTOR public constructor C()
BLOCK_BODY
@@ -43,7 +43,7 @@ FILE /classMembers.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-property>(): Int'
GET_FIELD 'property: Int' type=kotlin.Int origin=null
receiver: THIS of 'C' type=C
receiver: GET_VAR '<receiver: C>' type=C origin=null
PROPERTY public final val propertyWithGet: kotlin.Int
FUN public final fun <get-propertyWithGet>(): kotlin.Int
BLOCK_BODY
@@ -54,11 +54,11 @@ FILE /classMembers.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-propertyWithGetAndSet>(): Int'
CALL '<get-z>(): Int' type=kotlin.Int origin=GET_PROPERTY
$this: THIS of 'C' type=C
$this: GET_VAR '<receiver: C>' type=C origin=null
FUN public final fun <set-propertyWithGetAndSet>(value: kotlin.Int): kotlin.Unit
BLOCK_BODY
CALL '<set-z>(Int): Unit' type=kotlin.Unit origin=EQ
$this: THIS of 'C' type=C
$this: GET_VAR '<receiver: C>' type=C origin=null
<set-?>: GET_VAR 'value-parameter value: Int' type=kotlin.Int origin=null
FUN public final fun function(): kotlin.Unit
BLOCK_BODY
@@ -87,7 +87,7 @@ FILE /classMembers.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='bar(): Unit'
CALL 'foo(): Unit' type=kotlin.Unit origin=null
$this: THIS of 'NestedInterface' type=C.NestedInterface
$this: GET_VAR '<receiver: NestedInterface>' type=C.NestedInterface origin=null
CLASS OBJECT companion object of C
CONSTRUCTOR private constructor Companion()
BLOCK_BODY
+16 -16
View File
@@ -12,7 +12,7 @@ FILE /dataClasses.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
GET_FIELD 'x: Int' type=kotlin.Int origin=null
receiver: THIS of 'Test1' type=Test1
receiver: GET_VAR '<receiver: Test1>' type=Test1 origin=null
PROPERTY public final val y: kotlin.String
FIELD PROPERTY_BACKING_FIELD public final val y: kotlin.String
EXPRESSION_BODY
@@ -21,7 +21,7 @@ FILE /dataClasses.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-y>(): String'
GET_FIELD 'y: String' type=kotlin.String origin=null
receiver: THIS of 'Test1' type=Test1
receiver: GET_VAR '<receiver: Test1>' type=Test1 origin=null
PROPERTY public final val z: kotlin.Any
FIELD PROPERTY_BACKING_FIELD public final val z: kotlin.Any
EXPRESSION_BODY
@@ -30,22 +30,22 @@ FILE /dataClasses.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-z>(): Any'
GET_FIELD 'z: Any' type=kotlin.Any origin=null
receiver: THIS of 'Test1' type=Test1
receiver: GET_VAR '<receiver: Test1>' type=Test1 origin=null
FUN GENERATED_DATA_CLASS_MEMBER public final operator fun component1(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='component1(): Int'
CALL '<get-x>(): Int' type=kotlin.Int origin=GET_PROPERTY
$this: THIS of 'Test1' type=Test1
$this: GET_VAR '<receiver: Test1>' type=Test1 origin=null
FUN GENERATED_DATA_CLASS_MEMBER public final operator fun component2(): kotlin.String
BLOCK_BODY
RETURN type=kotlin.Nothing from='component2(): String'
CALL '<get-y>(): String' type=kotlin.String origin=GET_PROPERTY
$this: THIS of 'Test1' type=Test1
$this: GET_VAR '<receiver: Test1>' type=Test1 origin=null
FUN GENERATED_DATA_CLASS_MEMBER public final operator fun component3(): kotlin.Any
BLOCK_BODY
RETURN type=kotlin.Nothing from='component3(): Any'
CALL '<get-z>(): Any' type=kotlin.Any origin=GET_PROPERTY
$this: THIS of 'Test1' type=Test1
$this: GET_VAR '<receiver: Test1>' type=Test1 origin=null
FUN GENERATED_DATA_CLASS_MEMBER public final fun copy(x: kotlin.Int = ..., y: kotlin.String = ..., z: kotlin.Any = ...): Test1
BLOCK_BODY
RETURN type=kotlin.Nothing from='copy(Int = ..., String = ..., Any = ...): Test1'
@@ -60,15 +60,15 @@ FILE /dataClasses.kt
CONST String type=kotlin.String value='Test1('
CONST String type=kotlin.String value='x='
CALL '<get-x>(): Int' type=kotlin.Int origin=GET_PROPERTY
$this: THIS of 'Test1' type=Test1
$this: GET_VAR '<receiver: Test1>' type=Test1 origin=null
CONST String type=kotlin.String value=', '
CONST String type=kotlin.String value='y='
CALL '<get-y>(): String' type=kotlin.String origin=GET_PROPERTY
$this: THIS of 'Test1' type=Test1
$this: GET_VAR '<receiver: Test1>' type=Test1 origin=null
CONST String type=kotlin.String value=', '
CONST String type=kotlin.String value='z='
CALL '<get-z>(): Any' type=kotlin.Any origin=GET_PROPERTY
$this: THIS of 'Test1' type=Test1
$this: GET_VAR '<receiver: Test1>' type=Test1 origin=null
CONST String type=kotlin.String value=')'
FUN GENERATED_DATA_CLASS_MEMBER public open override fun hashCode(): kotlin.Int
BLOCK_BODY
@@ -77,7 +77,7 @@ FILE /dataClasses.kt
SET_VAR 'tmp0_result: Int' type=kotlin.Unit origin=EQ
CALL 'hashCode(): Int' type=kotlin.Int origin=null
$this: CALL '<get-x>(): Int' type=kotlin.Int origin=GET_PROPERTY
$this: THIS of 'Test1' type=Test1
$this: GET_VAR '<receiver: Test1>' type=Test1 origin=null
SET_VAR 'tmp0_result: Int' type=kotlin.Unit origin=EQ
CALL 'plus(Int): Int' type=kotlin.Int origin=null
$this: CALL 'times(Int): Int' type=kotlin.Int origin=null
@@ -85,7 +85,7 @@ FILE /dataClasses.kt
other: CONST Int type=kotlin.Int value='31'
other: CALL 'hashCode(): Int' type=kotlin.Int origin=null
$this: CALL '<get-y>(): String' type=kotlin.String origin=GET_PROPERTY
$this: THIS of 'Test1' type=Test1
$this: GET_VAR '<receiver: Test1>' type=Test1 origin=null
SET_VAR 'tmp0_result: Int' type=kotlin.Unit origin=EQ
CALL 'plus(Int): Int' type=kotlin.Int origin=null
$this: CALL 'times(Int): Int' type=kotlin.Int origin=null
@@ -93,7 +93,7 @@ FILE /dataClasses.kt
other: CONST Int type=kotlin.Int value='31'
other: CALL 'hashCode(): Int' type=kotlin.Int origin=null
$this: CALL '<get-z>(): Any' type=kotlin.Any origin=GET_PROPERTY
$this: THIS of 'Test1' type=Test1
$this: GET_VAR '<receiver: Test1>' type=Test1 origin=null
RETURN type=kotlin.Nothing from='hashCode(): Int'
GET_VAR 'tmp0_result: Int' type=kotlin.Int origin=null
FUN GENERATED_DATA_CLASS_MEMBER public open override fun equals(other: kotlin.Any?): kotlin.Boolean
@@ -101,7 +101,7 @@ FILE /dataClasses.kt
WHEN type=kotlin.Unit origin=null
BRANCH
if: CALL 'EQEQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQEQ
arg0: THIS of 'Test1' type=Test1
arg0: GET_VAR '<receiver: Test1>' type=Test1 origin=null
arg1: GET_VAR 'value-parameter other: Any?' type=kotlin.Any? origin=null
then: RETURN type=kotlin.Nothing from='equals(Any?): Boolean'
CONST Boolean type=kotlin.Boolean value='true'
@@ -119,7 +119,7 @@ FILE /dataClasses.kt
if: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: CALL '<get-x>(): Int' type=kotlin.Int origin=GET_PROPERTY
$this: THIS of 'Test1' type=Test1
$this: GET_VAR '<receiver: Test1>' type=Test1 origin=null
arg1: CALL '<get-x>(): Int' type=kotlin.Int origin=GET_PROPERTY
$this: GET_VAR 'tmp0_other_with_cast: Test1' type=Test1 origin=null
then: RETURN type=kotlin.Nothing from='equals(Any?): Boolean'
@@ -129,7 +129,7 @@ FILE /dataClasses.kt
if: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: CALL '<get-y>(): String' type=kotlin.String origin=GET_PROPERTY
$this: THIS of 'Test1' type=Test1
$this: GET_VAR '<receiver: Test1>' type=Test1 origin=null
arg1: CALL '<get-y>(): String' type=kotlin.String origin=GET_PROPERTY
$this: GET_VAR 'tmp0_other_with_cast: Test1' type=Test1 origin=null
then: RETURN type=kotlin.Nothing from='equals(Any?): Boolean'
@@ -139,7 +139,7 @@ FILE /dataClasses.kt
if: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: CALL '<get-z>(): Any' type=kotlin.Any origin=GET_PROPERTY
$this: THIS of 'Test1' type=Test1
$this: GET_VAR '<receiver: Test1>' type=Test1 origin=null
arg1: CALL '<get-z>(): Any' type=kotlin.Any origin=GET_PROPERTY
$this: GET_VAR 'tmp0_other_with_cast: Test1' type=Test1 origin=null
then: RETURN type=kotlin.Nothing from='equals(Any?): Boolean'
@@ -22,34 +22,34 @@ FILE /delegatedImplementation.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): String'
GET_FIELD 'x: String' type=kotlin.String origin=null
receiver: THIS of 'IOther' type=IOther
receiver: GET_VAR '<receiver: IOther>' type=IOther origin=null
PROPERTY public abstract var y: kotlin.Int
FUN DEFAULT_PROPERTY_ACCESSOR public abstract fun <get-y>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-y>(): Int'
GET_FIELD 'y: Int' type=kotlin.Int origin=null
receiver: THIS of 'IOther' type=IOther
receiver: GET_VAR '<receiver: IOther>' type=IOther origin=null
FUN DEFAULT_PROPERTY_ACCESSOR public abstract fun <set-y>(<set-?>: kotlin.Int): kotlin.Unit
BLOCK_BODY
SET_FIELD 'y: Int' type=kotlin.Unit origin=null
receiver: THIS of 'IOther' type=IOther
receiver: GET_VAR '<receiver: IOther>' type=IOther origin=null
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int origin=null
PROPERTY public abstract val kotlin.Byte.z1: kotlin.Int
FUN DEFAULT_PROPERTY_ACCESSOR public abstract fun kotlin.Byte.<get-z1>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-z1>() on Byte: Int'
GET_FIELD 'z1: Int on Byte' type=kotlin.Int origin=null
receiver: THIS of 'IOther' type=IOther
receiver: GET_VAR '<receiver: IOther>' type=IOther origin=null
PROPERTY public abstract var kotlin.Byte.z2: kotlin.Int
FUN DEFAULT_PROPERTY_ACCESSOR public abstract fun kotlin.Byte.<get-z2>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-z2>() on Byte: Int'
GET_FIELD 'z2: Int on Byte' type=kotlin.Int origin=null
receiver: THIS of 'IOther' type=IOther
receiver: GET_VAR '<receiver: IOther>' type=IOther origin=null
FUN DEFAULT_PROPERTY_ACCESSOR public abstract fun kotlin.Byte.<set-z2>(<set-?>: kotlin.Int): kotlin.Unit
BLOCK_BODY
SET_FIELD 'z2: Int on Byte' type=kotlin.Unit origin=null
receiver: THIS of 'IOther' type=IOther
receiver: GET_VAR '<receiver: IOther>' type=IOther origin=null
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int origin=null
FUN public fun otherImpl(x0: kotlin.String, y0: kotlin.Int): IOther
BLOCK_BODY
@@ -68,7 +68,7 @@ FILE /delegatedImplementation.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): String'
GET_FIELD 'x: String' type=kotlin.String origin=null
receiver: THIS of '<no name provided>' type=otherImpl.<no name provided>
receiver: GET_VAR '<receiver: <no name provided>>' type=otherImpl.<no name provided> origin=null
PROPERTY public open override var y: kotlin.Int
FIELD PROPERTY_BACKING_FIELD public open override var y: kotlin.Int
EXPRESSION_BODY
@@ -77,11 +77,11 @@ FILE /delegatedImplementation.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-y>(): Int'
GET_FIELD 'y: Int' type=kotlin.Int origin=null
receiver: THIS of '<no name provided>' type=otherImpl.<no name provided>
receiver: GET_VAR '<receiver: <no name provided>>' type=otherImpl.<no name provided> origin=null
FUN DEFAULT_PROPERTY_ACCESSOR public open override fun <set-y>(<set-?>: kotlin.Int): kotlin.Unit
BLOCK_BODY
SET_FIELD 'y: Int' type=kotlin.Unit origin=null
receiver: THIS of '<no name provided>' type=otherImpl.<no name provided>
receiver: GET_VAR '<receiver: <no name provided>>' type=otherImpl.<no name provided> origin=null
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int origin=null
PROPERTY public open override val kotlin.Byte.z1: kotlin.Int
FUN public open override fun kotlin.Byte.<get-z1>(): kotlin.Int
@@ -119,7 +119,7 @@ FILE /delegatedImplementation.kt
BLOCK_BODY
CALL 'qux() on String: Unit' type=kotlin.Unit origin=null
$this: GET_VAR '`Test1$IBase$delegate`: BaseImpl' type=BaseImpl origin=null
$receiver: $RECEIVER of 'qux() on String: Unit' type=kotlin.String
$receiver: GET_VAR '<receiver: qux() on String: Unit>' type=kotlin.String origin=null
CLASS CLASS Test2
CONSTRUCTOR public constructor Test2()
BLOCK_BODY
@@ -143,7 +143,7 @@ FILE /delegatedImplementation.kt
BLOCK_BODY
CALL 'qux() on String: Unit' type=kotlin.Unit origin=null
$this: GET_VAR '`Test2$IBase$delegate`: BaseImpl' type=BaseImpl origin=null
$receiver: $RECEIVER of 'qux() on String: Unit' type=kotlin.String
$receiver: GET_VAR '<receiver: qux() on String: Unit>' type=kotlin.String origin=null
FIELD DELEGATE val `Test2$IOther$delegate`: IOther
EXPRESSION_BODY
CALL 'otherImpl(String, Int): IOther' type=IOther origin=null
@@ -155,7 +155,7 @@ FILE /delegatedImplementation.kt
RETURN type=kotlin.Nothing from='<get-z1>() on Byte: Int'
CALL '<get-z1>() on Byte: Int' type=kotlin.Int origin=null
$this: GET_VAR '`Test2$IOther$delegate`: IOther' type=IOther origin=null
$receiver: $RECEIVER of 'z1: Int on Byte' type=kotlin.Byte
$receiver: GET_VAR '<receiver: z1: Int on Byte>' type=kotlin.Byte origin=null
PROPERTY DELEGATED_MEMBER public open override val x: kotlin.String
FUN DELEGATED_MEMBER public open override fun <get-x>(): kotlin.String
BLOCK_BODY
@@ -168,12 +168,12 @@ FILE /delegatedImplementation.kt
RETURN type=kotlin.Nothing from='<get-z2>() on Byte: Int'
CALL '<get-z2>() on Byte: Int' type=kotlin.Int origin=null
$this: GET_VAR '`Test2$IOther$delegate`: IOther' type=IOther origin=null
$receiver: $RECEIVER of 'z2: Int on Byte' type=kotlin.Byte
$receiver: GET_VAR '<receiver: z2: Int on Byte>' type=kotlin.Byte origin=null
FUN DELEGATED_MEMBER public open override fun kotlin.Byte.<set-z2>(<set-?>: kotlin.Int): kotlin.Unit
BLOCK_BODY
CALL '<set-z2>(Int) on Byte: Unit' type=kotlin.Unit origin=null
$this: GET_VAR '`Test2$IOther$delegate`: IOther' type=IOther origin=null
$receiver: $RECEIVER of 'z2: Int on Byte' type=kotlin.Byte
$receiver: GET_VAR '<receiver: z2: Int on Byte>' type=kotlin.Byte origin=null
<set-?>: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int origin=null
PROPERTY DELEGATED_MEMBER public open override var y: kotlin.Int
FUN DELEGATED_MEMBER public open override fun <get-y>(): kotlin.Int
+5 -5
View File
@@ -25,7 +25,7 @@ FILE /enum.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
GET_FIELD 'x: Int' type=kotlin.Int origin=null
receiver: THIS of 'TestEnum2' type=TestEnum2
receiver: GET_VAR '<receiver: TestEnum2>' type=TestEnum2 origin=null
ENUM_ENTRY enum entry TEST1
init: ENUM_CONSTRUCTOR_CALL 'constructor TestEnum2(Int)'
x: CONST Int type=kotlin.Int value='1'
@@ -73,7 +73,7 @@ FILE /enum.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
GET_FIELD 'x: Int' type=kotlin.Int origin=null
receiver: THIS of 'TestEnum4' type=TestEnum4
receiver: GET_VAR '<receiver: TestEnum4>' type=TestEnum4 origin=null
ENUM_ENTRY enum entry TEST1
init: ENUM_CONSTRUCTOR_CALL 'constructor TEST1()'
class: CLASS ENUM_ENTRY TEST1
@@ -100,13 +100,13 @@ FILE /enum.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-z>(): Int'
GET_FIELD 'z: Int' type=kotlin.Int origin=null
receiver: THIS of 'TEST2' type=TestEnum4.TEST2
receiver: GET_VAR '<receiver: TEST2>' type=TestEnum4.TEST2 origin=null
ANONYMOUS_INITIALIZER TEST2
BLOCK_BODY
SET_FIELD 'z: Int' type=kotlin.Unit origin=null
receiver: THIS of 'TEST2' type=TestEnum4.TEST2
receiver: GET_VAR '<receiver: TEST2>' type=TestEnum4.TEST2 origin=null
value: CALL '<get-x>(): Int' type=kotlin.Int origin=GET_PROPERTY
$this: THIS of 'TEST2' type=TestEnum4.TEST2
$this: GET_VAR '<receiver: TEST2>' type=TestEnum4.TEST2 origin=null
FUN public open override fun foo(): kotlin.Unit
BLOCK_BODY
CALL 'println(Any?): Unit' type=kotlin.Unit origin=null
@@ -12,7 +12,7 @@ FILE /enumWithSecondaryCtor.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
GET_FIELD 'x: Int' type=kotlin.Int origin=null
receiver: THIS of 'Test0' type=Test0
receiver: GET_VAR '<receiver: Test0>' type=Test0 origin=null
ENUM_ENTRY enum entry ZERO
init: ENUM_CONSTRUCTOR_CALL 'constructor Test0()'
CONSTRUCTOR private constructor Test0()
@@ -36,7 +36,7 @@ FILE /enumWithSecondaryCtor.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
GET_FIELD 'x: Int' type=kotlin.Int origin=null
receiver: THIS of 'Test1' type=Test1
receiver: GET_VAR '<receiver: Test1>' type=Test1 origin=null
ENUM_ENTRY enum entry ZERO
init: ENUM_CONSTRUCTOR_CALL 'constructor Test1()'
ENUM_ENTRY enum entry ONE
@@ -63,7 +63,7 @@ FILE /enumWithSecondaryCtor.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
GET_FIELD 'x: Int' type=kotlin.Int origin=null
receiver: THIS of 'Test2' type=Test2
receiver: GET_VAR '<receiver: Test2>' type=Test2 origin=null
ENUM_ENTRY enum entry ZERO
init: ENUM_CONSTRUCTOR_CALL 'constructor ZERO()'
class: CLASS ENUM_ENTRY ZERO
+1 -1
View File
@@ -20,7 +20,7 @@ FILE /initBlock.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
GET_FIELD 'x: Int' type=kotlin.Int origin=null
receiver: THIS of 'Test2' type=Test2
receiver: GET_VAR '<receiver: Test2>' type=Test2 origin=null
ANONYMOUS_INITIALIZER Test2
BLOCK_BODY
CALL 'println(): Unit' type=kotlin.Unit origin=null
+4 -4
View File
@@ -12,7 +12,7 @@ FILE /initVal.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
GET_FIELD 'x: Int' type=kotlin.Int origin=null
receiver: THIS of 'TestInitValFromParameter' type=TestInitValFromParameter
receiver: GET_VAR '<receiver: TestInitValFromParameter>' type=TestInitValFromParameter origin=null
CLASS CLASS TestInitValInClass
CONSTRUCTOR public constructor TestInitValInClass()
BLOCK_BODY
@@ -26,7 +26,7 @@ FILE /initVal.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
GET_FIELD 'x: Int' type=kotlin.Int origin=null
receiver: THIS of 'TestInitValInClass' type=TestInitValInClass
receiver: GET_VAR '<receiver: TestInitValInClass>' type=TestInitValInClass origin=null
CLASS CLASS TestInitValInInitBlock
CONSTRUCTOR public constructor TestInitValInInitBlock()
BLOCK_BODY
@@ -38,9 +38,9 @@ FILE /initVal.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
GET_FIELD 'x: Int' type=kotlin.Int origin=null
receiver: THIS of 'TestInitValInInitBlock' type=TestInitValInInitBlock
receiver: GET_VAR '<receiver: TestInitValInInitBlock>' type=TestInitValInInitBlock origin=null
ANONYMOUS_INITIALIZER TestInitValInInitBlock
BLOCK_BODY
SET_FIELD 'x: Int' type=kotlin.Unit origin=null
receiver: THIS of 'TestInitValInInitBlock' type=TestInitValInInitBlock
receiver: GET_VAR '<receiver: TestInitValInInitBlock>' type=TestInitValInInitBlock origin=null
value: CONST Int type=kotlin.Int value='0'
+12 -12
View File
@@ -12,11 +12,11 @@ FILE /initVar.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
GET_FIELD 'x: Int' type=kotlin.Int origin=null
receiver: THIS of 'TestInitVarFromParameter' type=TestInitVarFromParameter
receiver: GET_VAR '<receiver: TestInitVarFromParameter>' type=TestInitVarFromParameter origin=null
FUN DEFAULT_PROPERTY_ACCESSOR public final fun <set-x>(<set-?>: kotlin.Int): kotlin.Unit
BLOCK_BODY
SET_FIELD 'x: Int' type=kotlin.Unit origin=null
receiver: THIS of 'TestInitVarFromParameter' type=TestInitVarFromParameter
receiver: GET_VAR '<receiver: TestInitVarFromParameter>' type=TestInitVarFromParameter origin=null
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int origin=null
CLASS CLASS TestInitVarInClass
CONSTRUCTOR public constructor TestInitVarInClass()
@@ -31,11 +31,11 @@ FILE /initVar.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
GET_FIELD 'x: Int' type=kotlin.Int origin=null
receiver: THIS of 'TestInitVarInClass' type=TestInitVarInClass
receiver: GET_VAR '<receiver: TestInitVarInClass>' type=TestInitVarInClass origin=null
FUN DEFAULT_PROPERTY_ACCESSOR public final fun <set-x>(<set-?>: kotlin.Int): kotlin.Unit
BLOCK_BODY
SET_FIELD 'x: Int' type=kotlin.Unit origin=null
receiver: THIS of 'TestInitVarInClass' type=TestInitVarInClass
receiver: GET_VAR '<receiver: TestInitVarInClass>' type=TestInitVarInClass origin=null
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int origin=null
CLASS CLASS TestInitVarInInitBlock
CONSTRUCTOR public constructor TestInitVarInInitBlock()
@@ -48,16 +48,16 @@ FILE /initVar.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
GET_FIELD 'x: Int' type=kotlin.Int origin=null
receiver: THIS of 'TestInitVarInInitBlock' type=TestInitVarInInitBlock
receiver: GET_VAR '<receiver: TestInitVarInInitBlock>' type=TestInitVarInInitBlock origin=null
FUN DEFAULT_PROPERTY_ACCESSOR public final fun <set-x>(<set-?>: kotlin.Int): kotlin.Unit
BLOCK_BODY
SET_FIELD 'x: Int' type=kotlin.Unit origin=null
receiver: THIS of 'TestInitVarInInitBlock' type=TestInitVarInInitBlock
receiver: GET_VAR '<receiver: TestInitVarInInitBlock>' type=TestInitVarInInitBlock origin=null
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int origin=null
ANONYMOUS_INITIALIZER TestInitVarInInitBlock
BLOCK_BODY
CALL '<set-x>(Int): Unit' type=kotlin.Unit origin=EQ
$this: THIS of 'TestInitVarInInitBlock' type=TestInitVarInInitBlock
$this: GET_VAR '<receiver: TestInitVarInInitBlock>' type=TestInitVarInInitBlock origin=null
<set-?>: CONST Int type=kotlin.Int value='0'
CLASS CLASS TestInitVarWithCustomSetter
CONSTRUCTOR public constructor TestInitVarWithCustomSetter()
@@ -72,7 +72,7 @@ FILE /initVar.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
GET_FIELD 'x: Int' type=kotlin.Int origin=null
receiver: THIS of 'TestInitVarWithCustomSetter' type=TestInitVarWithCustomSetter
receiver: GET_VAR '<receiver: TestInitVarWithCustomSetter>' type=TestInitVarWithCustomSetter origin=null
FUN public final fun <set-x>(value: kotlin.Int): kotlin.Unit
BLOCK_BODY
SET_FIELD 'x: Int' type=kotlin.Unit origin=EQ
@@ -84,7 +84,7 @@ FILE /initVar.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
GET_FIELD 'x: Int' type=kotlin.Int origin=null
receiver: THIS of 'TestInitVarWithCustomSetterWithExplicitCtor' type=TestInitVarWithCustomSetterWithExplicitCtor
receiver: GET_VAR '<receiver: TestInitVarWithCustomSetterWithExplicitCtor>' type=TestInitVarWithCustomSetterWithExplicitCtor origin=null
FUN public final fun <set-x>(value: kotlin.Int): kotlin.Unit
BLOCK_BODY
SET_FIELD 'x: Int' type=kotlin.Unit origin=EQ
@@ -92,7 +92,7 @@ FILE /initVar.kt
ANONYMOUS_INITIALIZER TestInitVarWithCustomSetterWithExplicitCtor
BLOCK_BODY
CALL '<set-x>(Int): Unit' type=kotlin.Unit origin=EQ
$this: THIS of 'TestInitVarWithCustomSetterWithExplicitCtor' type=TestInitVarWithCustomSetterWithExplicitCtor
$this: GET_VAR '<receiver: TestInitVarWithCustomSetterWithExplicitCtor>' type=TestInitVarWithCustomSetterWithExplicitCtor origin=null
value: CONST Int type=kotlin.Int value='0'
CONSTRUCTOR public constructor TestInitVarWithCustomSetterWithExplicitCtor()
BLOCK_BODY
@@ -105,7 +105,7 @@ FILE /initVar.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
GET_FIELD 'x: Int' type=kotlin.Int origin=null
receiver: THIS of 'TestInitVarWithCustomSetterInCtor' type=TestInitVarWithCustomSetterInCtor
receiver: GET_VAR '<receiver: TestInitVarWithCustomSetterInCtor>' type=TestInitVarWithCustomSetterInCtor origin=null
FUN public final fun <set-x>(value: kotlin.Int): kotlin.Unit
BLOCK_BODY
SET_FIELD 'x: Int' type=kotlin.Unit origin=EQ
@@ -115,5 +115,5 @@ FILE /initVar.kt
DELEGATING_CONSTRUCTOR_CALL 'constructor Any()'
INSTANCE_INITIALIZER_CALL classDescriptor='TestInitVarWithCustomSetterInCtor'
CALL '<set-x>(Int): Unit' type=kotlin.Unit origin=EQ
$this: THIS of 'TestInitVarWithCustomSetterInCtor' type=TestInitVarWithCustomSetterInCtor
$this: GET_VAR '<receiver: TestInitVarWithCustomSetterInCtor>' type=TestInitVarWithCustomSetterInCtor origin=null
value: CONST Int type=kotlin.Int value='42'
+1 -1
View File
@@ -13,5 +13,5 @@ FILE /innerClass.kt
CONSTRUCTOR public constructor DerivedInnerClass()
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'constructor TestInnerClass()'
$this: THIS of 'Outer' type=Outer
$this: GET_VAR '<receiver: Outer>' type=Outer origin=null
INSTANCE_INITIALIZER_CALL classDescriptor='DerivedInnerClass'
@@ -51,7 +51,7 @@ FILE /objectLiteralExpressions.kt
CONSTRUCTOR public constructor <no name provided>()
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'constructor Inner()'
$this: THIS of 'Outer' type=Outer
$this: GET_VAR '<receiver: Outer>' type=Outer origin=null
INSTANCE_INITIALIZER_CALL classDescriptor='<no name provided>'
FUN public open override fun foo(): kotlin.Unit
BLOCK_BODY
@@ -66,7 +66,7 @@ FILE /objectLiteralExpressions.kt
CONSTRUCTOR public constructor <no name provided>()
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'constructor Inner()'
$this: $RECEIVER of 'test4() on Outer: Outer.Inner' type=Outer
$this: GET_VAR '<receiver: test4() on Outer: Outer.Inner>' type=Outer origin=null
INSTANCE_INITIALIZER_CALL classDescriptor='<no name provided>'
FUN public open override fun foo(): kotlin.Unit
BLOCK_BODY
@@ -17,17 +17,17 @@ FILE /objectWithInitializers.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
GET_FIELD 'x: Int' type=kotlin.Int origin=null
receiver: THIS of 'Test' type=Test
receiver: GET_VAR '<receiver: Test>' type=Test origin=null
PROPERTY public final val y: kotlin.Int
FIELD PROPERTY_BACKING_FIELD public final val y: kotlin.Int
FUN DEFAULT_PROPERTY_ACCESSOR public final fun <get-y>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-y>(): Int'
GET_FIELD 'y: Int' type=kotlin.Int origin=null
receiver: THIS of 'Test' type=Test
receiver: GET_VAR '<receiver: Test>' type=Test origin=null
ANONYMOUS_INITIALIZER Test
BLOCK_BODY
SET_FIELD 'y: Int' type=kotlin.Unit origin=null
receiver: THIS of 'Test' type=Test
receiver: GET_VAR '<receiver: Test>' type=Test origin=null
value: CALL '<get-x>(): Int' type=kotlin.Int origin=GET_PROPERTY
$this: THIS of 'Test' type=Test
$this: GET_VAR '<receiver: Test>' type=Test origin=null
+20
View File
@@ -0,0 +1,20 @@
class Outer {
fun foo() {}
inner class Inner {
fun test() {
foo()
}
inner class Inner2 {
fun test2() {
test()
foo()
}
fun Outer.test3() {
foo()
}
}
}
}
@@ -0,0 +1,32 @@
FILE /outerClassAccess.kt
CLASS CLASS Outer
CONSTRUCTOR public constructor Outer()
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'constructor Any()'
INSTANCE_INITIALIZER_CALL classDescriptor='Outer'
FUN public final fun foo(): kotlin.Unit
BLOCK_BODY
CLASS CLASS Inner
CONSTRUCTOR public constructor Inner()
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'constructor Any()'
INSTANCE_INITIALIZER_CALL classDescriptor='Inner'
FUN public final fun test(): kotlin.Unit
BLOCK_BODY
CALL 'foo(): Unit' type=kotlin.Unit origin=null
$this: GET_VAR '<receiver: Outer>' type=Outer origin=null
CLASS CLASS Inner2
CONSTRUCTOR public constructor Inner2()
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'constructor Any()'
INSTANCE_INITIALIZER_CALL classDescriptor='Inner2'
FUN public final fun test2(): kotlin.Unit
BLOCK_BODY
CALL 'test(): Unit' type=kotlin.Unit origin=null
$this: GET_VAR '<receiver: Inner>' type=Outer.Inner origin=null
CALL 'foo(): Unit' type=kotlin.Unit origin=null
$this: GET_VAR '<receiver: Outer>' type=Outer origin=null
FUN public final fun Outer.test3(): kotlin.Unit
BLOCK_BODY
CALL 'foo(): Unit' type=kotlin.Unit origin=null
$this: GET_VAR '<receiver: test3() on Outer: Unit>' type=Outer origin=null
+7 -7
View File
@@ -12,7 +12,7 @@ FILE /primaryConstructor.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
GET_FIELD 'x: Int' type=kotlin.Int origin=null
receiver: THIS of 'Test1' type=Test1
receiver: GET_VAR '<receiver: Test1>' type=Test1 origin=null
PROPERTY public final val y: kotlin.Int
FIELD PROPERTY_BACKING_FIELD public final val y: kotlin.Int
EXPRESSION_BODY
@@ -21,7 +21,7 @@ FILE /primaryConstructor.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-y>(): Int'
GET_FIELD 'y: Int' type=kotlin.Int origin=null
receiver: THIS of 'Test1' type=Test1
receiver: GET_VAR '<receiver: Test1>' type=Test1 origin=null
CLASS CLASS Test2
CONSTRUCTOR public constructor Test2(x: kotlin.Int, y: kotlin.Int)
BLOCK_BODY
@@ -35,7 +35,7 @@ FILE /primaryConstructor.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-y>(): Int'
GET_FIELD 'y: Int' type=kotlin.Int origin=null
receiver: THIS of 'Test2' type=Test2
receiver: GET_VAR '<receiver: Test2>' type=Test2 origin=null
PROPERTY public final val x: kotlin.Int
FIELD PROPERTY_BACKING_FIELD public final val x: kotlin.Int
EXPRESSION_BODY
@@ -44,7 +44,7 @@ FILE /primaryConstructor.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
GET_FIELD 'x: Int' type=kotlin.Int origin=null
receiver: THIS of 'Test2' type=Test2
receiver: GET_VAR '<receiver: Test2>' type=Test2 origin=null
CLASS CLASS Test3
CONSTRUCTOR public constructor Test3(x: kotlin.Int, y: kotlin.Int)
BLOCK_BODY
@@ -58,16 +58,16 @@ FILE /primaryConstructor.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-y>(): Int'
GET_FIELD 'y: Int' type=kotlin.Int origin=null
receiver: THIS of 'Test3' type=Test3
receiver: GET_VAR '<receiver: Test3>' type=Test3 origin=null
PROPERTY public final val x: kotlin.Int
FIELD PROPERTY_BACKING_FIELD public final val x: kotlin.Int
FUN DEFAULT_PROPERTY_ACCESSOR public final fun <get-x>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
GET_FIELD 'x: Int' type=kotlin.Int origin=null
receiver: THIS of 'Test3' type=Test3
receiver: GET_VAR '<receiver: Test3>' type=Test3 origin=null
ANONYMOUS_INITIALIZER Test3
BLOCK_BODY
SET_FIELD 'x: Int' type=kotlin.Unit origin=null
receiver: THIS of 'Test3' type=Test3
receiver: GET_VAR '<receiver: Test3>' type=Test3 origin=null
value: GET_VAR 'value-parameter x: Int' type=kotlin.Int origin=null
@@ -27,7 +27,7 @@ FILE /primaryConstructorWithSuperConstructorCall.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
GET_FIELD 'x: Int' type=kotlin.Int origin=null
receiver: THIS of 'TestWithDelegatingConstructor' type=TestWithDelegatingConstructor
receiver: GET_VAR '<receiver: TestWithDelegatingConstructor>' type=TestWithDelegatingConstructor origin=null
PROPERTY public final val y: kotlin.Int
FIELD PROPERTY_BACKING_FIELD public final val y: kotlin.Int
EXPRESSION_BODY
@@ -36,7 +36,7 @@ FILE /primaryConstructorWithSuperConstructorCall.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-y>(): Int'
GET_FIELD 'y: Int' type=kotlin.Int origin=null
receiver: THIS of 'TestWithDelegatingConstructor' type=TestWithDelegatingConstructor
receiver: GET_VAR '<receiver: TestWithDelegatingConstructor>' type=TestWithDelegatingConstructor origin=null
CONSTRUCTOR public constructor TestWithDelegatingConstructor(x: kotlin.Int)
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'constructor TestWithDelegatingConstructor(Int, Int)'
@@ -23,15 +23,15 @@ FILE /qualifiedSuperCalls.kt
FUN public open override fun foo(): kotlin.Unit
BLOCK_BODY
CALL 'foo(): Unit' superQualifier=ILeft type=kotlin.Unit origin=null
$this: THIS of 'CBoth' type=ILeft
$this: GET_VAR '<receiver: CBoth>' type=CBoth origin=null
CALL 'foo(): Unit' superQualifier=IRight type=kotlin.Unit origin=null
$this: THIS of 'CBoth' type=IRight
$this: GET_VAR '<receiver: CBoth>' type=CBoth origin=null
PROPERTY public open override val bar: kotlin.Int
FUN public open override fun <get-bar>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-bar>(): Int'
CALL 'plus(Int): Int' type=kotlin.Int origin=PLUS
$this: CALL '<get-bar>(): Int' superQualifier=ILeft type=kotlin.Int origin=GET_PROPERTY
$this: THIS of 'CBoth' type=ILeft
$this: GET_VAR '<receiver: CBoth>' type=CBoth origin=null
other: CALL '<get-bar>(): Int' superQualifier=IRight type=kotlin.Int origin=GET_PROPERTY
$this: THIS of 'CBoth' type=IRight
$this: GET_VAR '<receiver: CBoth>' type=CBoth origin=null
+3 -3
View File
@@ -17,7 +17,7 @@ FILE /sealedClasses.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-number>(): Double'
GET_FIELD 'number: Double' type=kotlin.Double origin=null
receiver: THIS of 'Const' type=Expr.Const
receiver: GET_VAR '<receiver: Const>' type=Expr.Const origin=null
CLASS CLASS Sum
CONSTRUCTOR public constructor Sum(e1: Expr, e2: Expr)
BLOCK_BODY
@@ -31,7 +31,7 @@ FILE /sealedClasses.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-e1>(): Expr'
GET_FIELD 'e1: Expr' type=Expr origin=null
receiver: THIS of 'Sum' type=Expr.Sum
receiver: GET_VAR '<receiver: Sum>' type=Expr.Sum origin=null
PROPERTY public final val e2: Expr
FIELD PROPERTY_BACKING_FIELD public final val e2: Expr
EXPRESSION_BODY
@@ -40,7 +40,7 @@ FILE /sealedClasses.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-e2>(): Expr'
GET_FIELD 'e2: Expr' type=Expr origin=null
receiver: THIS of 'Sum' type=Expr.Sum
receiver: GET_VAR '<receiver: Sum>' type=Expr.Sum origin=null
CLASS OBJECT NotANumber
CONSTRUCTOR private constructor NotANumber()
BLOCK_BODY
@@ -13,7 +13,7 @@ FILE /secondaryConstructorWithInitializersFromClassBody.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
GET_FIELD 'x: Int' type=kotlin.Int origin=null
receiver: THIS of 'TestProperty' type=TestProperty
receiver: GET_VAR '<receiver: TestProperty>' type=TestProperty origin=null
CONSTRUCTOR public constructor TestProperty()
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'constructor Base()'
@@ -25,11 +25,11 @@ FILE /secondaryConstructorWithInitializersFromClassBody.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
GET_FIELD 'x: Int' type=kotlin.Int origin=null
receiver: THIS of 'TestInitBlock' type=TestInitBlock
receiver: GET_VAR '<receiver: TestInitBlock>' type=TestInitBlock origin=null
ANONYMOUS_INITIALIZER TestInitBlock
BLOCK_BODY
SET_FIELD 'x: Int' type=kotlin.Unit origin=null
receiver: THIS of 'TestInitBlock' type=TestInitBlock
receiver: GET_VAR '<receiver: TestInitBlock>' type=TestInitBlock origin=null
value: CONST Int type=kotlin.Int value='0'
CONSTRUCTOR public constructor TestInitBlock()
BLOCK_BODY
+3 -3
View File
@@ -14,7 +14,7 @@ FILE /superCalls.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-bar>(): String'
GET_FIELD 'bar: String' type=kotlin.String origin=null
receiver: THIS of 'Base' type=Base
receiver: GET_VAR '<receiver: Base>' type=Base origin=null
CLASS CLASS Derived
CONSTRUCTOR public constructor Derived()
BLOCK_BODY
@@ -23,10 +23,10 @@ FILE /superCalls.kt
FUN public open override fun foo(): kotlin.Unit
BLOCK_BODY
CALL 'foo(): Unit' superQualifier=Base type=kotlin.Unit origin=null
$this: THIS of 'Derived' type=Base
$this: GET_VAR '<receiver: Derived>' type=Derived origin=null
PROPERTY public open override val bar: kotlin.String
FUN public open override fun <get-bar>(): kotlin.String
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-bar>(): String'
CALL '<get-bar>(): String' superQualifier=Base type=kotlin.String origin=GET_PROPERTY
$this: THIS of 'Derived' type=Base
$this: GET_VAR '<receiver: Derived>' type=Derived origin=null
@@ -12,7 +12,7 @@ FILE /classLevelProperties.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test1>(): Int'
GET_FIELD 'test1: Int' type=kotlin.Int origin=null
receiver: THIS of 'C' type=C
receiver: GET_VAR '<receiver: C>' type=C origin=null
PROPERTY public final val test2: kotlin.Int
FUN public final fun <get-test2>(): kotlin.Int
BLOCK_BODY
@@ -26,11 +26,11 @@ FILE /classLevelProperties.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test3>(): Int'
GET_FIELD 'test3: Int' type=kotlin.Int origin=null
receiver: THIS of 'C' type=C
receiver: GET_VAR '<receiver: C>' type=C origin=null
FUN DEFAULT_PROPERTY_ACCESSOR public final fun <set-test3>(<set-?>: kotlin.Int): kotlin.Unit
BLOCK_BODY
SET_FIELD 'test3: Int' type=kotlin.Unit origin=null
receiver: THIS of 'C' type=C
receiver: GET_VAR '<receiver: C>' type=C origin=null
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int origin=null
PROPERTY public final var test4: kotlin.Int
FIELD PROPERTY_BACKING_FIELD public final var test4: kotlin.Int
@@ -40,7 +40,7 @@ FILE /classLevelProperties.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test4>(): Int'
GET_FIELD 'test4: Int' type=kotlin.Int origin=null
receiver: THIS of 'C' type=C
receiver: GET_VAR '<receiver: C>' type=C origin=null
FUN public final fun <set-test4>(value: kotlin.Int): kotlin.Unit
BLOCK_BODY
SET_FIELD 'test4: Int' type=kotlin.Unit origin=EQ
@@ -53,11 +53,11 @@ FILE /classLevelProperties.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test5>(): Int'
GET_FIELD 'test5: Int' type=kotlin.Int origin=null
receiver: THIS of 'C' type=C
receiver: GET_VAR '<receiver: C>' type=C origin=null
FUN private final fun <set-test5>(<set-?>: kotlin.Int): kotlin.Unit
BLOCK_BODY
SET_FIELD 'test5: Int' type=kotlin.Unit origin=null
receiver: THIS of 'C' type=C
receiver: GET_VAR '<receiver: C>' type=C origin=null
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int origin=null
PROPERTY public final val test6: kotlin.Int = 1
FIELD PROPERTY_BACKING_FIELD public final val test6: kotlin.Int = 1
@@ -67,7 +67,7 @@ FILE /classLevelProperties.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test6>(): Int'
GET_FIELD 'test6: Int' type=kotlin.Int origin=null
receiver: THIS of 'C' type=C
receiver: GET_VAR '<receiver: C>' type=C origin=null
PROPERTY public final val test7: kotlin.Int
FIELD DELEGATE val `test7$delegate`: kotlin.Lazy<kotlin.Int>
EXPRESSION_BODY
@@ -85,8 +85,8 @@ FILE /classLevelProperties.kt
CALL 'getValue(Any?, KProperty<*>) on Lazy<Int>: Int' type=kotlin.Int origin=null
<T>: Int
$receiver: GET_FIELD '`test7$delegate`: Lazy<Int>' type=kotlin.Lazy<kotlin.Int> origin=null
receiver: THIS of 'C' type=C
thisRef: THIS of 'C' type=C
receiver: GET_VAR '<receiver: C>' type=C origin=null
thisRef: GET_VAR '<receiver: C>' type=C origin=null
property: CALLABLE_REFERENCE 'test7: Int' type=kotlin.reflect.KProperty1<C, kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE
PROPERTY public final var test8: kotlin.Int
FIELD DELEGATE val `test8$delegate`: java.util.HashMap<kotlin.String, kotlin.Int>
@@ -100,8 +100,8 @@ FILE /classLevelProperties.kt
CALL 'getValue(Any?, KProperty<*>) on MutableMap<in String, in Int>: Int' type=kotlin.Int origin=null
<V>: Int
$receiver: GET_FIELD '`test8$delegate`: HashMap<String, Int>' type=java.util.HashMap<kotlin.String, kotlin.Int> origin=null
receiver: THIS of 'C' type=C
thisRef: THIS of 'C' type=C
receiver: GET_VAR '<receiver: C>' type=C origin=null
thisRef: GET_VAR '<receiver: C>' type=C origin=null
property: CALLABLE_REFERENCE 'test8: Int' type=kotlin.reflect.KMutableProperty1<C, kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE
FUN DELEGATED_PROPERTY_ACCESSOR public final fun <set-test8>(<set-?>: kotlin.Int): kotlin.Unit
BLOCK_BODY
@@ -109,7 +109,7 @@ FILE /classLevelProperties.kt
CALL 'setValue(Any?, KProperty<*>, Int) on MutableMap<in String, in Int>: Unit' type=kotlin.Unit origin=null
<V>: Int
$receiver: GET_FIELD '`test8$delegate`: HashMap<String, Int>' type=java.util.HashMap<kotlin.String, kotlin.Int> origin=null
receiver: THIS of 'C' type=C
thisRef: THIS of 'C' type=C
receiver: GET_VAR '<receiver: C>' type=C origin=null
thisRef: GET_VAR '<receiver: C>' type=C origin=null
property: CALLABLE_REFERENCE 'test8: Int' type=kotlin.reflect.KMutableProperty1<C, kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int origin=null
@@ -31,7 +31,7 @@ FILE /delegatedProperties.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-map>(): MutableMap<String, Any>'
GET_FIELD 'map: MutableMap<String, Any>' type=kotlin.collections.MutableMap<kotlin.String, kotlin.Any> origin=null
receiver: THIS of 'C' type=C
receiver: GET_VAR '<receiver: C>' type=C origin=null
PROPERTY public final val test2: kotlin.Int
FIELD DELEGATE val `test2$delegate`: kotlin.Lazy<kotlin.Int>
EXPRESSION_BODY
@@ -49,22 +49,22 @@ FILE /delegatedProperties.kt
CALL 'getValue(Any?, KProperty<*>) on Lazy<Int>: Int' type=kotlin.Int origin=null
<T>: Int
$receiver: GET_FIELD '`test2$delegate`: Lazy<Int>' type=kotlin.Lazy<kotlin.Int> origin=null
receiver: THIS of 'C' type=C
thisRef: THIS of 'C' type=C
receiver: GET_VAR '<receiver: C>' type=C origin=null
thisRef: GET_VAR '<receiver: C>' type=C origin=null
property: CALLABLE_REFERENCE 'test2: Int' type=kotlin.reflect.KProperty1<C, kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE
PROPERTY public final var test3: kotlin.Any
FIELD DELEGATE val `test3$delegate`: kotlin.collections.MutableMap<kotlin.String, kotlin.Any>
EXPRESSION_BODY
CALL '<get-map>(): MutableMap<String, Any>' type=kotlin.collections.MutableMap<kotlin.String, kotlin.Any> origin=GET_PROPERTY
$this: THIS of 'C' type=C
$this: GET_VAR '<receiver: C>' type=C origin=null
FUN DELEGATED_PROPERTY_ACCESSOR public final fun <get-test3>(): kotlin.Any
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test3>(): Any'
CALL 'getValue(Any?, KProperty<*>) on MutableMap<in String, in Any>: Any' type=kotlin.Any origin=null
<V>: Any
$receiver: GET_FIELD '`test3$delegate`: MutableMap<String, Any>' type=kotlin.collections.MutableMap<kotlin.String, kotlin.Any> origin=null
receiver: THIS of 'C' type=C
thisRef: THIS of 'C' type=C
receiver: GET_VAR '<receiver: C>' type=C origin=null
thisRef: GET_VAR '<receiver: C>' type=C origin=null
property: CALLABLE_REFERENCE 'test3: Any' type=kotlin.reflect.KMutableProperty1<C, kotlin.Any> origin=PROPERTY_REFERENCE_FOR_DELEGATE
FUN DELEGATED_PROPERTY_ACCESSOR public final fun <set-test3>(<set-?>: kotlin.Any): kotlin.Unit
BLOCK_BODY
@@ -72,8 +72,8 @@ FILE /delegatedProperties.kt
CALL 'setValue(Any?, KProperty<*>, Any) on MutableMap<in String, in Any>: Unit' type=kotlin.Unit origin=null
<V>: Any
$receiver: GET_FIELD '`test3$delegate`: MutableMap<String, Any>' type=kotlin.collections.MutableMap<kotlin.String, kotlin.Any> origin=null
receiver: THIS of 'C' type=C
thisRef: THIS of 'C' type=C
receiver: GET_VAR '<receiver: C>' type=C origin=null
thisRef: GET_VAR '<receiver: C>' type=C origin=null
property: CALLABLE_REFERENCE 'test3: Any' type=kotlin.reflect.KMutableProperty1<C, kotlin.Any> origin=PROPERTY_REFERENCE_FOR_DELEGATE
value: GET_VAR 'value-parameter <set-?>: Any' type=kotlin.Any origin=null
PROPERTY public var test4: kotlin.Any
@@ -5,7 +5,7 @@ FILE /interfaceProperties.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test1>(): Int'
GET_FIELD 'test1: Int' type=kotlin.Int origin=null
receiver: THIS of 'C' type=C
receiver: GET_VAR '<receiver: C>' type=C origin=null
PROPERTY public open val test2: kotlin.Int
FUN public open fun <get-test2>(): kotlin.Int
BLOCK_BODY
@@ -16,11 +16,11 @@ FILE /interfaceProperties.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test3>(): Int'
GET_FIELD 'test3: Int' type=kotlin.Int origin=null
receiver: THIS of 'C' type=C
receiver: GET_VAR '<receiver: C>' type=C origin=null
FUN DEFAULT_PROPERTY_ACCESSOR public abstract fun <set-test3>(<set-?>: kotlin.Int): kotlin.Unit
BLOCK_BODY
SET_FIELD 'test3: Int' type=kotlin.Unit origin=null
receiver: THIS of 'C' type=C
receiver: GET_VAR '<receiver: C>' type=C origin=null
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int origin=null
PROPERTY public open var test4: kotlin.Int
FUN public open fun <get-test4>(): kotlin.Int
@@ -14,4 +14,4 @@ FILE /primaryCtorDefaultArguments.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
GET_FIELD 'x: Int' type=kotlin.Int origin=null
receiver: THIS of 'Test' type=Test
receiver: GET_VAR '<receiver: Test>' type=Test origin=null
@@ -12,7 +12,7 @@ FILE /primaryCtorProperties.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test1>(): Int'
GET_FIELD 'test1: Int' type=kotlin.Int origin=null
receiver: THIS of 'C' type=C
receiver: GET_VAR '<receiver: C>' type=C origin=null
PROPERTY public final var test2: kotlin.Int
FIELD PROPERTY_BACKING_FIELD public final var test2: kotlin.Int
EXPRESSION_BODY
@@ -21,9 +21,9 @@ FILE /primaryCtorProperties.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test2>(): Int'
GET_FIELD 'test2: Int' type=kotlin.Int origin=null
receiver: THIS of 'C' type=C
receiver: GET_VAR '<receiver: C>' type=C origin=null
FUN DEFAULT_PROPERTY_ACCESSOR public final fun <set-test2>(<set-?>: kotlin.Int): kotlin.Unit
BLOCK_BODY
SET_FIELD 'test2: Int' type=kotlin.Unit origin=null
receiver: THIS of 'C' type=C
receiver: GET_VAR '<receiver: C>' type=C origin=null
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int origin=null
@@ -9,4 +9,4 @@ FILE /suppressedNonPublicCall.kt
FUN public inline fun C.foo(): kotlin.Unit
BLOCK_BODY
CALL 'bar(): Unit' type=kotlin.Unit origin=null
$this: $RECEIVER of 'foo() on C: Unit' type=C
$this: GET_VAR '<receiver: foo() on C: Unit>' type=C origin=null
@@ -24,7 +24,7 @@ FILE /arrayAugmentedAssignment1.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): IntArray'
GET_FIELD 'x: IntArray' type=kotlin.IntArray origin=null
receiver: THIS of 'C' type=C
receiver: GET_VAR '<receiver: C>' type=C origin=null
FUN public fun testVariable(): kotlin.Unit
BLOCK_BODY
VAR var x: kotlin.IntArray
@@ -11,7 +11,7 @@ FILE /arrayAugmentedAssignment2.kt
VAR IR_TEMPORARY_VARIABLE val tmp1_index0: kotlin.String
CONST String type=kotlin.String value=''
CALL 'set(String, Int) on IA: Unit' type=kotlin.Unit origin=PLUSEQ
$this: $RECEIVER of 'test(IA) on IB: Unit' type=IB
$this: GET_VAR '<receiver: test(IA) on IB: Unit>' type=IB origin=null
$receiver: GET_VAR 'tmp0_array: IA' type=IA origin=null
index: GET_VAR 'tmp1_index0: String' type=kotlin.String origin=null
value: CALL 'plus(Int): Int' type=kotlin.Int origin=PLUSEQ
+2 -2
View File
@@ -12,11 +12,11 @@ FILE /assignments.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
GET_FIELD 'x: Int' type=kotlin.Int origin=null
receiver: THIS of 'Ref' type=Ref
receiver: GET_VAR '<receiver: Ref>' type=Ref origin=null
FUN DEFAULT_PROPERTY_ACCESSOR public final fun <set-x>(<set-?>: kotlin.Int): kotlin.Unit
BLOCK_BODY
SET_FIELD 'x: Int' type=kotlin.Unit origin=null
receiver: THIS of 'Ref' type=Ref
receiver: GET_VAR '<receiver: Ref>' type=Ref origin=null
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int origin=null
FUN public fun test1(): kotlin.Unit
BLOCK_BODY
@@ -9,7 +9,7 @@ FILE /augmentedAssignmentWithExpression.kt
FUN public final fun test1(): kotlin.Unit
BLOCK_BODY
CALL 'plusAssign(Int): Unit' type=kotlin.Unit origin=PLUSEQ
$this: THIS of 'Host' type=Host
$this: GET_VAR '<receiver: Host>' type=Host origin=null
x: CONST Int type=kotlin.Int value='1'
FUN public fun foo(): Host
BLOCK_BODY
@@ -18,7 +18,7 @@ FILE /augmentedAssignmentWithExpression.kt
FUN public fun Host.test2(): kotlin.Unit
BLOCK_BODY
CALL 'plusAssign(Int): Unit' type=kotlin.Unit origin=PLUSEQ
$this: $RECEIVER of 'test2() on Host: Unit' type=Host
$this: GET_VAR '<receiver: test2() on Host: Unit>' type=Host origin=null
x: CONST Int type=kotlin.Int value='1'
FUN public fun test3(): kotlin.Unit
BLOCK_BODY
@@ -14,7 +14,7 @@ FILE /boundCallableReferences.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-bar>(): Int'
GET_FIELD 'bar: Int' type=kotlin.Int origin=null
receiver: THIS of 'A' type=A
receiver: GET_VAR '<receiver: A>' type=A origin=null
FUN public fun A.qux(): kotlin.Unit
BLOCK_BODY
PROPERTY public val test1: kotlin.reflect.KFunction0<kotlin.Unit>
+3 -3
View File
@@ -20,17 +20,17 @@ FILE /calls.kt
FUN public fun kotlin.Int.ext1(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='ext1() on Int: Int'
$RECEIVER of 'ext1() on Int: Int' type=kotlin.Int
GET_VAR '<receiver: ext1() on Int: Int>' type=kotlin.Int origin=null
FUN public fun kotlin.Int.ext2(x: kotlin.Int): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='ext2(Int) on Int: Int'
CALL 'foo(Int, Int): Int' type=kotlin.Int origin=null
x: $RECEIVER of 'ext2(Int) on Int: Int' type=kotlin.Int
x: GET_VAR '<receiver: ext2(Int) on Int: Int>' type=kotlin.Int origin=null
y: GET_VAR 'value-parameter x: Int' type=kotlin.Int origin=null
FUN public fun kotlin.Int.ext3(x: kotlin.Int): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='ext3(Int) on Int: Int'
CALL 'foo(Int, Int): Int' type=kotlin.Int origin=null
x: CALL 'ext1() on Int: Int' type=kotlin.Int origin=null
$receiver: $RECEIVER of 'ext3(Int) on Int: Int' type=kotlin.Int
$receiver: GET_VAR '<receiver: ext3(Int) on Int: Int>' type=kotlin.Int origin=null
y: GET_VAR 'value-parameter x: Int' type=kotlin.Int origin=null
@@ -7,11 +7,11 @@ FILE /chainOfSafeCalls.kt
FUN public final fun foo(): C
BLOCK_BODY
RETURN type=kotlin.Nothing from='foo(): C'
THIS of 'C' type=C
GET_VAR '<receiver: C>' type=C origin=null
FUN public final fun bar(): C?
BLOCK_BODY
RETURN type=kotlin.Nothing from='bar(): C?'
THIS of 'C' type=C
GET_VAR '<receiver: C>' type=C origin=null
FUN public fun test(nc: C?): C?
BLOCK_BODY
RETURN type=kotlin.Nothing from='test(C?): C?'
@@ -12,11 +12,11 @@ FILE /complexAugmentedAssignment.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x1>(): Int'
GET_FIELD 'x1: Int' type=kotlin.Int origin=null
receiver: THIS of 'X1' type=X1
receiver: GET_VAR '<receiver: X1>' type=X1 origin=null
FUN DEFAULT_PROPERTY_ACCESSOR public final fun <set-x1>(<set-?>: kotlin.Int): kotlin.Unit
BLOCK_BODY
SET_FIELD 'x1: Int' type=kotlin.Unit origin=null
receiver: THIS of 'X1' type=X1
receiver: GET_VAR '<receiver: X1>' type=X1 origin=null
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int origin=null
CLASS OBJECT X2
CONSTRUCTOR private constructor X2()
@@ -31,11 +31,11 @@ FILE /complexAugmentedAssignment.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x2>(): Int'
GET_FIELD 'x2: Int' type=kotlin.Int origin=null
receiver: THIS of 'X2' type=X1.X2
receiver: GET_VAR '<receiver: X2>' type=X1.X2 origin=null
FUN DEFAULT_PROPERTY_ACCESSOR public final fun <set-x2>(<set-?>: kotlin.Int): kotlin.Unit
BLOCK_BODY
SET_FIELD 'x2: Int' type=kotlin.Unit origin=null
receiver: THIS of 'X2' type=X1.X2
receiver: GET_VAR '<receiver: X2>' type=X1.X2 origin=null
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int origin=null
CLASS OBJECT X3
CONSTRUCTOR private constructor X3()
@@ -50,11 +50,11 @@ FILE /complexAugmentedAssignment.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x3>(): Int'
GET_FIELD 'x3: Int' type=kotlin.Int origin=null
receiver: THIS of 'X3' type=X1.X2.X3
receiver: GET_VAR '<receiver: X3>' type=X1.X2.X3 origin=null
FUN DEFAULT_PROPERTY_ACCESSOR public final fun <set-x3>(<set-?>: kotlin.Int): kotlin.Unit
BLOCK_BODY
SET_FIELD 'x3: Int' type=kotlin.Unit origin=null
receiver: THIS of 'X3' type=X1.X2.X3
receiver: GET_VAR '<receiver: X3>' type=X1.X2.X3 origin=null
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int origin=null
FUN public fun test1(a: kotlin.IntArray): kotlin.Unit
BLOCK_BODY
@@ -138,11 +138,11 @@ FILE /complexAugmentedAssignment.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-s>(): Int'
GET_FIELD 's: Int' type=kotlin.Int origin=null
receiver: THIS of 'B' type=B
receiver: GET_VAR '<receiver: B>' type=B origin=null
FUN DEFAULT_PROPERTY_ACCESSOR public final fun <set-s>(<set-?>: kotlin.Int): kotlin.Unit
BLOCK_BODY
SET_FIELD 's: Int' type=kotlin.Unit origin=null
receiver: THIS of 'B' type=B
receiver: GET_VAR '<receiver: B>' type=B origin=null
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int origin=null
CLASS OBJECT Host
CONSTRUCTOR private constructor Host()
@@ -153,7 +153,7 @@ FILE /complexAugmentedAssignment.kt
BLOCK_BODY
BLOCK type=kotlin.Unit origin=PLUSEQ
VAR IR_TEMPORARY_VARIABLE val tmp0_this: B
$RECEIVER of 'plusAssign(B) on B: Unit' type=B
GET_VAR '<receiver: plusAssign(B) on B: Unit>' type=B origin=null
CALL '<set-s>(Int): Unit' type=kotlin.Unit origin=PLUSEQ
$this: GET_VAR 'tmp0_this: B' type=B origin=null
<set-?>: CALL 'plus(Int): Int' type=kotlin.Int origin=PLUSEQ
@@ -164,7 +164,7 @@ FILE /complexAugmentedAssignment.kt
FUN public fun Host.test3(v: B): kotlin.Unit
BLOCK_BODY
CALL 'plusAssign(B) on B: Unit' type=kotlin.Unit origin=PLUSEQ
$this: $RECEIVER of 'test3(B) on Host: Unit' type=Host
$this: GET_VAR '<receiver: test3(B) on Host: Unit>' type=Host origin=null
$receiver: GET_VAR 'value-parameter v: B' type=B origin=PLUSEQ
b: CALL 'constructor B(Int = ...)' type=B origin=null
s: CONST Int type=kotlin.Int value='1000'
@@ -7,7 +7,7 @@ FILE /conventionComparisons.kt
RETURN type=kotlin.Nothing from='test1(IA, IA) on IB: Boolean'
CALL 'GT0(Int): Boolean' type=kotlin.Boolean origin=GT
arg0: CALL 'compareTo(IA) on IA: Int' type=kotlin.Int origin=GT
$this: $RECEIVER of 'test1(IA, IA) on IB: Boolean' type=IB
$this: GET_VAR '<receiver: test1(IA, IA) on IB: Boolean>' type=IB origin=null
$receiver: GET_VAR 'value-parameter a1: IA' type=IA origin=null
other: GET_VAR 'value-parameter a2: IA' type=IA origin=null
FUN public fun IB.test2(a1: IA, a2: IA): kotlin.Boolean
@@ -15,7 +15,7 @@ FILE /conventionComparisons.kt
RETURN type=kotlin.Nothing from='test2(IA, IA) on IB: Boolean'
CALL 'GTEQ0(Int): Boolean' type=kotlin.Boolean origin=GTEQ
arg0: CALL 'compareTo(IA) on IA: Int' type=kotlin.Int origin=GTEQ
$this: $RECEIVER of 'test2(IA, IA) on IB: Boolean' type=IB
$this: GET_VAR '<receiver: test2(IA, IA) on IB: Boolean>' type=IB origin=null
$receiver: GET_VAR 'value-parameter a1: IA' type=IA origin=null
other: GET_VAR 'value-parameter a2: IA' type=IA origin=null
FUN public fun IB.test3(a1: IA, a2: IA): kotlin.Boolean
@@ -23,7 +23,7 @@ FILE /conventionComparisons.kt
RETURN type=kotlin.Nothing from='test3(IA, IA) on IB: Boolean'
CALL 'LT0(Int): Boolean' type=kotlin.Boolean origin=LT
arg0: CALL 'compareTo(IA) on IA: Int' type=kotlin.Int origin=LT
$this: $RECEIVER of 'test3(IA, IA) on IB: Boolean' type=IB
$this: GET_VAR '<receiver: test3(IA, IA) on IB: Boolean>' type=IB origin=null
$receiver: GET_VAR 'value-parameter a1: IA' type=IA origin=null
other: GET_VAR 'value-parameter a2: IA' type=IA origin=null
FUN public fun IB.test4(a1: IA, a2: IA): kotlin.Boolean
@@ -31,6 +31,6 @@ FILE /conventionComparisons.kt
RETURN type=kotlin.Nothing from='test4(IA, IA) on IB: Boolean'
CALL 'LTEQ0(Int): Boolean' type=kotlin.Boolean origin=LTEQ
arg0: CALL 'compareTo(IA) on IA: Int' type=kotlin.Int origin=LTEQ
$this: $RECEIVER of 'test4(IA, IA) on IB: Boolean' type=IB
$this: GET_VAR '<receiver: test4(IA, IA) on IB: Boolean>' type=IB origin=null
$receiver: GET_VAR 'value-parameter a1: IA' type=IA origin=null
other: GET_VAR 'value-parameter a2: IA' type=IA origin=null
+2 -2
View File
@@ -24,9 +24,9 @@ FILE /destructuring1.kt
GET_OBJECT 'A' type=A
VAR val x: kotlin.Int
CALL 'component1() on A: Int' type=kotlin.Int origin=COMPONENT_N(index=1)
$this: $RECEIVER of 'test() on B: Unit' type=B
$this: GET_VAR '<receiver: test() on B: Unit>' type=B origin=null
$receiver: GET_VAR 'tmp0_container: A' type=A origin=null
VAR val y: kotlin.Int
CALL 'component2() on A: Int' type=kotlin.Int origin=COMPONENT_N(index=2)
$this: $RECEIVER of 'test() on B: Unit' type=B
$this: GET_VAR '<receiver: test() on B: Unit>' type=B origin=null
$receiver: GET_VAR 'tmp0_container: A' type=A origin=null
@@ -8,4 +8,4 @@ FILE /extensionPropertyGetterCall.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='test5() on String: String'
CALL '<get-okext>() on String: String' type=kotlin.String origin=GET_PROPERTY
$receiver: $RECEIVER of 'test5() on String: String' type=kotlin.String
$receiver: GET_VAR '<receiver: test5() on String: String>' type=kotlin.String origin=null
@@ -17,11 +17,11 @@ FILE /forWithImplicitReceivers.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-value>(): Int'
GET_FIELD 'value: Int' type=kotlin.Int origin=null
receiver: THIS of 'IntCell' type=IntCell
receiver: GET_VAR '<receiver: IntCell>' type=IntCell origin=null
FUN DEFAULT_PROPERTY_ACCESSOR public final fun <set-value>(<set-?>: kotlin.Int): kotlin.Unit
BLOCK_BODY
SET_FIELD 'value: Int' type=kotlin.Unit origin=null
receiver: THIS of 'IntCell' type=IntCell
receiver: GET_VAR '<receiver: IntCell>' type=IntCell origin=null
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int origin=null
CLASS INTERFACE IReceiver
FUN public open operator fun FiveTimes.iterator(): IntCell
@@ -35,14 +35,14 @@ FILE /forWithImplicitReceivers.kt
CALL 'GT0(Int): Boolean' type=kotlin.Boolean origin=GT
arg0: CALL 'compareTo(Int): Int' type=kotlin.Int origin=GT
$this: CALL '<get-value>(): Int' type=kotlin.Int origin=GET_PROPERTY
$this: $RECEIVER of 'hasNext() on IntCell: Boolean' type=IntCell
$this: GET_VAR '<receiver: hasNext() on IntCell: Boolean>' type=IntCell origin=null
other: CONST Int type=kotlin.Int value='0'
FUN public open operator fun IntCell.next(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='next() on IntCell: Int'
BLOCK type=kotlin.Int origin=POSTFIX_DECR
VAR IR_TEMPORARY_VARIABLE val tmp0_this: IntCell
$RECEIVER of 'next() on IntCell: Int' type=IntCell
GET_VAR '<receiver: next() on IntCell: Int>' type=IntCell origin=null
BLOCK type=kotlin.Int origin=POSTFIX_DECR
VAR IR_TEMPORARY_VARIABLE val tmp1: kotlin.Int
CALL '<get-value>(): Int' type=kotlin.Int origin=POSTFIX_DECR
@@ -57,16 +57,16 @@ FILE /forWithImplicitReceivers.kt
BLOCK type=kotlin.Unit origin=FOR_LOOP
VAR IR_TEMPORARY_VARIABLE val tmp0_iterator: IntCell
CALL 'iterator() on FiveTimes: IntCell' type=IntCell origin=FOR_LOOP_ITERATOR
$this: $RECEIVER of 'test() on IReceiver: Unit' type=IReceiver
$this: GET_VAR '<receiver: test() on IReceiver: Unit>' type=IReceiver origin=null
$receiver: GET_OBJECT 'FiveTimes' type=FiveTimes
WHILE label=null origin=FOR_LOOP_INNER_WHILE
condition: CALL 'hasNext() on IntCell: Boolean' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT
$this: $RECEIVER of 'test() on IReceiver: Unit' type=IReceiver
$this: GET_VAR '<receiver: test() on IReceiver: Unit>' type=IReceiver origin=null
$receiver: GET_VAR 'tmp0_iterator: IntCell' type=IntCell origin=null
body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE
VAR val i: kotlin.Int
CALL 'next() on IntCell: Int' type=kotlin.Int origin=FOR_LOOP_NEXT
$this: $RECEIVER of 'test() on IReceiver: Unit' type=IReceiver
$this: GET_VAR '<receiver: test() on IReceiver: Unit>' type=IReceiver origin=null
$receiver: GET_VAR 'tmp0_iterator: IntCell' type=IntCell origin=null
BLOCK type=kotlin.Unit origin=null
CALL 'println(Int): Unit' type=kotlin.Unit origin=null
@@ -7,15 +7,15 @@ FILE /Derived.kt
ANONYMOUS_INITIALIZER Derived
BLOCK_BODY
SET_FIELD 'value: Int' type=kotlin.Unit origin=EQ
receiver: THIS of 'Derived' type=Derived
receiver: GET_VAR '<receiver: Derived>' type=Derived origin=null
value: CONST Int type=kotlin.Int value='0'
FUN public final fun getValue(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='getValue(): Int'
GET_FIELD 'value: Int' type=kotlin.Int origin=GET_PROPERTY
receiver: THIS of 'Derived' type=Derived
receiver: GET_VAR '<receiver: Derived>' type=Derived origin=null
FUN public final fun setValue(value: kotlin.Int): kotlin.Unit
BLOCK_BODY
SET_FIELD 'value: Int' type=kotlin.Unit origin=EQ
receiver: THIS of 'Derived' type=Derived
receiver: GET_VAR '<receiver: Derived>' type=Derived origin=null
value: GET_VAR 'value-parameter value: Int' type=kotlin.Int origin=null
@@ -41,7 +41,7 @@ FILE /jvmStaticFieldReference.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test>(): Int'
GET_FIELD 'test: Int' type=kotlin.Int origin=null
receiver: THIS of 'TestClass' type=TestClass
receiver: GET_VAR '<receiver: TestClass>' type=TestClass origin=null
ANONYMOUS_INITIALIZER TestClass
BLOCK_BODY
CALL 'println(String!): Unit' type=kotlin.Unit origin=null
+1 -1
View File
@@ -47,4 +47,4 @@ FILE /references.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='test5() on String: String'
CALL '<get-okext>() on String: String' type=kotlin.String origin=GET_PROPERTY
$receiver: $RECEIVER of 'test5() on String: String' type=kotlin.String
$receiver: GET_VAR '<receiver: test5() on String: String>' type=kotlin.String origin=null
+2 -2
View File
@@ -12,11 +12,11 @@ FILE /safeAssignment.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
GET_FIELD 'x: Int' type=kotlin.Int origin=null
receiver: THIS of 'C' type=C
receiver: GET_VAR '<receiver: C>' type=C origin=null
FUN DEFAULT_PROPERTY_ACCESSOR public final fun <set-x>(<set-?>: kotlin.Int): kotlin.Unit
BLOCK_BODY
SET_FIELD 'x: Int' type=kotlin.Unit origin=null
receiver: THIS of 'C' type=C
receiver: GET_VAR '<receiver: C>' type=C origin=null
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int origin=null
FUN public fun test(nc: C?): kotlin.Unit
BLOCK_BODY
@@ -16,7 +16,7 @@ FILE /safeCallWithIncrementDecrement.kt
RETURN type=kotlin.Nothing from='inc() on Int?: Int?'
BLOCK type=kotlin.Int? origin=SAFE_CALL
VAR IR_TEMPORARY_VARIABLE val tmp0_safe_receiver: kotlin.Int?
$RECEIVER of 'inc() on Int?: Int?' type=kotlin.Int?
GET_VAR '<receiver: inc() on Int?: Int?>' type=kotlin.Int? origin=null
WHEN type=kotlin.Int? origin=SAFE_CALL
BRANCH
if: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
+4 -4
View File
@@ -12,18 +12,18 @@ FILE /safeCalls.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-value>(): Int'
GET_FIELD 'value: Int' type=kotlin.Int origin=null
receiver: THIS of 'Ref' type=Ref
receiver: GET_VAR '<receiver: Ref>' type=Ref origin=null
FUN DEFAULT_PROPERTY_ACCESSOR public final fun <set-value>(<set-?>: kotlin.Int): kotlin.Unit
BLOCK_BODY
SET_FIELD 'value: Int' type=kotlin.Unit origin=null
receiver: THIS of 'Ref' type=Ref
receiver: GET_VAR '<receiver: Ref>' type=Ref origin=null
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int origin=null
CLASS INTERFACE IHost
FUN public open fun kotlin.String.extLength(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='extLength() on String: Int'
CALL '<get-length>(): Int' type=kotlin.Int origin=GET_PROPERTY
$this: $RECEIVER of 'extLength() on String: Int' type=kotlin.String
$this: GET_VAR '<receiver: extLength() on String: Int>' type=kotlin.String origin=null
FUN public fun test1(x: kotlin.String?): kotlin.Int?
BLOCK_BODY
RETURN type=kotlin.Nothing from='test1(String?): Int?'
@@ -105,5 +105,5 @@ FILE /safeCalls.kt
BRANCH
if: CONST Boolean type=kotlin.Boolean value='true'
then: CALL 'extLength() on String: Int' type=kotlin.Int origin=null
$this: $RECEIVER of 'test5(String?) on IHost: Int?' type=IHost
$this: GET_VAR '<receiver: test5(String?) on IHost: Int?>' type=IHost origin=null
$receiver: GET_VAR 'tmp0_safe_receiver: String?' type=kotlin.String? origin=null
@@ -12,6 +12,6 @@ FILE /Derived.kt
GET_VAR 'value-parameter v: Any' type=kotlin.Any origin=null
then: BLOCK type=kotlin.Unit origin=null
SET_FIELD 'value: String!' type=kotlin.Unit origin=EQ
receiver: THIS of 'Derived' type=Derived
receiver: GET_VAR '<receiver: Derived>' type=Derived origin=null
value: TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.String!
GET_VAR 'value-parameter v: Any' type=kotlin.Any origin=null
@@ -6,7 +6,7 @@ FILE /variableAsFunctionCall.kt
FUN LOCAL_FUNCTION_FOR_LAMBDA local final fun <anonymous>(): kotlin.String
BLOCK_BODY
RETURN type=kotlin.Nothing from='<anonymous>(): String'
$RECEIVER of 'k() on String: () -> String' type=kotlin.String
GET_VAR '<receiver: k() on String: () -> String>' type=kotlin.String origin=null
CALLABLE_REFERENCE '<anonymous>(): String' type=() -> kotlin.String origin=LAMBDA
FUN public fun test1(f: () -> kotlin.Unit): kotlin.Unit
BLOCK_BODY
+1 -1
View File
@@ -11,5 +11,5 @@ FILE /extensionLambda.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<anonymous>() on String: Int'
CALL '<get-length>(): Int' type=kotlin.Int origin=GET_PROPERTY
$this: $RECEIVER of '<anonymous>() on String: Int' type=kotlin.String
$this: GET_VAR '<receiver: <anonymous>() on String: Int>' type=kotlin.String origin=null
CALLABLE_REFERENCE '<anonymous>() on String: Int' type=kotlin.String.() -> kotlin.Int origin=LAMBDA
@@ -48,10 +48,10 @@ FILE /multipleImplicitReceivers.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='<anonymous>() on IInvoke: Int'
CALL 'invoke() on B: Int' type=kotlin.Int origin=INVOKE
$this: $RECEIVER of '<anonymous>() on IInvoke: Int' type=IInvoke
$this: GET_VAR '<receiver: <anonymous>() on IInvoke: Int>' type=IInvoke origin=null
$receiver: CALL '<get-foo>() on A: B' type=B origin=GET_PROPERTY
$this: $RECEIVER of '<anonymous>() on IFoo: Int' type=IFoo
$receiver: $RECEIVER of '<anonymous>() on A: Int' type=A
$this: GET_VAR '<receiver: <anonymous>() on IFoo: Int>' type=IFoo origin=null
$receiver: GET_VAR '<receiver: <anonymous>() on A: Int>' type=A origin=null
CALLABLE_REFERENCE '<anonymous>() on IInvoke: Int' type=IInvoke.() -> kotlin.Int origin=LAMBDA
CALLABLE_REFERENCE '<anonymous>() on IFoo: Int' type=IFoo.() -> kotlin.Int origin=LAMBDA
CALLABLE_REFERENCE '<anonymous>() on A: Int' type=A.() -> kotlin.Int origin=LAMBDA
@@ -5655,6 +5655,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegation/delegationToVal.kt");
doTest(fileName);
}
@TestMetadata("kt8154.kt")
public void testKt8154() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegation/kt8154.kt");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/codegen/box/destructuringDeclInLambdaParam")
@@ -13666,6 +13672,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
doTest(fileName);
}
@TestMetadata("kt13381.kt")
public void testKt13381() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/regressions/kt13381.kt");
doTest(fileName);
}
@TestMetadata("kt1406.kt")
public void testKt1406() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/regressions/kt1406.kt");
@@ -70,4 +70,10 @@ public class IrOnlyBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTest
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/box/objectClass.kt");
doTest(fileName);
}
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/box/simple.kt");
doTest(fileName);
}
}
@@ -72,7 +72,7 @@ abstract class AbstractClosureAnnotatorTestCase : AbstractIrGeneratorTestCase()
closure.capturedReceiverParameters.forEach {
actualOut.println(" receiver for ${it.containingDeclaration.name}")
}
closure.capturedVariables.forEach {
closure.capturedValues.forEach {
actualOut.println(" variable ${it.name}")
}
}
@@ -145,6 +145,12 @@ public class IrTextTestCaseGenerated extends AbstractIrTextTestCase {
doTest(fileName);
}
@TestMetadata("outerClassAccess.kt")
public void testOuterClassAccess() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/classes/outerClassAccess.kt");
doTest(fileName);
}
@TestMetadata("primaryConstructor.kt")
public void testPrimaryConstructor() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/classes/primaryConstructor.kt");