org.jetbrains.jet.codegen
Class StackValue

java.lang.Object
  extended by org.jetbrains.jet.codegen.StackValue
Direct Known Subclasses:
StackValue.CallReceiver, StackValue.Composed, StackValue.Constant, StackValue.Local, StackValue.OnStack, StackValue.Shared, StackValue.StackValueWithSimpleReceiver

public abstract class StackValue
extends java.lang.Object


Nested Class Summary
static class StackValue.CallReceiver
           
static class StackValue.Composed
           
static class StackValue.Constant
           
static class StackValue.Field
           
static class StackValue.Local
           
static class StackValue.OnStack
           
static class StackValue.Shared
           
static class StackValue.StackValueWithSimpleReceiver
           
 
Field Summary
 org.jetbrains.org.objectweb.asm.Type type
           
 
Constructor Summary
protected StackValue(org.jetbrains.org.objectweb.asm.Type type)
           
 
Method Summary
static StackValue arrayElement(org.jetbrains.org.objectweb.asm.Type type)
           
static StackValue cmp(com.intellij.psi.tree.IElementType opToken, org.jetbrains.org.objectweb.asm.Type type)
           
static void coerce(org.jetbrains.org.objectweb.asm.Type fromType, org.jetbrains.org.objectweb.asm.Type toType, org.jetbrains.org.objectweb.asm.commons.InstructionAdapter v)
           
protected  void coerceFrom(org.jetbrains.org.objectweb.asm.Type topOfStackType, org.jetbrains.org.objectweb.asm.commons.InstructionAdapter v)
           
protected  void coerceTo(org.jetbrains.org.objectweb.asm.Type toType, org.jetbrains.org.objectweb.asm.commons.InstructionAdapter v)
           
static StackValue collectionElement(org.jetbrains.org.objectweb.asm.Type type, ResolvedCall<FunctionDescriptor> getter, ResolvedCall<FunctionDescriptor> setter, ExpressionCodegen codegen, GenerationState state)
           
static StackValue composed(StackValue prefix, StackValue suffix)
           
 void condJump(org.jetbrains.org.objectweb.asm.Label label, boolean jumpIfFalse, org.jetbrains.org.objectweb.asm.commons.InstructionAdapter v)
           
static StackValue constant(java.lang.Object value, org.jetbrains.org.objectweb.asm.Type type)
           
 void dupReceiver(org.jetbrains.org.objectweb.asm.commons.InstructionAdapter v)
           
static StackValue expression(org.jetbrains.org.objectweb.asm.Type type, JetExpression expression, ExpressionCodegen generator)
           
static StackValue.Field field(org.jetbrains.org.objectweb.asm.Type type, org.jetbrains.org.objectweb.asm.Type owner, java.lang.String name, boolean isStatic)
           
static StackValue fieldForSharedVar(org.jetbrains.org.objectweb.asm.Type localType, org.jetbrains.org.objectweb.asm.Type classType, java.lang.String fieldName)
           
static StackValue.Local local(int index, org.jetbrains.org.objectweb.asm.Type type)
           
protected  void moveToTopOfStack(org.jetbrains.org.objectweb.asm.Type type, org.jetbrains.org.objectweb.asm.commons.InstructionAdapter v, int depth)
          This method is called to put the value on the top of the JVM stack if depth other values have been put on the JVM stack after this value was generated.
static StackValue none()
           
static StackValue not(StackValue stackValue)
           
static StackValue onStack(org.jetbrains.org.objectweb.asm.Type type)
           
static StackValue postIncrement(int index, int increment)
           
static StackValue preIncrement(int index, int increment)
           
static org.jetbrains.jet.codegen.StackValue.Property property(PropertyDescriptor descriptor, org.jetbrains.org.objectweb.asm.Type methodOwner, org.jetbrains.org.objectweb.asm.Type type, boolean isStatic, java.lang.String name, CallableMethod getter, CallableMethod setter, GenerationState state)
           
abstract  void put(org.jetbrains.org.objectweb.asm.Type type, org.jetbrains.org.objectweb.asm.commons.InstructionAdapter v)
          Put this value to the top of the stack.
protected  void putAsBoolean(org.jetbrains.org.objectweb.asm.commons.InstructionAdapter v)
           
static void putUnitInstance(org.jetbrains.org.objectweb.asm.commons.InstructionAdapter v)
           
static StackValue receiver(ResolvedCall<?> resolvedCall, StackValue receiver, ExpressionCodegen codegen, CallableMethod callableMethod)
           
 int receiverSize()
           
static StackValue receiverWithoutReceiverArgument(StackValue receiverWithParameter)
           
static org.jetbrains.org.objectweb.asm.Type refType(org.jetbrains.org.objectweb.asm.Type type)
           
static StackValue shared(int index, org.jetbrains.org.objectweb.asm.Type type)
           
static org.jetbrains.org.objectweb.asm.Type sharedTypeForType(org.jetbrains.org.objectweb.asm.Type type)
           
static StackValue.Field singleton(ClassDescriptor classDescriptor, JetTypeMapper typeMapper)
           
 void store(org.jetbrains.org.objectweb.asm.Type topOfStackType, org.jetbrains.org.objectweb.asm.commons.InstructionAdapter v)
          Set this value from the top of the stack.
static StackValue thisOrOuter(ExpressionCodegen codegen, ClassDescriptor descriptor, boolean isSuper, boolean isExplicit)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

type

@NotNull
public final org.jetbrains.org.objectweb.asm.Type type
Constructor Detail

StackValue

protected StackValue(@NotNull
                     org.jetbrains.org.objectweb.asm.Type type)
Method Detail

put

public abstract void put(org.jetbrains.org.objectweb.asm.Type type,
                         org.jetbrains.org.objectweb.asm.commons.InstructionAdapter v)
Put this value to the top of the stack.


moveToTopOfStack

protected void moveToTopOfStack(org.jetbrains.org.objectweb.asm.Type type,
                                org.jetbrains.org.objectweb.asm.commons.InstructionAdapter v,
                                int depth)
This method is called to put the value on the top of the JVM stack if depth other values have been put on the JVM stack after this value was generated.

Parameters:
type - the type as which the value should be put
v - the visitor used to genClassOrObject the instructions
depth - the number of new values put onto the stack

store

public void store(org.jetbrains.org.objectweb.asm.Type topOfStackType,
                  org.jetbrains.org.objectweb.asm.commons.InstructionAdapter v)
Set this value from the top of the stack.


dupReceiver

public void dupReceiver(org.jetbrains.org.objectweb.asm.commons.InstructionAdapter v)

receiverSize

public int receiverSize()

condJump

public void condJump(org.jetbrains.org.objectweb.asm.Label label,
                     boolean jumpIfFalse,
                     org.jetbrains.org.objectweb.asm.commons.InstructionAdapter v)

local

public static StackValue.Local local(int index,
                                     org.jetbrains.org.objectweb.asm.Type type)

shared

public static StackValue shared(int index,
                                org.jetbrains.org.objectweb.asm.Type type)

onStack

public static StackValue onStack(org.jetbrains.org.objectweb.asm.Type type)

constant

public static StackValue constant(@Nullable
                                  java.lang.Object value,
                                  org.jetbrains.org.objectweb.asm.Type type)

cmp

public static StackValue cmp(com.intellij.psi.tree.IElementType opToken,
                             org.jetbrains.org.objectweb.asm.Type type)

not

public static StackValue not(StackValue stackValue)

arrayElement

@NotNull
public static StackValue arrayElement(org.jetbrains.org.objectweb.asm.Type type)

collectionElement

@NotNull
public static StackValue collectionElement(org.jetbrains.org.objectweb.asm.Type type,
                                                   ResolvedCall<FunctionDescriptor> getter,
                                                   ResolvedCall<FunctionDescriptor> setter,
                                                   ExpressionCodegen codegen,
                                                   GenerationState state)

field

@NotNull
public static StackValue.Field field(@NotNull
                                             org.jetbrains.org.objectweb.asm.Type type,
                                             @NotNull
                                             org.jetbrains.org.objectweb.asm.Type owner,
                                             @NotNull
                                             java.lang.String name,
                                             boolean isStatic)

property

@NotNull
public static org.jetbrains.jet.codegen.StackValue.Property property(@NotNull
                                                                             PropertyDescriptor descriptor,
                                                                             @NotNull
                                                                             org.jetbrains.org.objectweb.asm.Type methodOwner,
                                                                             @NotNull
                                                                             org.jetbrains.org.objectweb.asm.Type type,
                                                                             boolean isStatic,
                                                                             @NotNull
                                                                             java.lang.String name,
                                                                             @Nullable
                                                                             CallableMethod getter,
                                                                             @Nullable
                                                                             CallableMethod setter,
                                                                             GenerationState state)

expression

@NotNull
public static StackValue expression(org.jetbrains.org.objectweb.asm.Type type,
                                            JetExpression expression,
                                            ExpressionCodegen generator)

coerceTo

protected void coerceTo(org.jetbrains.org.objectweb.asm.Type toType,
                        org.jetbrains.org.objectweb.asm.commons.InstructionAdapter v)

coerceFrom

protected void coerceFrom(org.jetbrains.org.objectweb.asm.Type topOfStackType,
                          org.jetbrains.org.objectweb.asm.commons.InstructionAdapter v)

coerce

public static void coerce(org.jetbrains.org.objectweb.asm.Type fromType,
                          org.jetbrains.org.objectweb.asm.Type toType,
                          org.jetbrains.org.objectweb.asm.commons.InstructionAdapter v)

putUnitInstance

public static void putUnitInstance(org.jetbrains.org.objectweb.asm.commons.InstructionAdapter v)

putAsBoolean

protected void putAsBoolean(org.jetbrains.org.objectweb.asm.commons.InstructionAdapter v)

none

public static StackValue none()

fieldForSharedVar

public static StackValue fieldForSharedVar(org.jetbrains.org.objectweb.asm.Type localType,
                                           org.jetbrains.org.objectweb.asm.Type classType,
                                           java.lang.String fieldName)

composed

public static StackValue composed(StackValue prefix,
                                  StackValue suffix)

thisOrOuter

public static StackValue thisOrOuter(ExpressionCodegen codegen,
                                     ClassDescriptor descriptor,
                                     boolean isSuper,
                                     boolean isExplicit)

postIncrement

public static StackValue postIncrement(int index,
                                       int increment)

preIncrement

public static StackValue preIncrement(int index,
                                      int increment)

receiver

public static StackValue receiver(ResolvedCall<?> resolvedCall,
                                  StackValue receiver,
                                  ExpressionCodegen codegen,
                                  @Nullable
                                  CallableMethod callableMethod)

receiverWithoutReceiverArgument

public static StackValue receiverWithoutReceiverArgument(StackValue receiverWithParameter)

singleton

public static StackValue.Field singleton(ClassDescriptor classDescriptor,
                                         JetTypeMapper typeMapper)

sharedTypeForType

public static org.jetbrains.org.objectweb.asm.Type sharedTypeForType(org.jetbrains.org.objectweb.asm.Type type)

refType

public static org.jetbrains.org.objectweb.asm.Type refType(org.jetbrains.org.objectweb.asm.Type type)