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>fixupsprivate intimportLabelCounterprivate java.util.Map<java.lang.String,Region>labeledRegionsprivate Loggerloggerprivate java.util.List<Node>nodesstatic java.lang.StringSTART_REGION_NAMEprivate java.util.Map<org.objectweb.asm.tree.AbstractInsnNode,InstructionTranslation>translationsprivate java.util.Map<org.objectweb.asm.Type,TypeReference>typeReferences
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddFixup(Fixup fixup)voidapplyFixups(java.util.Map<org.objectweb.asm.tree.AbstractInsnNode,java.util.Map<org.objectweb.asm.tree.AbstractInsnNode,EdgeType>> incomingEdgesPerInstruction)(package private) voiddeleteFromControlFlowInternally(ControlTokenConsumer consumer)voiddeleteNode(Node node)AddnewAdd(org.objectweb.asm.Type type)AndnewAND(org.objectweb.asm.Type type)ArrayLengthnewArrayLength()ArrayLoadnewArrayLoad(org.objectweb.asm.Type type)ArrayStorenewArrayStore()BootstrapMethodnewBootstrapMethod(org.objectweb.asm.Type methodType, org.objectweb.asm.Type className, java.lang.String methodName, Reference.Kind kind)CastnewCast(org.objectweb.asm.Type type)CaughtExceptionnewCaughtException(org.objectweb.asm.Type type)ReadClassFieldnewClassFieldExpression(org.objectweb.asm.Type type, ResolvedField resolvedField)ClassInitializationnewClassInitialization(org.objectweb.asm.Type type)CMPnewCMP()CopynewCopy()DivnewDiv(org.objectweb.asm.Type type)PrimitiveDoublenewDouble(double constant)EnumValuesOfnewEnumValuesOf(org.objectweb.asm.Type type)FieldReferencenewFieldReference(ResolvedField field, Reference.Kind kind)PrimitiveFloatnewFloat(float constant)FrameDebugInfonewFrameDebugInfo(Frame frame)GotonewGoto()IfnewIf()ReadInstanceFieldnewInstanceFieldExpression(org.objectweb.asm.Type type, ResolvedField resolvedField)InstanceOfnewInstanceOf()PrimitiveIntnewInt(int value)InvokeDynamicExpressionnewInvokeDynamicExpression(org.objectweb.asm.Type type)LineNumberDebugInfonewLineNumberDebugInfo(java.lang.String sourceFile, int lineNumber)PrimitiveLongnewLong(long constant)LookupSwitchnewLookupSwitch()MethodArgumentnewMethodArgument(org.objectweb.asm.Type type, int index)MethodInvocationnewMethodInvocation(InvocationType invocationType, org.objectweb.asm.tree.MethodInsnNode insn, ResolvedMethod rm)MethodInvocationExpressionnewMethodInvocationExpression(InvocationType invocationType, org.objectweb.asm.tree.MethodInsnNode insn, ResolvedMethod rm)MethodReferencenewMethodReference(ResolvedMethod method, Reference.Kind kind)MethodTypenewMethodType(org.objectweb.asm.Type type)MonitorEnternewMonitorEnter()MonitorExitnewMonitorExit()MulnewMul(org.objectweb.asm.Type type)NegnewNEG(org.objectweb.asm.Type type)NewnewNew(org.objectweb.asm.Type type)NewArraynewNewArray(org.objectweb.asm.Type arrayType)NopnewNop()NullReferencenewNullReference()NullTestnewNullTest(NullTest.Operation operation)NumericalTestnewNumericalTest(NumericalTest.Operation operation)ObjectStringnewObjectString(StringConstant value)OrnewOR(org.objectweb.asm.Type type)PHInewPHI(org.objectweb.asm.Type type)PrimitiveClassReferencenewPrimitiveClassReference(org.objectweb.asm.Type type)ReferenceTestnewReferenceTest(ReferenceTest.Operation operation)RegionnewRegion(java.lang.String label)ReinterpretnewReinterpret(org.objectweb.asm.Type type)RemnewRem(org.objectweb.asm.Type type)ResolveCallsitenewResolveCallsite()ReturnnewReturnNothing()ReturnValuenewReturnValue()RuntimeClassnewRuntimeClass()RuntimeClassOfnewRuntimeTypeOf()SetClassFieldnewSetClassField(ResolvedField resolvedField)SetInstanceFieldnewSetInstanceField(ResolvedField resolvedField)SHLnewSHL(org.objectweb.asm.Type type)PrimitiveShortnewShort(short value)SHRnewSHR(org.objectweb.asm.Type type)RegionnewStartRegion()SubnewSub(org.objectweb.asm.Type type)TableSwitchnewTableSwitch(int min, int max)ThisnewThis(org.objectweb.asm.Type type)TryCatchnewTryCatch(java.lang.String label)TypeConversionnewTypeConversion(org.objectweb.asm.Type type)TypeReferencenewTypeReference(org.objectweb.asm.Type type)UnwindnewUnwind()USHRnewUSHR(org.objectweb.asm.Type type)VariablenewVariable(org.objectweb.asm.Type type)XOrnewXOR(org.objectweb.asm.Type type)java.util.List<Node>nodes()Node[]outgoingDataFlowsFor(Node n)RegionregionByLabel(java.lang.String label)Noderegister(Node n)voidregisterTranslation(org.objectweb.asm.tree.AbstractInsnNode instruction, InstructionTranslation translation)voidremapDataFlow(Node original, Node newValue)voidreplaceInControlFlow(ControlTokenConsumer source, ControlTokenConsumer target)voidsanityCheck()java.util.Map<Node,Node>stampFrom(Graph source, Node thisRef, Node[] arguments)InstructionTranslationtranslationFor(org.objectweb.asm.tree.AbstractInsnNode instruction)voidwriteDebugTo(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
-
typeReferences
private final java.util.Map<org.objectweb.asm.Type,TypeReference> typeReferences
-
importLabelCounter
private int importLabelCounter
-
-
Constructor Detail
-
Graph
public Graph(Logger logger)
-
-
Method Detail
-
newStartRegion
public Region newStartRegion()
-
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(java.lang.String sourceFile, 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)
-
deleteFromControlFlowInternally
void deleteFromControlFlowInternally(ControlTokenConsumer consumer)
-
replaceInControlFlow
public void replaceInControlFlow(ControlTokenConsumer source, ControlTokenConsumer target)
-
sanityCheck
public void sanityCheck()
-
-