Package ghidra.pcode.emu.jit.gen.var
Interface ValGen<V extends JitVal>
- Type Parameters:
V- the class op p-code value node in the use-def graph
- All Known Subinterfaces:
LocalVarGen<V>,MemoryVarGen<V>,VarGen<V>
- All Known Implementing Classes:
ConstValGen,DirectMemoryVarGen,InputVarGen,LocalOutVarGen,MemoryOutVarGen,MissingVarGen
public interface ValGen<V extends JitVal>
The bytecode generator for a specific value (operand) access.
The JitCodeGenerator selects the correct generator for each input operand using
lookup(JitVal) and each output operand VarGen.lookup(JitVar). The op generator
has already retrieved the JitOp whose operands are of the JitVal class.
| Varnode Type | Use-Def Type | Generator Type | Read Bytecodes / Methods | Write Bytecodes / Methods |
|---|---|---|---|---|
constant |
JitConstVal |
ConstValGen |
ldc |
|
unique,register |
JitInputVar,JitLocalOutVar,JitMissingVar |
InputVarGen,LocalOutVarGen |
See JitType.SimpleJitType.opcodeLoad():iload, lload, fload,
dload |
See JitType.SimpleJitType.opcodeStore():istore, lstore, fstore,
dstore |
memory |
JitDirectMemoryVar,JitMemoryOutVar |
DirectMemoryVarGen,MemoryOutVarGen |
readInt*,
readLong*, etc. |
writeInt*,
writeLong*, etc. |
| *indirect | JitIndirectMemoryVar |
None |
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidgenerateValInitCode(JitCodeGenerator gen, V v, org.objectweb.asm.MethodVisitor iv) Prepare any class-level items required to use this variablegenerateValReadCode(JitCodeGenerator gen, V v, JitTypeBehavior typeReq, org.objectweb.asm.MethodVisitor rv) Read the value onto the stacklookup(V v) Lookup the generator for a given p-code value use-def node
-
Method Details
-
lookup
Lookup the generator for a given p-code value use-def node- Type Parameters:
V- the class of the value- Parameters:
v- theJitValwhose generator to look up- Returns:
- the generator
-
generateValInitCode
Prepare any class-level items required to use this variableFor example, if this represents a direct memory variable, then this can prepare a reference to the portion of the state involved, allowing it to access it readily.
- Parameters:
gen- the code generatorv- the valueiv- the constructor visitor
-
generateValReadCode
JitType generateValReadCode(JitCodeGenerator gen, V v, JitTypeBehavior typeReq, org.objectweb.asm.MethodVisitor rv) Read the value onto the stack- Parameters:
gen- the code generatorv- the value to readtypeReq- the required type of the valuerv- the visitor for therunmethod- Returns:
- the actual p-code type (which determines the JVM type) of the value on the stack
-