use of org.jetbrains.kotlin.descriptors.impl.SimpleFunctionDescriptorImpl in project kotlin by JetBrains.
the class ClosureCodegen method generateBridges.
protected void generateBridges() {
FunctionDescriptor erasedInterfaceFunction;
if (samType == null) {
erasedInterfaceFunction = getErasedInvokeFunction(funDescriptor);
} else {
erasedInterfaceFunction = samType.getAbstractMethod().getOriginal();
}
generateBridge(typeMapper.mapAsmMethod(erasedInterfaceFunction), typeMapper.mapAsmMethod(funDescriptor));
//TODO: rewrite cause ugly hack
if (samType != null) {
SimpleFunctionDescriptorImpl descriptorForBridges = SimpleFunctionDescriptorImpl.create(funDescriptor.getContainingDeclaration(), funDescriptor.getAnnotations(), erasedInterfaceFunction.getName(), CallableMemberDescriptor.Kind.DECLARATION, funDescriptor.getSource());
descriptorForBridges.initialize(null, erasedInterfaceFunction.getDispatchReceiverParameter(), erasedInterfaceFunction.getTypeParameters(), erasedInterfaceFunction.getValueParameters(), erasedInterfaceFunction.getReturnType(), Modality.OPEN, erasedInterfaceFunction.getVisibility());
DescriptorUtilsKt.setSingleOverridden(descriptorForBridges, erasedInterfaceFunction);
functionCodegen.generateBridges(descriptorForBridges);
}
}
use of org.jetbrains.kotlin.descriptors.impl.SimpleFunctionDescriptorImpl in project kotlin by JetBrains.
the class MemberCodegen method createOrGetClInitCodegen.
@NotNull
public final ExpressionCodegen createOrGetClInitCodegen() {
if (clInit == null) {
DeclarationDescriptor contextDescriptor = context.getContextDescriptor();
SimpleFunctionDescriptorImpl clInitDescriptor = createClInitFunctionDescriptor(contextDescriptor);
MethodVisitor mv = createClInitMethodVisitor(contextDescriptor);
clInit = new ExpressionCodegen(mv, new FrameMap(), Type.VOID_TYPE, context.intoFunction(clInitDescriptor), state, this);
}
return clInit;
}
use of org.jetbrains.kotlin.descriptors.impl.SimpleFunctionDescriptorImpl in project kotlin by JetBrains.
the class MemberCodegen method createClInitFunctionDescriptor.
@NotNull
private SimpleFunctionDescriptorImpl createClInitFunctionDescriptor(@NotNull DeclarationDescriptor descriptor) {
SimpleFunctionDescriptorImpl clInit = SimpleFunctionDescriptorImpl.create(descriptor, Annotations.Companion.getEMPTY(), Name.special("<clinit>"), SYNTHESIZED, KotlinSourceElementKt.toSourceElement(element));
clInit.initialize(null, null, Collections.<TypeParameterDescriptor>emptyList(), Collections.<ValueParameterDescriptor>emptyList(), DescriptorUtilsKt.getModule(descriptor).getBuiltIns().getUnitType(), null, Visibilities.PRIVATE);
return clInit;
}
Aggregations