Package ghidra.pcode.emu.jit.gen.var
Record Class VarGen.BlockTransition<THIS extends JitCompiledPassage>
java.lang.Object
java.lang.Record
ghidra.pcode.emu.jit.gen.var.VarGen.BlockTransition<THIS>
- Type Parameters:
THIS- the type of the generated class- Record Components:
localThis- a handle tothisgen- the code generatortoRetire- the varnodes to retire on the transitiontoBirth- the varnodes to birth on the transition
public static record VarGen.BlockTransition<THIS extends JitCompiledPassage>(Local<Types.TRef<THIS extends JitCompiledPassage>> localThis, JitCodeGenerator<THIS extends JitCompiledPassage> gen, Set<Varnode> toRetire, Set<Varnode> toBirth)
extends Record
A means to emit bytecode on transitions between
blocks-
Constructor Summary
ConstructorsConstructorDescriptionBlockTransition(Local<Types.TRef<THIS>> localThis, JitCodeGenerator<THIS> gen) Construct a "nop" or blank transition.BlockTransition(Local<Types.TRef<THIS>> localThis, JitCodeGenerator<THIS> 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.<N extends Emitter.Next>
Emitter<N> Emit bytecode for the transition<N extends Emitter.Next>
Emitter<N> Emit bytecode for the reverse transitionfinal inthashCode()Returns a hash code value for this object.Returns the value of thelocalThisrecord component.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:
localThis- a handle tothisgen- the code generator
-
BlockTransition
public BlockTransition(Local<Types.TRef<THIS>> localThis, JitCodeGenerator<THIS> gen, Set<Varnode> toRetire, Set<Varnode> toBirth) 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
-
genFwd
Emit bytecode for the transition- Type Parameters:
N- the tail of the stack (...)- Parameters:
em- the emitter- Returns:
- the emitter with ...
-
genInv
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. (genFwd(Emitter)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.- Type Parameters:
N- the tail of the stack (...)- Parameters:
em- the emitter- Returns:
- the emitter with ...
-
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). -
localThis
Returns the value of thelocalThisrecord component.- Returns:
- the value of the
localThisrecord component
-
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
-