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 aBlockTransition
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.gen()
Returns the value of thegen
record component.void
generate
(org.objectweb.asm.MethodVisitor rv) Emit bytecode for the transitionvoid
generateInv
(org.objectweb.asm.MethodVisitor rv) Emit bytecode for the reverse transitionfinal int
hashCode()
Returns a hash code value for this object.boolean
needed()
Check if a transition is actually needed.toBirth()
Returns the value of thetoBirth
record component.toRetire()
Returns the value of thetoRetire
record component.final String
toString()
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 aBlockTransition
record 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 therun
method
-
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 therun
method
-
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 thegen
record component.- Returns:
- the value of the
gen
record component
-
toRetire
Returns the value of thetoRetire
record component.- Returns:
- the value of the
toRetire
record component
-
toBirth
Returns the value of thetoBirth
record component.- Returns:
- the value of the
toBirth
record component
-