Package io.airlift.bytecode
Class BytecodeBlock
- java.lang.Object
-
- io.airlift.bytecode.BytecodeBlock
-
- All Implemented Interfaces:
BytecodeNode
@NotThreadSafe public class BytecodeBlock extends Object implements BytecodeNode
-
-
Constructor Summary
Constructors Constructor Description BytecodeBlock()
-
Method Summary
-
-
-
Method Detail
-
getDescription
public String getDescription()
-
setDescription
public BytecodeBlock setDescription(String description)
-
getChildNodes
public List<BytecodeNode> getChildNodes()
- Specified by:
getChildNodesin interfaceBytecodeNode
-
append
public BytecodeBlock append(BytecodeNode node)
-
comment
public BytecodeBlock comment(String comment)
-
comment
public BytecodeBlock comment(String comment, Object... args)
-
isEmpty
public boolean isEmpty()
-
visitLabel
public BytecodeBlock visitLabel(LabelNode label)
-
gotoLabel
public BytecodeBlock gotoLabel(LabelNode label)
-
ifFalseGoto
public BytecodeBlock ifFalseGoto(LabelNode label)
-
ifTrueGoto
public BytecodeBlock ifTrueGoto(LabelNode label)
-
ifZeroGoto
public BytecodeBlock ifZeroGoto(LabelNode label)
-
ifNotZeroGoto
public BytecodeBlock ifNotZeroGoto(LabelNode label)
-
ifNullGoto
public BytecodeBlock ifNullGoto(LabelNode label)
-
ifNotNullGoto
public BytecodeBlock ifNotNullGoto(LabelNode label)
-
intAdd
public BytecodeBlock intAdd()
-
longAdd
public BytecodeBlock longAdd()
-
longCompare
public BytecodeBlock longCompare()
-
doubleCompareNanLess
public BytecodeBlock doubleCompareNanLess()
Compare two doubles. If either is NaN comparison is -1.
-
doubleCompareNanGreater
public BytecodeBlock doubleCompareNanGreater()
Compare two doubles. If either is NaN comparison is 1.
-
intLeftShift
public BytecodeBlock intLeftShift()
-
intRightShift
public BytecodeBlock intRightShift()
-
longLeftShift
public BytecodeBlock longLeftShift()
-
longRightShift
public BytecodeBlock longRightShift()
-
unsignedIntRightShift
public BytecodeBlock unsignedIntRightShift()
-
unsignedLongRightShift
public BytecodeBlock unsignedLongRightShift()
-
intBitAnd
public BytecodeBlock intBitAnd()
-
intBitOr
public BytecodeBlock intBitOr()
-
intBitXor
public BytecodeBlock intBitXor()
-
longBitAnd
public BytecodeBlock longBitAnd()
-
longBitOr
public BytecodeBlock longBitOr()
-
longBitXor
public BytecodeBlock longBitXor()
-
intNegate
public BytecodeBlock intNegate()
-
intToLong
public BytecodeBlock intToLong()
-
longNegate
public BytecodeBlock longNegate()
-
longToInt
public BytecodeBlock longToInt()
-
isInstanceOf
public BytecodeBlock isInstanceOf(Class<?> type)
-
isInstanceOf
public BytecodeBlock isInstanceOf(ParameterizedType type)
-
checkCast
public BytecodeBlock checkCast(Class<?> type)
-
checkCast
public BytecodeBlock checkCast(ParameterizedType type)
-
invokeStatic
public BytecodeBlock invokeStatic(Method method)
-
invokeStatic
public BytecodeBlock invokeStatic(MethodDefinition method)
-
invokeStatic
public BytecodeBlock invokeStatic(Class<?> type, String name, Class<?> returnType, Class<?>... parameterTypes)
-
invokeStatic
public BytecodeBlock invokeStatic(Class<?> type, String name, Class<?> returnType, Iterable<Class<?>> parameterTypes)
-
invokeStatic
public BytecodeBlock invokeStatic(ParameterizedType type, String name, ParameterizedType returnType, ParameterizedType... parameterTypes)
-
invokeStatic
public BytecodeBlock invokeStatic(ParameterizedType type, String name, ParameterizedType returnType, Iterable<ParameterizedType> parameterTypes)
-
invokeVirtual
public BytecodeBlock invokeVirtual(Method method)
-
invokeVirtual
public BytecodeBlock invokeVirtual(MethodDefinition method)
-
invokeVirtual
public BytecodeBlock invokeVirtual(Class<?> type, String name, Class<?> returnType, Class<?>... parameterTypes)
-
invokeVirtual
public BytecodeBlock invokeVirtual(Class<?> type, String name, Class<?> returnType, Iterable<Class<?>> parameterTypes)
-
invokeVirtual
public BytecodeBlock invokeVirtual(ParameterizedType type, String name, ParameterizedType returnType, ParameterizedType... parameterTypes)
-
invokeVirtual
public BytecodeBlock invokeVirtual(ParameterizedType type, String name, ParameterizedType returnType, Iterable<ParameterizedType> parameterTypes)
-
invokeInterface
public BytecodeBlock invokeInterface(Method method)
-
invokeInterface
public BytecodeBlock invokeInterface(MethodDefinition method)
-
invokeInterface
public BytecodeBlock invokeInterface(Class<?> type, String name, Class<?> returnType, Class<?>... parameterTypes)
-
invokeInterface
public BytecodeBlock invokeInterface(Class<?> type, String name, Class<?> returnType, Iterable<Class<?>> parameterTypes)
-
invokeInterface
public BytecodeBlock invokeInterface(ParameterizedType type, String name, ParameterizedType returnType, ParameterizedType... parameterTypes)
-
invokeInterface
public BytecodeBlock invokeInterface(ParameterizedType type, String name, ParameterizedType returnType, Iterable<ParameterizedType> parameterTypes)
-
invokeConstructor
public BytecodeBlock invokeConstructor(Constructor<?> constructor)
-
invokeConstructor
public BytecodeBlock invokeConstructor(Class<?> type, Class<?>... parameterTypes)
-
invokeConstructor
public BytecodeBlock invokeConstructor(Class<?> type, Iterable<Class<?>> parameterTypes)
-
invokeConstructor
public BytecodeBlock invokeConstructor(ParameterizedType type, ParameterizedType... parameterTypes)
-
invokeConstructor
public BytecodeBlock invokeConstructor(ParameterizedType type, Iterable<ParameterizedType> parameterTypes)
-
invokeSpecial
public BytecodeBlock invokeSpecial(Method method)
-
invokeSpecial
public BytecodeBlock invokeSpecial(MethodDefinition method)
-
invokeSpecial
public BytecodeBlock invokeSpecial(Class<?> type, String name, Class<?> returnType, Class<?>... parameterTypes)
-
invokeSpecial
public BytecodeBlock invokeSpecial(Class<?> type, String name, Class<?> returnType, Iterable<Class<?>> parameterTypes)
-
invokeSpecial
public BytecodeBlock invokeSpecial(ParameterizedType type, String name, ParameterizedType returnType, ParameterizedType... parameterTypes)
-
invokeSpecial
public BytecodeBlock invokeSpecial(ParameterizedType type, String name, ParameterizedType returnType, Iterable<ParameterizedType> parameterTypes)
-
invokeDynamic
public BytecodeBlock invokeDynamic(String name, MethodType methodType, Method bootstrapMethod, Object... defaultBootstrapArguments)
-
invokeDynamic
public BytecodeNode invokeDynamic(String name, ParameterizedType returnType, Iterable<ParameterizedType> parameterTypes, Method bootstrapMethod, List<Object> bootstrapArgs)
-
ret
public BytecodeBlock ret(Class<?> type)
-
ret
public BytecodeBlock ret()
-
retObject
public BytecodeBlock retObject()
-
retFloat
public BytecodeBlock retFloat()
-
retDouble
public BytecodeBlock retDouble()
-
retBoolean
public BytecodeBlock retBoolean()
-
retLong
public BytecodeBlock retLong()
-
retInt
public BytecodeBlock retInt()
-
throwObject
public BytecodeBlock throwObject()
-
newObject
public BytecodeBlock newObject(Class<?> type)
-
newObject
public BytecodeBlock newObject(ParameterizedType type)
-
newArray
public BytecodeBlock newArray(Class<?> type)
-
dup
public BytecodeBlock dup()
-
dup
public BytecodeBlock dup(Class<?> type)
-
pop
public BytecodeBlock pop()
-
pop
public BytecodeBlock pop(Class<?> type)
-
pop
public BytecodeBlock pop(ParameterizedType type)
-
swap
public BytecodeBlock swap()
-
getField
public BytecodeBlock getField(Field field)
-
getField
public BytecodeBlock getField(FieldDefinition field)
-
getField
public BytecodeBlock getField(Class<?> target, String fieldName, Class<?> fieldType)
-
getField
public BytecodeBlock getField(ParameterizedType target, String fieldName, ParameterizedType fieldType)
-
putField
public BytecodeBlock putField(Field field)
-
putField
public BytecodeBlock putField(Class<?> target, String fieldName, Class<?> fieldType)
-
putField
public BytecodeBlock putField(FieldDefinition field)
-
putField
public BytecodeBlock putField(ParameterizedType target, String fieldName, ParameterizedType fieldType)
-
getStaticField
public BytecodeBlock getStaticField(FieldDefinition field)
-
getStaticField
public BytecodeBlock getStaticField(Field field)
-
getStaticField
public BytecodeBlock getStaticField(Class<?> target, String fieldName, Class<?> fieldType)
-
getStaticField
public BytecodeBlock getStaticField(ParameterizedType target, String fieldName, ParameterizedType fieldType)
-
getStaticField
public BytecodeBlock getStaticField(ParameterizedType target, FieldDefinition field)
-
putStaticField
public BytecodeBlock putStaticField(FieldDefinition field)
-
putStaticField
public BytecodeBlock putStaticField(ParameterizedType target, FieldDefinition field)
-
putStaticField
public BytecodeBlock putStaticField(ParameterizedType target, String fieldName, ParameterizedType fieldType)
-
pushNull
public BytecodeBlock pushNull()
-
push
public BytecodeBlock push(Class<?> type)
-
push
public BytecodeBlock push(ParameterizedType type)
-
push
public BytecodeBlock push(String value)
-
push
public BytecodeBlock push(Number value)
-
push
public BytecodeBlock push(int value)
-
push
public BytecodeBlock push(boolean value)
-
pushJavaDefault
public BytecodeBlock pushJavaDefault(Class<?> type)
-
initializeVariable
public BytecodeBlock initializeVariable(Variable variable)
-
getVariable
public BytecodeBlock getVariable(Variable variable)
-
putVariable
public BytecodeBlock putVariable(Variable variable)
-
putVariable
public BytecodeBlock putVariable(Variable variable, Class<?> type)
-
putVariable
public BytecodeBlock putVariable(Variable variable, ParameterizedType type)
-
putVariable
public BytecodeBlock putVariable(Variable variable, String value)
-
putVariable
public BytecodeBlock putVariable(Variable variable, Number value)
-
putVariable
public BytecodeBlock putVariable(Variable variable, int value)
-
putVariable
public BytecodeBlock putVariable(Variable variable, boolean value)
-
incrementVariable
public BytecodeBlock incrementVariable(Variable variable, byte increment)
-
getObjectArrayElement
public BytecodeBlock getObjectArrayElement()
-
putObjectArrayElement
public BytecodeBlock putObjectArrayElement()
-
getIntArrayElement
public BytecodeBlock getIntArrayElement()
-
putIntArrayElement
public BytecodeBlock putIntArrayElement()
-
visitLineNumber
public BytecodeBlock visitLineNumber(int currentLineNumber)
-
accept
public void accept(org.objectweb.asm.MethodVisitor visitor, MethodGenerationContext generationContext)- Specified by:
acceptin interfaceBytecodeNode
-
accept
public <T> T accept(BytecodeNode parent, BytecodeVisitor<T> visitor)
- Specified by:
acceptin interfaceBytecodeNode
-
-