Package org.codehaus.groovy.classgen.asm
Class OperandStack
java.lang.Object
org.codehaus.groovy.classgen.asm.OperandStack
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbox()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.voidvoiddoGroovyCast(ClassNode targetType) do Groovy cast for top level elementvoidvoiddup()duplicate top elementintorg.objectweb.asm.Labeljump(int ifIns) voidjump(int ifIns, org.objectweb.asm.Label label) voidvoidloadOrStoreVariable(BytecodeVariable variable, boolean useReferenceDirectly) voidpop()remove operand stack top element using bytecode popvoidpopDownTo(int elements) voidpush 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 top level element with new element of given typevoidreplace n top level elements with new element of given typevoidstoreVar(BytecodeVariable variable) voidswap()swap two top level operandstoString()
-
Constructor Details
-
OperandStack
-
-
Method Details
-
getStackLength
public int getStackLength() -
popDownTo
public void popDownTo(int elements) -
castToBool
public 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 -
pop
public void pop()remove operand stack top element using bytecode pop -
jump
public org.objectweb.asm.Label jump(int ifIns) -
jump
public void jump(int ifIns, org.objectweb.asm.Label label) -
dup
public void dup()duplicate top element -
box
-
remove
public void remove(int amount) Remove amount elements from the operand stack, without using pop. For example after a method invocation -
push
push operand on stack -
swap
public void swap()swap two top level operands -
replace
replace top level element with new element of given type -
replace
replace n top level elements with new element of given type -
doGroovyCast
do Groovy cast for top level element -
doGroovyCast
-
doAsType
-
pushConstant
load the constant on the operand stack. -
pushDynamicName
-
loadOrStoreVariable
-
storeVar
-
load
-
pushBool
public void pushBool(boolean inclusive) -
toString
-
getTopOperand
-