Package ghidra.pcode.emu.jit.gen.op
Interface IntPredBinOpGen<T extends JitBinOp>
- Type Parameters:
T- the class of p-code op node in the use-def graph
- All Known Subinterfaces:
IntCompareBinOpGen<T>
- All Known Implementing Classes:
IntCarryOpGen,IntEqualOpGen,IntLessEqualOpGen,IntLessOpGen,IntNotEqualOpGen,IntSBorrowOpGen,IntSCarryOpGen,IntSLessEqualOpGen,IntSLessOpGen
An extension for integer operators whose outputs are boolean
-
Nested Class Summary
Nested classes/interfaces inherited from interface ghidra.pcode.emu.jit.gen.op.BinOpGen
BinOpGen.TakeOutNested classes/interfaces inherited from interface ghidra.pcode.emu.jit.gen.op.OpGen
OpGen.DeadOpResult, OpGen.LiveOpResult, OpGen.OpResult -
Method Summary
Modifier and TypeMethodDescriptiondefault <N2 extends Emitter.Next,N1 extends Emitter.Ent<N2, Types.TInt>, N0 extends Emitter.Ent<N1, Types.TInt>>
Emitter<Emitter.Ent<N2, Types.TInt>> delegateIntFlagbit(Emitter<N0> em, JitType.IntJitType type, String methodName) An implementation for integer operands that delegates to a method onJitCompiledPassagedefault <N2 extends Emitter.Next,N1 extends Emitter.Ent<N2, Types.TLong>, N0 extends Emitter.Ent<N1, Types.TLong>>
Emitter<Emitter.Ent<N2, Types.TInt>> delegateLongFlagbit(Emitter<N0> em, JitType.LongJitType type, String methodName) An implementation for long operands that delegates to a method onJitCompiledPassagedefault <THIS extends JitCompiledPassage>
Emitter<Emitter.Ent<Emitter.Bot, Types.TInt>> delegateMpIntFlagbit(Emitter<Emitter.Bot> em, Local<Types.TRef<THIS>> localThis, JitCodeGenerator<THIS> gen, T op, JitType.MpIntJitType type, Scope scope, String methodName) An implementation for multi-precision integer operands that delegates to a method onJitCompiledPassagedefault <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, T op, JitControlFlowModel.JitBlock block, Scope scope) Emit bytecode into therunmethod.<THIS extends JitCompiledPassage>
Emitter<Emitter.Ent<Emitter.Bot, Types.TInt>> genRunMpInt(Emitter<Emitter.Bot> em, Local<Types.TRef<THIS>> localThis, JitCodeGenerator<THIS> gen, T op, JitType.MpIntJitType type, Scope scope) Emit the JVM bytecode to perform the operator with multi-precision operands.<N2 extends Emitter.Next,N1 extends Emitter.Ent<N2, Types.TInt>, N0 extends Emitter.Ent<N1, Types.TInt>>
Emitter<Emitter.Ent<N2, Types.TInt>> opForInt(Emitter<N0> em, JitType.IntJitType type) Emit the JVM bytecode to perform the operator with integer operands on the stack.<N2 extends Emitter.Next,N1 extends Emitter.Ent<N2, Types.TLong>, N0 extends Emitter.Ent<N1, Types.TLong>>
Emitter<Emitter.Ent<N2, Types.TInt>> opForLong(Emitter<N0> em, JitType.LongJitType type) Emit the JVM bytecode to perform the operator with long operands on the stack.Methods inherited from interface ghidra.pcode.emu.jit.gen.op.BinOpGen
ext, genMpDelegationToStaticMethod, isSigned, rExt
-
Method Details
-
opForInt
<N2 extends Emitter.Next,N1 extends Emitter.Ent<N2, Emitter<Emitter.Ent<N2,Types.TInt>, N0 extends Emitter.Ent<N1, Types.TInt>> Types.TInt>> opForInt(Emitter<N0> em, JitType.IntJitType type) Emit the JVM bytecode to perform the operator with integer operands on the stack.- Type Parameters:
N2- the tail of the incoming stackN1- the tail of the incoming stack including the right operandN0- the incoming stack with the right and left operands on top- Parameters:
em- the emitter typed with the incoming stacktype- the p-code type of the operands- Returns:
- the emitter typed with the resulting stack, i.e., the tail with the result pushed
-
delegateIntFlagbit
default <N2 extends Emitter.Next,N1 extends Emitter.Ent<N2, Emitter<Emitter.Ent<N2,Types.TInt>, N0 extends Emitter.Ent<N1, Types.TInt>> Types.TInt>> delegateIntFlagbit(Emitter<N0> em, JitType.IntJitType type, String methodName) An implementation for integer operands that delegates to a method onJitCompiledPassage- Type Parameters:
N2- the tail of the incoming stackN1- the tail of the incoming stack including the right operandN0- the incoming stack with the right and left operands on top- Parameters:
em- the emitter typed with the incoming stacktype- the p-code type of the operandsmethodName- the name of the method- Returns:
- the emitter typed with the resulting stack, i.e., the tail with the result pushed
-
opForLong
<N2 extends Emitter.Next,N1 extends Emitter.Ent<N2, Emitter<Emitter.Ent<N2,Types.TLong>, N0 extends Emitter.Ent<N1, Types.TLong>> Types.TInt>> opForLong(Emitter<N0> em, JitType.LongJitType type) Emit the JVM bytecode to perform the operator with long operands on the stack.- Type Parameters:
N2- the tail of the incoming stackN1- the tail of the incoming stack including the right operandN0- the incoming stack with the right and left operands on top- Parameters:
em- the emitter typed with the incoming stacktype- the p-code type of the operands- Returns:
- the emitter typed with the resulting stack, i.e., the tail with the result pushed
-
delegateLongFlagbit
default <N2 extends Emitter.Next,N1 extends Emitter.Ent<N2, Emitter<Emitter.Ent<N2,Types.TLong>, N0 extends Emitter.Ent<N1, Types.TLong>> Types.TInt>> delegateLongFlagbit(Emitter<N0> em, JitType.LongJitType type, String methodName) An implementation for long operands that delegates to a method onJitCompiledPassage- Type Parameters:
N2- the tail of the incoming stackN1- the tail of the incoming stack including the right operandN0- the incoming stack with the right and left operands on top- Parameters:
em- the emitter typed with the incoming stacktype- the p-code type of the operandsmethodName- the name of the method- Returns:
- the emitter typed with the resulting stack, i.e., the tail with the result pushed
-
genRunMpInt
<THIS extends JitCompiledPassage> Emitter<Emitter.Ent<Emitter.Bot,Types.TInt>> genRunMpInt(Emitter<Emitter.Bot> em, Local<Types.TRef<THIS>> localThis, JitCodeGenerator<THIS> gen, T op, JitType.MpIntJitType type, Scope scope) Emit the JVM bytecode to perform the operator with multi-precision operands.- Type Parameters:
THIS- the type of the generated passage- Parameters:
em- the emitter typed with the empty stacklocalThis- a handle to the local holding thethisreferencegen- the code generatorop- the p-code optype- the p-code type of the operandsscope- a scope for generating temporary local storage- Returns:
- the emitter typed with the resulting stack, i.e., containing only the result
-
delegateMpIntFlagbit
default <THIS extends JitCompiledPassage> Emitter<Emitter.Ent<Emitter.Bot,Types.TInt>> delegateMpIntFlagbit(Emitter<Emitter.Bot> em, Local<Types.TRef<THIS>> localThis, JitCodeGenerator<THIS> gen, T op, JitType.MpIntJitType type, Scope scope, String methodName) An implementation for multi-precision integer operands that delegates to a method onJitCompiledPassage- Type Parameters:
THIS- the type of the generated passage- Parameters:
em- the emitter typed with the empty stacklocalThis- a handle to the local holding thethisreferencegen- the code generatorop- the p-code optype- the p-code type of the operandsscope- a scope for generating temporary local storagemethodName- the name of the method- Returns:
- the emitter typed with the resulting stack, i.e., containing only the result
-
genRun
default <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, T 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<T extends JitBinOp>- 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
-