org.jetbrains.jet.codegen
Class StackValue
java.lang.Object
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
Field Summary |
org.jetbrains.asm4.Type |
type
|
Constructor Summary |
protected |
StackValue(org.jetbrains.asm4.Type type)
|
Method Summary |
static StackValue |
arrayElement(org.jetbrains.asm4.Type type,
boolean unbox)
|
static StackValue |
cmp(com.intellij.psi.tree.IElementType opToken,
org.jetbrains.asm4.Type type)
|
static void |
coerce(org.jetbrains.asm4.Type fromType,
org.jetbrains.asm4.Type toType,
org.jetbrains.asm4.commons.InstructionAdapter v)
|
protected void |
coerceFrom(org.jetbrains.asm4.Type topOfStackType,
org.jetbrains.asm4.commons.InstructionAdapter v)
|
protected void |
coerceTo(org.jetbrains.asm4.Type toType,
org.jetbrains.asm4.commons.InstructionAdapter v)
|
static StackValue |
collectionElement(org.jetbrains.asm4.Type type,
ResolvedCall<FunctionDescriptor> getter,
ResolvedCall<FunctionDescriptor> setter,
ExpressionCodegen codegen,
GenerationState state)
|
static StackValue |
composed(StackValue prefix,
StackValue suffix)
|
void |
condJump(org.jetbrains.asm4.Label label,
boolean jumpIfFalse,
org.jetbrains.asm4.commons.InstructionAdapter v)
|
static StackValue |
constant(java.lang.Object value,
org.jetbrains.asm4.Type type)
|
void |
dupReceiver(org.jetbrains.asm4.commons.InstructionAdapter v)
|
static StackValue |
expression(org.jetbrains.asm4.Type type,
JetExpression expression,
ExpressionCodegen generator)
|
static org.jetbrains.jet.codegen.StackValue.Field |
field(org.jetbrains.asm4.Type type,
JvmClassName owner,
java.lang.String name,
boolean isStatic)
|
static StackValue |
fieldForSharedVar(org.jetbrains.asm4.Type type,
JvmClassName name,
java.lang.String fieldName)
|
static StackValue.Local |
local(int index,
org.jetbrains.asm4.Type type)
|
protected void |
moveToTopOfStack(org.jetbrains.asm4.Type type,
org.jetbrains.asm4.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.asm4.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,
JvmClassName methodOwner,
org.jetbrains.asm4.Type type,
boolean isStatic,
java.lang.String name,
CallableMethod getter,
CallableMethod setter,
GenerationState state)
|
abstract void |
put(org.jetbrains.asm4.Type type,
org.jetbrains.asm4.commons.InstructionAdapter v)
Put this value to the top of the stack. |
protected void |
putAsBoolean(org.jetbrains.asm4.commons.InstructionAdapter v)
|
static void |
putUnitInstance(org.jetbrains.asm4.commons.InstructionAdapter v)
|
static StackValue |
receiver(ResolvedCall<? extends CallableDescriptor> resolvedCall,
StackValue receiver,
ExpressionCodegen codegen,
CallableMethod callableMethod)
|
int |
receiverSize()
|
static StackValue |
receiverWithoutReceiverArgument(StackValue receiverWithParameter)
|
static org.jetbrains.asm4.Type |
refType(org.jetbrains.asm4.Type type)
|
static StackValue |
shared(int index,
org.jetbrains.asm4.Type type)
|
static org.jetbrains.asm4.Type |
sharedTypeForType(org.jetbrains.asm4.Type type)
|
static org.jetbrains.jet.codegen.StackValue.Field |
singleton(ClassDescriptor classDescriptor,
JetTypeMapper typeMapper)
|
void |
store(org.jetbrains.asm4.Type topOfStackType,
org.jetbrains.asm4.commons.InstructionAdapter v)
Set this value from the top of the stack. |
static StackValue |
thisOrOuter(ExpressionCodegen codegen,
ClassDescriptor descriptor,
boolean isSuper)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
type
@NotNull
public final org.jetbrains.asm4.Type type
StackValue
protected StackValue(@NotNull
org.jetbrains.asm4.Type type)
put
public abstract void put(org.jetbrains.asm4.Type type,
org.jetbrains.asm4.commons.InstructionAdapter v)
- Put this value to the top of the stack.
moveToTopOfStack
protected void moveToTopOfStack(org.jetbrains.asm4.Type type,
org.jetbrains.asm4.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 putv
- the visitor used to genClassOrObject the instructionsdepth
- the number of new values put onto the stack
store
public void store(org.jetbrains.asm4.Type topOfStackType,
org.jetbrains.asm4.commons.InstructionAdapter v)
- Set this value from the top of the stack.
dupReceiver
public void dupReceiver(org.jetbrains.asm4.commons.InstructionAdapter v)
receiverSize
public int receiverSize()
condJump
public void condJump(org.jetbrains.asm4.Label label,
boolean jumpIfFalse,
org.jetbrains.asm4.commons.InstructionAdapter v)
local
public static StackValue.Local local(int index,
org.jetbrains.asm4.Type type)
shared
public static StackValue shared(int index,
org.jetbrains.asm4.Type type)
onStack
public static StackValue onStack(org.jetbrains.asm4.Type type)
constant
public static StackValue constant(@Nullable
java.lang.Object value,
org.jetbrains.asm4.Type type)
cmp
public static StackValue cmp(com.intellij.psi.tree.IElementType opToken,
org.jetbrains.asm4.Type type)
not
public static StackValue not(StackValue stackValue)
arrayElement
@NotNull
public static StackValue arrayElement(org.jetbrains.asm4.Type type,
boolean unbox)
collectionElement
@NotNull
public static StackValue collectionElement(org.jetbrains.asm4.Type type,
ResolvedCall<FunctionDescriptor> getter,
ResolvedCall<FunctionDescriptor> setter,
ExpressionCodegen codegen,
GenerationState state)
field
@NotNull
public static org.jetbrains.jet.codegen.StackValue.Field field(@NotNull
org.jetbrains.asm4.Type type,
@NotNull
JvmClassName owner,
@NotNull
java.lang.String name,
boolean isStatic)
property
@NotNull
public static org.jetbrains.jet.codegen.StackValue.Property property(@NotNull
PropertyDescriptor descriptor,
@NotNull
JvmClassName methodOwner,
@NotNull
org.jetbrains.asm4.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.asm4.Type type,
JetExpression expression,
ExpressionCodegen generator)
coerceTo
protected void coerceTo(org.jetbrains.asm4.Type toType,
org.jetbrains.asm4.commons.InstructionAdapter v)
coerceFrom
protected void coerceFrom(org.jetbrains.asm4.Type topOfStackType,
org.jetbrains.asm4.commons.InstructionAdapter v)
coerce
public static void coerce(org.jetbrains.asm4.Type fromType,
org.jetbrains.asm4.Type toType,
org.jetbrains.asm4.commons.InstructionAdapter v)
putUnitInstance
public static void putUnitInstance(org.jetbrains.asm4.commons.InstructionAdapter v)
putAsBoolean
protected void putAsBoolean(org.jetbrains.asm4.commons.InstructionAdapter v)
none
public static StackValue none()
fieldForSharedVar
public static StackValue fieldForSharedVar(org.jetbrains.asm4.Type type,
JvmClassName name,
java.lang.String fieldName)
composed
public static StackValue composed(StackValue prefix,
StackValue suffix)
thisOrOuter
public static StackValue thisOrOuter(ExpressionCodegen codegen,
ClassDescriptor descriptor,
boolean isSuper)
postIncrement
public static StackValue postIncrement(int index,
int increment)
preIncrement
public static StackValue preIncrement(int index,
int increment)
receiver
public static StackValue receiver(ResolvedCall<? extends CallableDescriptor> resolvedCall,
StackValue receiver,
ExpressionCodegen codegen,
@Nullable
CallableMethod callableMethod)
receiverWithoutReceiverArgument
public static StackValue receiverWithoutReceiverArgument(StackValue receiverWithParameter)
singleton
public static org.jetbrains.jet.codegen.StackValue.Field singleton(ClassDescriptor classDescriptor,
JetTypeMapper typeMapper)
sharedTypeForType
public static org.jetbrains.asm4.Type sharedTypeForType(org.jetbrains.asm4.Type type)
refType
public static org.jetbrains.asm4.Type refType(org.jetbrains.asm4.Type type)