org.jetbrains.kotlin.codegen
Class FunctionCodegen

java.lang.Object
  extended by org.jetbrains.kotlin.codegen.FunctionCodegen

public class FunctionCodegen
extends java.lang.Object


Field Summary
 GenerationState state
           
 
Constructor Summary
FunctionCodegen(CodegenContext owner, ClassBuilder v, GenerationState state, MemberCodegen<?> memberCodegen)
           
 
Method Summary
static FrameMap createFrameMap(GenerationState state, FunctionDescriptor function, JvmMethodSignature signature, boolean isStatic)
           
static void endVisit(org.jetbrains.org.objectweb.asm.MethodVisitor mv, java.lang.String description)
           
static void endVisit(org.jetbrains.org.objectweb.asm.MethodVisitor mv, java.lang.String description, KtElement method)
           
static void endVisit(org.jetbrains.org.objectweb.asm.MethodVisitor mv, java.lang.String description, KtPureElement method)
           
 void gen(KtNamedFunction function)
           
 void genDelegate(FunctionDescriptor delegateFunction, FunctionDescriptor delegatedTo, ClassDescriptor toClass, StackValue field)
           
 void genDelegate(FunctionDescriptor functionDescriptor, FunctionDescriptor overriddenDescriptor, StackValue field)
           
 void generateBridges(FunctionDescriptor descriptor)
           
static void generateDefaultImplBody(MethodContext methodContext, FunctionDescriptor functionDescriptor, org.jetbrains.org.objectweb.asm.MethodVisitor mv, DefaultParameterValueLoader loadStrategy, KtNamedFunction function, MemberCodegen<?> parentCodegen, org.jetbrains.org.objectweb.asm.commons.Method defaultMethod)
           
static void generateLocalVariablesForParameters(org.jetbrains.org.objectweb.asm.MethodVisitor mv, JvmMethodSignature jvmMethodSignature, org.jetbrains.org.objectweb.asm.Type thisType, org.jetbrains.org.objectweb.asm.Label methodBegin, org.jetbrains.org.objectweb.asm.Label methodEnd, java.util.Collection<ValueParameterDescriptor> valueParameters, boolean isStatic, KotlinTypeMapper typeMapper)
           
 void generateMethod(JvmDeclarationOrigin origin, FunctionDescriptor descriptor, FunctionGenerationStrategy strategy)
           
 void generateMethod(JvmDeclarationOrigin origin, FunctionDescriptor functionDescriptor, MethodContext methodContext, FunctionGenerationStrategy strategy)
           
static void generateMethodAnnotations(FunctionDescriptor functionDescriptor, org.jetbrains.org.objectweb.asm.commons.Method asmMethod, org.jetbrains.org.objectweb.asm.MethodVisitor mv, InnerClassConsumer consumer, KotlinTypeMapper typeMapper)
           
static void generateMethodBody(org.jetbrains.org.objectweb.asm.MethodVisitor mv, FunctionDescriptor functionDescriptor, MethodContext context, JvmMethodSignature signature, FunctionGenerationStrategy strategy, MemberCodegen<?> parentCodegen)
           
 void generateOverloadsWithDefaultValues(KtNamedFunction function, FunctionDescriptor functionDescriptor, FunctionDescriptor delegateFunctionDescriptor)
           
static void generateParameterAnnotations(FunctionDescriptor functionDescriptor, org.jetbrains.org.objectweb.asm.MethodVisitor mv, JvmMethodSignature jvmSignature, InnerClassConsumer innerClassConsumer, GenerationState state)
           
static void generateParameterAnnotations(FunctionDescriptor functionDescriptor, org.jetbrains.org.objectweb.asm.MethodVisitor mv, JvmMethodSignature jvmSignature, java.util.List<ValueParameterDescriptor> valueParameters, InnerClassConsumer innerClassConsumer, GenerationState state)
           
 void genSamDelegate(FunctionDescriptor functionDescriptor, FunctionDescriptor overriddenDescriptor, StackValue field)
           
static java.lang.String[] getThrownExceptions(FunctionDescriptor function, KotlinTypeMapper mapper)
           
static boolean isMethodOfAny(FunctionDescriptor descriptor)
           
static boolean isThereOverriddenInKotlinClass(CallableMemberDescriptor descriptor)
           
static boolean processInterface(DeclarationDescriptor contextClass, OwnerKind kind, GenerationState state)
           
static boolean processInterfaceMember(CallableMemberDescriptor function, OwnerKind kind, GenerationState state)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

state

public final GenerationState state
Constructor Detail

FunctionCodegen

public FunctionCodegen(@NotNull
                       CodegenContext owner,
                       @NotNull
                       ClassBuilder v,
                       @NotNull
                       GenerationState state,
                       @NotNull
                       MemberCodegen<?> memberCodegen)
Method Detail

gen

public void gen(@NotNull
                KtNamedFunction function)

generateOverloadsWithDefaultValues

public void generateOverloadsWithDefaultValues(@Nullable
                                               KtNamedFunction function,
                                               @NotNull
                                               FunctionDescriptor functionDescriptor,
                                               @NotNull
                                               FunctionDescriptor delegateFunctionDescriptor)

generateMethod

public void generateMethod(@NotNull
                           JvmDeclarationOrigin origin,
                           @NotNull
                           FunctionDescriptor descriptor,
                           @NotNull
                           FunctionGenerationStrategy strategy)

generateMethod

public void generateMethod(@NotNull
                           JvmDeclarationOrigin origin,
                           @NotNull
                           FunctionDescriptor functionDescriptor,
                           @NotNull
                           MethodContext methodContext,
                           @NotNull
                           FunctionGenerationStrategy strategy)

generateMethodAnnotations

public static void generateMethodAnnotations(@NotNull
                                             FunctionDescriptor functionDescriptor,
                                             org.jetbrains.org.objectweb.asm.commons.Method asmMethod,
                                             org.jetbrains.org.objectweb.asm.MethodVisitor mv,
                                             @NotNull
                                             InnerClassConsumer consumer,
                                             @NotNull
                                             KotlinTypeMapper typeMapper)

generateParameterAnnotations

public static void generateParameterAnnotations(@NotNull
                                                FunctionDescriptor functionDescriptor,
                                                @NotNull
                                                org.jetbrains.org.objectweb.asm.MethodVisitor mv,
                                                @NotNull
                                                JvmMethodSignature jvmSignature,
                                                @NotNull
                                                InnerClassConsumer innerClassConsumer,
                                                @NotNull
                                                GenerationState state)

generateParameterAnnotations

public static void generateParameterAnnotations(@NotNull
                                                FunctionDescriptor functionDescriptor,
                                                @NotNull
                                                org.jetbrains.org.objectweb.asm.MethodVisitor mv,
                                                @NotNull
                                                JvmMethodSignature jvmSignature,
                                                @NotNull
                                                java.util.List<ValueParameterDescriptor> valueParameters,
                                                @NotNull
                                                InnerClassConsumer innerClassConsumer,
                                                @NotNull
                                                GenerationState state)

generateMethodBody

public static void generateMethodBody(@NotNull
                                      org.jetbrains.org.objectweb.asm.MethodVisitor mv,
                                      @NotNull
                                      FunctionDescriptor functionDescriptor,
                                      @NotNull
                                      MethodContext context,
                                      @NotNull
                                      JvmMethodSignature signature,
                                      @NotNull
                                      FunctionGenerationStrategy strategy,
                                      @NotNull
                                      MemberCodegen<?> parentCodegen)

generateLocalVariablesForParameters

public static void generateLocalVariablesForParameters(@NotNull
                                                       org.jetbrains.org.objectweb.asm.MethodVisitor mv,
                                                       @NotNull
                                                       JvmMethodSignature jvmMethodSignature,
                                                       @Nullable
                                                       org.jetbrains.org.objectweb.asm.Type thisType,
                                                       @NotNull
                                                       org.jetbrains.org.objectweb.asm.Label methodBegin,
                                                       @NotNull
                                                       org.jetbrains.org.objectweb.asm.Label methodEnd,
                                                       java.util.Collection<ValueParameterDescriptor> valueParameters,
                                                       boolean isStatic,
                                                       KotlinTypeMapper typeMapper)

endVisit

public static void endVisit(org.jetbrains.org.objectweb.asm.MethodVisitor mv,
                            @Nullable
                            java.lang.String description)

endVisit

public static void endVisit(org.jetbrains.org.objectweb.asm.MethodVisitor mv,
                            @Nullable
                            java.lang.String description,
                            @Nullable
                            KtPureElement method)

endVisit

public static void endVisit(org.jetbrains.org.objectweb.asm.MethodVisitor mv,
                            @Nullable
                            java.lang.String description,
                            @NotNull
                            KtElement method)

generateBridges

public void generateBridges(@NotNull
                            FunctionDescriptor descriptor)

isThereOverriddenInKotlinClass

public static boolean isThereOverriddenInKotlinClass(@NotNull
                                                     CallableMemberDescriptor descriptor)

isMethodOfAny

public static boolean isMethodOfAny(@NotNull
                                    FunctionDescriptor descriptor)

getThrownExceptions

@NotNull
public static java.lang.String[] getThrownExceptions(@NotNull
                                                             FunctionDescriptor function,
                                                             @NotNull
                                                             KotlinTypeMapper mapper)

generateDefaultImplBody

public static void generateDefaultImplBody(@NotNull
                                           MethodContext methodContext,
                                           @NotNull
                                           FunctionDescriptor functionDescriptor,
                                           @NotNull
                                           org.jetbrains.org.objectweb.asm.MethodVisitor mv,
                                           @NotNull
                                           DefaultParameterValueLoader loadStrategy,
                                           @Nullable
                                           KtNamedFunction function,
                                           @NotNull
                                           MemberCodegen<?> parentCodegen,
                                           @NotNull
                                           org.jetbrains.org.objectweb.asm.commons.Method defaultMethod)

createFrameMap

@NotNull
public static FrameMap createFrameMap(@NotNull
                                              GenerationState state,
                                              @NotNull
                                              FunctionDescriptor function,
                                              @NotNull
                                              JvmMethodSignature signature,
                                              boolean isStatic)

genSamDelegate

public void genSamDelegate(@NotNull
                           FunctionDescriptor functionDescriptor,
                           FunctionDescriptor overriddenDescriptor,
                           StackValue field)

genDelegate

public void genDelegate(@NotNull
                        FunctionDescriptor functionDescriptor,
                        FunctionDescriptor overriddenDescriptor,
                        StackValue field)

genDelegate

public void genDelegate(@NotNull
                        FunctionDescriptor delegateFunction,
                        FunctionDescriptor delegatedTo,
                        ClassDescriptor toClass,
                        StackValue field)

processInterfaceMember

public static boolean processInterfaceMember(@NotNull
                                             CallableMemberDescriptor function,
                                             @NotNull
                                             OwnerKind kind,
                                             @NotNull
                                             GenerationState state)

processInterface

public static boolean processInterface(@NotNull
                                       DeclarationDescriptor contextClass,
                                       @NotNull
                                       OwnerKind kind,
                                       @NotNull
                                       GenerationState state)