Package ghidra.pcode.emu.jit.gen.var
Record Class VarGen.BlockTransition
java.lang.Object
java.lang.Record
ghidra.pcode.emu.jit.gen.var.VarGen.BlockTransition
- Record Components:
gen- the code generatortoRetire- the varnodes to retire on the transitiontoBirth- the varnodes to birth on the transition
public static record VarGen.BlockTransition(JitCodeGenerator gen, Set<Varnode> toRetire, Set<Varnode> toBirth)
extends Record
A means to emit bytecode on transitions between
blocks-
Constructor Summary
ConstructorsConstructorDescriptionConstruct a "nop" or blank transition.BlockTransition(JitCodeGenerator gen, Set<Varnode> toRetire, Set<Varnode> toBirth) Creates an instance of aBlockTransitionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.gen()Returns the value of thegenrecord component.voidgenerate(org.objectweb.asm.MethodVisitor rv) Emit bytecode for the transitionvoidgenerateInv(org.objectweb.asm.MethodVisitor rv) Emit bytecode for the reverse transitionfinal inthashCode()Returns a hash code value for this object.booleanneeded()Check if a transition is actually needed.toBirth()Returns the value of thetoBirthrecord component.toRetire()Returns the value of thetoRetirerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
BlockTransition
Construct a "nop" or blank transition.The transition is mutable, so it's common to create one in this fashion and then populate it.
- Parameters:
gen- the code generator
-
BlockTransition
Creates an instance of aBlockTransitionrecord class.
-
-
Method Details
-
needed
public boolean needed()Check if a transition is actually needed.When a transition is not needed, some smaller control-flow constructs (e.g., in
CBranchOpGen) can be averted.- Returns:
- true if bytecode must be emitted
-
generate
public void generate(org.objectweb.asm.MethodVisitor rv) Emit bytecode for the transition- Parameters:
rv- the visitor for therunmethod
-
generateInv
public void generateInv(org.objectweb.asm.MethodVisitor rv) Emit bytecode for the reverse transitionSometimes "transitions" are used around hazards, notably
CallOtherOpGen. This method is used after the hazard to restore the live variables in scope. (generate(MethodVisitor)is used before the hazard.) Variables that were retired and re-birthed here. There should not have been any variables birthed going into the hazard.- Parameters:
rv- the visitor for therunmethod
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
gen
Returns the value of thegenrecord component.- Returns:
- the value of the
genrecord component
-
toRetire
Returns the value of thetoRetirerecord component.- Returns:
- the value of the
toRetirerecord component
-
toBirth
Returns the value of thetoBirthrecord component.- Returns:
- the value of the
toBirthrecord component
-