Package org.codehaus.groovy.classgen.asm
Class OperandStack
java.lang.Object
org.codehaus.groovy.classgen.asm.OperandStack
public class OperandStack
extends java.lang.Object
- 
Constructor SummaryConstructors Constructor Description OperandStack(WriterController wc)
- 
Method SummaryModifier and Type Method Description ClassNodebox()voidcastToBool(int mark, boolean emptyDefault)ensure last marked parameter on the stack is a primitive boolean if mark==stack size, we assume an empty expression or statement.voiddoAsType(ClassNode targetType)voiddoGroovyCast(ClassNode targetType)do Groovy cast for top level elementvoiddoGroovyCast(Variable v)voiddup()duplicate top elementintgetStackLength()ClassNodegetTopOperand()org.objectweb.asm.Labeljump(int ifIns)voidjump(int ifIns, org.objectweb.asm.Label label)voidload(ClassNode type, int idx)voidloadOrStoreVariable(BytecodeVariable variable, boolean useReferenceDirectly)voidpop()remove operand stack top element using bytecode popvoidpopDownTo(int elements)voidpush(ClassNode type)push operand on stackvoidpushBool(boolean inclusive)voidpushConstant(ConstantExpression expression)load the constant on the operand stack.voidpushDynamicName(Expression name)voidremove(int amount)Remove amount elements from the operand stack, without using pop.voidreplace(ClassNode type)replace top level element with new element of given typevoidreplace(ClassNode type, int n)replace n top level elements with new element of given typevoidstoreVar(BytecodeVariable variable)voidswap()swap two top level operandsjava.lang.StringtoString()Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
- 
Constructor Details- 
OperandStack
 
- 
- 
Method Details- 
getStackLengthpublic int getStackLength()
- 
popDownTopublic void popDownTo(int elements)
- 
castToBoolpublic void castToBool(int mark, boolean emptyDefault)ensure last marked parameter on the stack is a primitive boolean if mark==stack size, we assume an empty expression or statement. was used and we will use the value given in emptyDefault as boolean if mark==stack.size()-1 the top element will be cast to boolean using Groovy truth. In other cases we throw a GroovyBugError
- 
poppublic void pop()remove operand stack top element using bytecode pop
- 
jumppublic org.objectweb.asm.Label jump(int ifIns)
- 
jumppublic void jump(int ifIns, org.objectweb.asm.Label label)
- 
duppublic void dup()duplicate top element
- 
box
- 
removepublic void remove(int amount)Remove amount elements from the operand stack, without using pop. For example after a method invocation
- 
pushpush operand on stack
- 
swappublic void swap()swap two top level operands
- 
replacereplace top level element with new element of given type
- 
replacereplace n top level elements with new element of given type
- 
doGroovyCastdo Groovy cast for top level element
- 
doGroovyCast
- 
doAsType
- 
pushConstantload the constant on the operand stack.
- 
pushDynamicName
- 
loadOrStoreVariable
- 
storeVar
- 
load
- 
pushBoolpublic void pushBool(boolean inclusive)
- 
toStringpublic java.lang.String toString()- Overrides:
- toStringin class- java.lang.Object
 
- 
getTopOperand
 
-