Package de.mirkosertic.bytecoder.core.ir
Class Graph
- java.lang.Object
-
- de.mirkosertic.bytecoder.core.ir.Graph
-
public class Graph extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<Fixup>
fixups
private java.util.Map<java.lang.String,Region>
labeledRegions
private Logger
logger
private java.util.List<Node>
nodes
static java.lang.String
START_REGION_NAME
private java.util.Map<org.objectweb.asm.tree.AbstractInsnNode,InstructionTranslation>
translations
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFixup(Fixup fixup)
void
applyFixups(java.util.Map<org.objectweb.asm.tree.AbstractInsnNode,java.util.Map<org.objectweb.asm.tree.AbstractInsnNode,EdgeType>> incomingEdgesPerInstruction)
void
deleteNode(Node node)
Add
newAdd(org.objectweb.asm.Type type)
And
newAND(org.objectweb.asm.Type type)
ArrayLength
newArrayLength()
ArrayLoad
newArrayLoad(org.objectweb.asm.Type type)
ArrayStore
newArrayStore()
BootstrapMethod
newBootstrapMethod(org.objectweb.asm.Type methodType, org.objectweb.asm.Type className, java.lang.String methodName, Reference.Kind kind)
Cast
newCast(org.objectweb.asm.Type type)
CaughtException
newCaughtException(org.objectweb.asm.Type type)
ReadClassField
newClassFieldExpression(org.objectweb.asm.Type type, ResolvedField resolvedField)
ClassInitialization
newClassInitialization(org.objectweb.asm.Type type)
CMP
newCMP()
Copy
newCopy()
Div
newDiv(org.objectweb.asm.Type type)
PrimitiveDouble
newDouble(double constant)
EnumValuesOf
newEnumValuesOf(org.objectweb.asm.Type type)
FieldReference
newFieldReference(ResolvedField field, Reference.Kind kind)
PrimitiveFloat
newFloat(float constant)
FrameDebugInfo
newFrameDebugInfo(Frame frame)
Goto
newGoto()
If
newIf()
ReadInstanceField
newInstanceFieldExpression(org.objectweb.asm.Type type, ResolvedField resolvedField)
InstanceOf
newInstanceOf()
PrimitiveInt
newInt(int value)
InvokeDynamicExpression
newInvokeDynamicExpression(org.objectweb.asm.Type type)
LineNumberDebugInfo
newLineNumberDebugInfo(int lineNumber)
PrimitiveLong
newLong(long constant)
LookupSwitch
newLookupSwitch()
MethodArgument
newMethodArgument(org.objectweb.asm.Type type, int index)
MethodInvocation
newMethodInvocation(InvocationType invocationType, org.objectweb.asm.tree.MethodInsnNode insn, ResolvedMethod rm)
MethodInvocationExpression
newMethodInvocationExpression(InvocationType invocationType, org.objectweb.asm.tree.MethodInsnNode insn, ResolvedMethod rm)
MethodReference
newMethodReference(ResolvedMethod method, Reference.Kind kind)
MethodType
newMethodType(org.objectweb.asm.Type type)
MonitorEnter
newMonitorEnter()
MonitorExit
newMonitorExit()
Mul
newMul(org.objectweb.asm.Type type)
Neg
newNEG(org.objectweb.asm.Type type)
New
newNew(org.objectweb.asm.Type type)
NewArray
newNewArray(org.objectweb.asm.Type arrayType)
Nop
newNop()
NullReference
newNullReference()
NullTest
newNullTest(NullTest.Operation operation)
NumericalTest
newNumericalTest(NumericalTest.Operation operation)
ObjectString
newObjectString(StringConstant value)
Or
newOR(org.objectweb.asm.Type type)
PHI
newPHI(org.objectweb.asm.Type type)
PrimitiveClassReference
newPrimitiveClassReference(org.objectweb.asm.Type type)
ReferenceTest
newReferenceTest(ReferenceTest.Operation operation)
Region
newRegion(java.lang.String label)
Reinterpret
newReinterpret(org.objectweb.asm.Type type)
Rem
newRem(org.objectweb.asm.Type type)
ResolveCallsite
newResolveCallsite()
Return
newReturnNothing()
ReturnValue
newReturnValue()
RuntimeClass
newRuntimeClass()
RuntimeClassOf
newRuntimeTypeOf()
SetClassField
newSetClassField(ResolvedField resolvedField)
SetInstanceField
newSetInstanceField(ResolvedField resolvedField)
SHL
newSHL(org.objectweb.asm.Type type)
PrimitiveShort
newShort(short value)
SHR
newSHR(org.objectweb.asm.Type type)
Sub
newSub(org.objectweb.asm.Type type)
TableSwitch
newTableSwitch(int min, int max)
This
newThis(org.objectweb.asm.Type type)
TryCatch
newTryCatch(java.lang.String label)
TypeConversion
newTypeConversion(org.objectweb.asm.Type type)
TypeReference
newTypeReference(org.objectweb.asm.Type type)
Unwind
newUnwind()
USHR
newUSHR(org.objectweb.asm.Type type)
Variable
newVariable(org.objectweb.asm.Type type)
XOr
newXOR(org.objectweb.asm.Type type)
java.util.List<Node>
nodes()
Region
regionByLabel(java.lang.String label)
Node
register(Node n)
void
registerTranslation(org.objectweb.asm.tree.AbstractInsnNode instruction, InstructionTranslation translation)
void
remapDataFlow(Node original, Node newValue)
InstructionTranslation
translationFor(org.objectweb.asm.tree.AbstractInsnNode instruction)
void
writeDebugTo(java.io.OutputStream fileOutputStream)
-
-
-
Field Detail
-
START_REGION_NAME
public static final java.lang.String START_REGION_NAME
- See Also:
- Constant Field Values
-
nodes
private final java.util.List<Node> nodes
-
translations
private final java.util.Map<org.objectweb.asm.tree.AbstractInsnNode,InstructionTranslation> translations
-
fixups
private final java.util.List<Fixup> fixups
-
labeledRegions
private final java.util.Map<java.lang.String,Region> labeledRegions
-
logger
private final Logger logger
-
-
Constructor Detail
-
Graph
public Graph(Logger logger)
-
-
Method Detail
-
addFixup
public void addFixup(Fixup fixup)
-
applyFixups
public void applyFixups(java.util.Map<org.objectweb.asm.tree.AbstractInsnNode,java.util.Map<org.objectweb.asm.tree.AbstractInsnNode,EdgeType>> incomingEdgesPerInstruction)
-
registerTranslation
public void registerTranslation(org.objectweb.asm.tree.AbstractInsnNode instruction, InstructionTranslation translation)
-
translationFor
public InstructionTranslation translationFor(org.objectweb.asm.tree.AbstractInsnNode instruction)
-
nodes
public java.util.List<Node> nodes()
-
regionByLabel
public Region regionByLabel(java.lang.String label)
-
newThis
public This newThis(org.objectweb.asm.Type type)
-
newMethodArgument
public MethodArgument newMethodArgument(org.objectweb.asm.Type type, int index)
-
newNullReference
public NullReference newNullReference()
-
newInt
public PrimitiveInt newInt(int value)
-
newShort
public PrimitiveShort newShort(short value)
-
newNewArray
public NewArray newNewArray(org.objectweb.asm.Type arrayType)
-
newIf
public If newIf()
-
newUSHR
public USHR newUSHR(org.objectweb.asm.Type type)
-
newSHR
public SHR newSHR(org.objectweb.asm.Type type)
-
newSHL
public SHL newSHL(org.objectweb.asm.Type type)
-
newNEG
public Neg newNEG(org.objectweb.asm.Type type)
-
newAND
public And newAND(org.objectweb.asm.Type type)
-
newOR
public Or newOR(org.objectweb.asm.Type type)
-
newXOR
public XOr newXOR(org.objectweb.asm.Type type)
-
newObjectString
public ObjectString newObjectString(StringConstant value)
-
newMethodInvocation
public MethodInvocation newMethodInvocation(InvocationType invocationType, org.objectweb.asm.tree.MethodInsnNode insn, ResolvedMethod rm)
-
newMethodInvocationExpression
public MethodInvocationExpression newMethodInvocationExpression(InvocationType invocationType, org.objectweb.asm.tree.MethodInsnNode insn, ResolvedMethod rm)
-
newReturnNothing
public Return newReturnNothing()
-
newReturnValue
public ReturnValue newReturnValue()
-
newAdd
public Add newAdd(org.objectweb.asm.Type type)
-
newArrayStore
public ArrayStore newArrayStore()
-
newArrayLoad
public ArrayLoad newArrayLoad(org.objectweb.asm.Type type)
-
newSub
public Sub newSub(org.objectweb.asm.Type type)
-
newDiv
public Div newDiv(org.objectweb.asm.Type type)
-
newMul
public Mul newMul(org.objectweb.asm.Type type)
-
newTypeConversion
public TypeConversion newTypeConversion(org.objectweb.asm.Type type)
-
writeDebugTo
public void writeDebugTo(java.io.OutputStream fileOutputStream)
-
newPHI
public PHI newPHI(org.objectweb.asm.Type type)
-
newVariable
public Variable newVariable(org.objectweb.asm.Type type)
-
newCopy
public Copy newCopy()
-
newCast
public Cast newCast(org.objectweb.asm.Type type)
-
newNop
public Nop newNop()
-
newCaughtException
public CaughtException newCaughtException(org.objectweb.asm.Type type)
-
newGoto
public Goto newGoto()
-
newCMP
public CMP newCMP()
-
newRem
public Rem newRem(org.objectweb.asm.Type type)
-
newRegion
public Region newRegion(java.lang.String label)
-
newTryCatch
public TryCatch newTryCatch(java.lang.String label)
-
newUnwind
public Unwind newUnwind()
-
newMonitorEnter
public MonitorEnter newMonitorEnter()
-
newMonitorExit
public MonitorExit newMonitorExit()
-
newArrayLength
public ArrayLength newArrayLength()
-
newTypeReference
public TypeReference newTypeReference(org.objectweb.asm.Type type)
-
newNew
public New newNew(org.objectweb.asm.Type type)
-
newInstanceOf
public InstanceOf newInstanceOf()
-
newTableSwitch
public TableSwitch newTableSwitch(int min, int max)
-
newLookupSwitch
public LookupSwitch newLookupSwitch()
-
newInstanceFieldExpression
public ReadInstanceField newInstanceFieldExpression(org.objectweb.asm.Type type, ResolvedField resolvedField)
-
newClassFieldExpression
public ReadClassField newClassFieldExpression(org.objectweb.asm.Type type, ResolvedField resolvedField)
-
newSetInstanceField
public SetInstanceField newSetInstanceField(ResolvedField resolvedField)
-
newSetClassField
public SetClassField newSetClassField(ResolvedField resolvedField)
-
deleteNode
public void deleteNode(Node node)
-
newFloat
public PrimitiveFloat newFloat(float constant)
-
newDouble
public PrimitiveDouble newDouble(double constant)
-
newLong
public PrimitiveLong newLong(long constant)
-
newLineNumberDebugInfo
public LineNumberDebugInfo newLineNumberDebugInfo(int lineNumber)
-
newFrameDebugInfo
public FrameDebugInfo newFrameDebugInfo(Frame frame)
-
newMethodReference
public MethodReference newMethodReference(ResolvedMethod method, Reference.Kind kind)
-
newFieldReference
public FieldReference newFieldReference(ResolvedField field, Reference.Kind kind)
-
newResolveCallsite
public ResolveCallsite newResolveCallsite()
-
newMethodType
public MethodType newMethodType(org.objectweb.asm.Type type)
-
newInvokeDynamicExpression
public InvokeDynamicExpression newInvokeDynamicExpression(org.objectweb.asm.Type type)
-
newNumericalTest
public NumericalTest newNumericalTest(NumericalTest.Operation operation)
-
newNullTest
public NullTest newNullTest(NullTest.Operation operation)
-
newReferenceTest
public ReferenceTest newReferenceTest(ReferenceTest.Operation operation)
-
newRuntimeClass
public RuntimeClass newRuntimeClass()
-
newPrimitiveClassReference
public PrimitiveClassReference newPrimitiveClassReference(org.objectweb.asm.Type type)
-
newRuntimeTypeOf
public RuntimeClassOf newRuntimeTypeOf()
-
newEnumValuesOf
public EnumValuesOf newEnumValuesOf(org.objectweb.asm.Type type)
-
newReinterpret
public Reinterpret newReinterpret(org.objectweb.asm.Type type)
-
newBootstrapMethod
public BootstrapMethod newBootstrapMethod(org.objectweb.asm.Type methodType, org.objectweb.asm.Type className, java.lang.String methodName, Reference.Kind kind)
-
newClassInitialization
public ClassInitialization newClassInitialization(org.objectweb.asm.Type type)
-
-