org.jetbrains.jet.codegen.context
Class CodegenContext<T extends DeclarationDescriptor>

java.lang.Object
  extended by org.jetbrains.jet.codegen.context.CodegenContext<T>
Direct Known Subclasses:
FieldOwnerContext, MethodContext

public abstract class CodegenContext<T extends DeclarationDescriptor>
extends java.lang.Object


Field Summary
 MutableClosure closure
           
static CodegenContext STATIC
           
 
Constructor Summary
CodegenContext(T contextDescriptor, OwnerKind contextKind, CodegenContext parentContext, MutableClosure closure, ClassDescriptor thisDescriptor, LocalLookup expressionCodegen)
           
 
Method Summary
 FunctionDescriptor accessibleFunctionDescriptor(FunctionDescriptor fd)
           
 PropertyDescriptor accessiblePropertyDescriptor(PropertyDescriptor propertyDescriptor)
           
 CodegenContext findChildContext(DeclarationDescriptor child)
           
 CodegenContext findParentContextWithDescriptor(DeclarationDescriptor descriptor)
           
 DeclarationDescriptor getAccessor(DeclarationDescriptor descriptor)
           
 DeclarationDescriptor getAccessor(DeclarationDescriptor descriptor, boolean isForBackingFieldInOuterClass, JetType delegateType)
           
 java.util.Map<DeclarationDescriptor,DeclarationDescriptor> getAccessors()
           
 CallableDescriptor getCallableDescriptorWithReceiver()
          This method returns not null only if context descriptor corresponds to method or function which has receiver
 CodegenContext<? extends ClassOrPackageFragmentDescriptor> getClassOrPackageParentContext()
           
 T getContextDescriptor()
           
 OwnerKind getContextKind()
           
 ClassDescriptor getEnclosingClass()
           
 StackValue getOuterExpression(StackValue prefix, boolean ignoreNoOuter)
           
 CodegenContext getParentContext()
           
 StackValue getReceiverExpression(JetTypeMapper typeMapper)
           
 ClassDescriptor getThisDescriptor()
           
 boolean hasThisDescriptor()
           
protected  void initOuterExpression(JetTypeMapper typeMapper, ClassDescriptor classDescriptor)
           
 ClassContext intoAnonymousClass(ClassDescriptor descriptor, ExpressionCodegen codegen)
           
 ClassContext intoClass(ClassDescriptor descriptor, OwnerKind kind, GenerationState state)
           
 CodegenContext intoClosure(FunctionDescriptor funDescriptor, LocalLookup localLookup, JetTypeMapper typeMapper)
           
 ConstructorContext intoConstructor(ConstructorDescriptor descriptor)
           
 MethodContext intoFunction(FunctionDescriptor descriptor)
           
 MethodContext intoInlinedLambda(FunctionDescriptor descriptor)
           
 FieldOwnerContext intoPackageFacade(org.jetbrains.org.objectweb.asm.Type delegateTo, PackageFragmentDescriptor descriptor)
           
 PackageContext intoPackagePart(PackageFragmentDescriptor descriptor, org.jetbrains.org.objectweb.asm.Type packagePartType)
           
 ScriptContext intoScript(ScriptDescriptor script, java.util.List<ScriptDescriptor> earlierScripts, ClassDescriptor classDescriptor)
           
abstract  boolean isStatic()
           
 StackValue lookupInContext(DeclarationDescriptor d, StackValue result, GenerationState state, boolean ignoreNoOuter)
           
 void recordSyntheticAccessorIfNeeded(FunctionDescriptor fd, BindingContext bindingContext)
           
 void recordSyntheticAccessorIfNeeded(PropertyDescriptor propertyDescriptor, BindingContext typeMapper)
           
protected  boolean shouldAddChild(CodegenContext child)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATIC

public static final CodegenContext STATIC

closure

public final MutableClosure closure
Constructor Detail

CodegenContext

public CodegenContext(@NotNull
                      T contextDescriptor,
                      @NotNull
                      OwnerKind contextKind,
                      @Nullable
                      CodegenContext parentContext,
                      @Nullable
                      MutableClosure closure,
                      @Nullable
                      ClassDescriptor thisDescriptor,
                      @Nullable
                      LocalLookup expressionCodegen)
Method Detail

getThisDescriptor

@NotNull
public final ClassDescriptor getThisDescriptor()

hasThisDescriptor

public final boolean hasThisDescriptor()

getClassOrPackageParentContext

@NotNull
public CodegenContext<? extends ClassOrPackageFragmentDescriptor> getClassOrPackageParentContext()

getCallableDescriptorWithReceiver

@Nullable
public final CallableDescriptor getCallableDescriptorWithReceiver()
This method returns not null only if context descriptor corresponds to method or function which has receiver


getOuterExpression

public StackValue getOuterExpression(@Nullable
                                     StackValue prefix,
                                     boolean ignoreNoOuter)

getContextDescriptor

@NotNull
public T getContextDescriptor()

getContextKind

@NotNull
public OwnerKind getContextKind()

intoPackagePart

@NotNull
public PackageContext intoPackagePart(@NotNull
                                              PackageFragmentDescriptor descriptor,
                                              org.jetbrains.org.objectweb.asm.Type packagePartType)

intoPackageFacade

@NotNull
public FieldOwnerContext intoPackageFacade(@NotNull
                                                   org.jetbrains.org.objectweb.asm.Type delegateTo,
                                                   @NotNull
                                                   PackageFragmentDescriptor descriptor)

intoClass

@NotNull
public ClassContext intoClass(ClassDescriptor descriptor,
                                      OwnerKind kind,
                                      GenerationState state)

intoAnonymousClass

@NotNull
public ClassContext intoAnonymousClass(@NotNull
                                               ClassDescriptor descriptor,
                                               @NotNull
                                               ExpressionCodegen codegen)

intoFunction

@NotNull
public MethodContext intoFunction(FunctionDescriptor descriptor)

intoInlinedLambda

@NotNull
public MethodContext intoInlinedLambda(FunctionDescriptor descriptor)

intoConstructor

@NotNull
public ConstructorContext intoConstructor(@NotNull
                                                  ConstructorDescriptor descriptor)

intoScript

@NotNull
public ScriptContext intoScript(@NotNull
                                        ScriptDescriptor script,
                                        @NotNull
                                        java.util.List<ScriptDescriptor> earlierScripts,
                                        @NotNull
                                        ClassDescriptor classDescriptor)

intoClosure

@NotNull
public CodegenContext intoClosure(@NotNull
                                          FunctionDescriptor funDescriptor,
                                          @NotNull
                                          LocalLookup localLookup,
                                          @NotNull
                                          JetTypeMapper typeMapper)

getParentContext

@Nullable
public CodegenContext getParentContext()

getEnclosingClass

public ClassDescriptor getEnclosingClass()

findParentContextWithDescriptor

@Nullable
public CodegenContext findParentContextWithDescriptor(DeclarationDescriptor descriptor)

getAccessor

@NotNull
public DeclarationDescriptor getAccessor(@NotNull
                                                 DeclarationDescriptor descriptor)

getAccessor

@NotNull
public DeclarationDescriptor getAccessor(@NotNull
                                                 DeclarationDescriptor descriptor,
                                                 boolean isForBackingFieldInOuterClass,
                                                 @Nullable
                                                 JetType delegateType)

getReceiverExpression

public StackValue getReceiverExpression(JetTypeMapper typeMapper)

isStatic

public abstract boolean isStatic()

initOuterExpression

protected void initOuterExpression(@NotNull
                                   JetTypeMapper typeMapper,
                                   @NotNull
                                   ClassDescriptor classDescriptor)

lookupInContext

public StackValue lookupInContext(DeclarationDescriptor d,
                                  @Nullable
                                  StackValue result,
                                  GenerationState state,
                                  boolean ignoreNoOuter)

getAccessors

@NotNull
public java.util.Map<DeclarationDescriptor,DeclarationDescriptor> getAccessors()

accessiblePropertyDescriptor

@NotNull
public PropertyDescriptor accessiblePropertyDescriptor(PropertyDescriptor propertyDescriptor)

accessibleFunctionDescriptor

@NotNull
public FunctionDescriptor accessibleFunctionDescriptor(FunctionDescriptor fd)

recordSyntheticAccessorIfNeeded

public void recordSyntheticAccessorIfNeeded(@NotNull
                                            FunctionDescriptor fd,
                                            @NotNull
                                            BindingContext bindingContext)

recordSyntheticAccessorIfNeeded

public void recordSyntheticAccessorIfNeeded(@NotNull
                                            PropertyDescriptor propertyDescriptor,
                                            @NotNull
                                            BindingContext typeMapper)

shouldAddChild

protected boolean shouldAddChild(@NotNull
                                 CodegenContext child)

findChildContext

@Nullable
public CodegenContext findChildContext(@NotNull
                                                DeclarationDescriptor child)