Enum Class StoreOpGen
- All Implemented Interfaces:
OpGen<JitStoreOp>,Serializable,Comparable<StoreOpGen>,Constable
store.
These ops are currently presumed to be indirect memory accesses. TODO: If we fold constants, we could convert some of these to direct.
We request a field to pre-fetch the space and emit code
to load it onto the stack. We then emit code to load the offset onto the stack and convert it to
a JVM long, if necessary. The varnode size is loaded by emitting an
ldc. We must now emit code to load the value and convert it to a
byte array. The conversion depends on the type of the value. Finally, we emit an invocation of
JitBytesPcodeExecutorStatePiece.JitBytesPcodeExecutorStateSpace.write(long, byte[], int, int).
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>Nested classes/interfaces inherited from interface ghidra.pcode.emu.jit.gen.op.OpGen
OpGen.DeadOpResult, OpGen.LiveOpResult, OpGen.OpResult -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescription<THIS extends JitCompiledPassage>
OpGen.OpResultgenRun(Emitter<Emitter.Bot> em, Local<Types.TRef<THIS>> localThis, Local<Types.TInt> localCtxmod, Methods.RetReq<Types.TRef<JitCompiledPassage.EntryPoint>> retReq, JitCodeGenerator<THIS> gen, JitStoreOp op, JitControlFlowModel.JitBlock block, Scope scope) Emit bytecode into therunmethod.static StoreOpGenReturns the enum constant of this class with the specified name.static StoreOpGen[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
GEN
The generator singleton
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
genRun
public <THIS extends JitCompiledPassage> OpGen.OpResult genRun(Emitter<Emitter.Bot> em, Local<Types.TRef<THIS>> localThis, Local<Types.TInt> localCtxmod, Methods.RetReq<Types.TRef<JitCompiledPassage.EntryPoint>> retReq, JitCodeGenerator<THIS> gen, JitStoreOp op, JitControlFlowModel.JitBlock block, Scope scope) Description copied from interface:OpGenEmit bytecode into therunmethod.This method must emit the code needed to load any input operands, convert them to the appropriate type, perform the actual operation, and then if applicable, store the output operand. The implementations should delegate to
JitCodeGenerator.genReadToStack(Emitter, Local, JitVal, ghidra.pcode.emu.jit.analysis.JitType.SimpleJitType, Ext),JitCodeGenerator.genWriteFromStack(Emitter, Local, JitVar, ghidra.pcode.emu.jit.analysis.JitType.SimpleJitType, Ext, Scope)or similar for mp-int types.- Specified by:
genRunin interfaceOpGen<JitStoreOp>- Type Parameters:
THIS- the type of the generated passage- Parameters:
em- the emitter typed with the empty stacklocalThis- a handle to the local holding thethisreferencelocalCtxmod- a handle to the local holdingctxmodretReq- an indication of what must be returned by thisJitCompiledPassage.run(int)method.gen- the code generatorop- the p-code op (use-def node) to translateblock- the basic block containing the p-code opscope- a scope for generating temporary local storage- Returns:
- the result of emitting the p-code op's bytecode
-