Class JitDataFlowState

java.lang.Object
ghidra.pcode.emu.jit.analysis.JitDataFlowState
All Implemented Interfaces:
PcodeExecutorState<JitVal>, PcodeExecutorStatePiece<JitVal,JitVal>

public class JitDataFlowState extends Object implements PcodeExecutorState<JitVal>
An implementation of PcodeExecutorState for per-block data flow interpretation

In p-code interpretation, this interface's purpose is to store the current value of varnodes in the emulation/interpretation state. Here we implement it using T:=JitVal, and track the latest variable definition of vanodes in the data flow interpretation. The adaptation is fairly straightforward, except when varnode accesses do not match their latest definitions exactly, e.g., an access of EAX when the latest definition is for RAX. Thus, this state object may synthesize subpiece and catenate ops to model the "off-cut" use of one or more such definitions. Additionally, in preparation for inter-block data flow analysis, when no definition is present for a varnode (or part of a varnode) access, this state will synthesize phi ops. See setVar and getVar for details.

This state only serves to analyze data flow through register and unique variables. Because we know these are only accessible to the thread, we stand to save much execution time by bypassing the JitBytesPcodeExecutorState at run time. We can accomplish this by mapping these variables to suitable JVM local variables. Thus, we have one map of entries for register space and another for unique space. Accesses to other spaces do not mutate or read from either of those maps, but this class may generate a suitable JitVal for the use-def graph.