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
-
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
-
hashCode
-
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
-
toRetire
-
toBirth
-