Interface IntShiftBinOpGen<T extends JitIntBinOp>
- Type Parameters:
T- the class of p-code op node in the use-def graph
- All Known Implementing Classes:
IntLeftOpGen,IntRightOpGen,IntSRightOpGen
This is just going to invoke one of the JitCompiledPassage.intLeft(int, int),
JitCompiledPassage.intRight(int, int), JitCompiledPassage.intSRight(int, int), or
one of their overloaded methods, depending on the operand types.
-
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 <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.default <THIS extends JitCompiledPassage,N extends Emitter.Next>
Emitter<N> genShiftMpMp(Emitter<N> em, Local<Types.TRef<THIS>> localThis, JitCodeGenerator<THIS> gen, JitVar outVar, JitType.MpIntJitType outType, JitVal lVal, JitType.MpIntJitType lType, JitVal rVal, JitType.MpIntJitType rType, Scope scope, Methods.MthDesc<Types.TVoid, Emitter.Ent<Emitter.Ent<Emitter.Ent<Emitter.Ent<Emitter.Bot, Types.TRef<int[]>>, Types.TInt>, Types.TRef<int[]>>, Types.TRef<int[]>>> mdesc) The implementation when both operands are mp-intsdefault <THIS extends JitCompiledPassage,RT extends Types.BPrim<?>, RJT extends JitType.SimpleJitType<RT, RJT>, N extends Emitter.Next>
Emitter<N> genShiftMpPrim(Emitter<N> em, Local<Types.TRef<THIS>> localThis, JitCodeGenerator<THIS> gen, JitVar outVar, JitType.MpIntJitType outType, JitVal lVal, JitType.MpIntJitType lType, JitVal rVal, RJT rType, Scope scope, Methods.MthDesc<Types.TVoid, Emitter.Ent<Emitter.Ent<Emitter.Ent<Emitter.Ent<Emitter.Bot, Types.TRef<int[]>>, Types.TInt>, Types.TRef<int[]>>, RT>> mdesc) The implementation when the left operand is an mp-int and the right is a primitivedefault <THIS extends JitCompiledPassage,LT extends Types.BPrim<?>, LJT extends JitType.SimpleJitType<LT, LJT>, N extends Emitter.Next>
Emitter<N> genShiftPrimMp(Emitter<N> em, Local<Types.TRef<THIS>> localThis, JitCodeGenerator<THIS> gen, JitVar outVar, LJT outType, JitVal lVal, LJT lType, JitVal rVal, JitType.MpIntJitType rType, Scope scope, Methods.MthDesc<LT, Emitter.Ent<Emitter.Ent<Emitter.Bot, LT>, Types.TRef<int[]>>> mdesc) The implementation when the left operand is a primitive and the right operand is an mp-intdefault <THIS extends JitCompiledPassage,LT extends Types.BPrim<?>, LJT extends JitType.SimpleJitType<LT, LJT>, RT extends Types.BPrim<?>, RJT extends JitType.SimpleJitType<RT, RJT>, N extends Emitter.Next>
Emitter<N> genShiftPrimPrim(Emitter<N> em, Local<Types.TRef<THIS>> localThis, JitCodeGenerator<THIS> gen, JitVar outVar, LJT outType, JitVal lVal, LJT lType, JitVal rVal, RJT rType, Scope scope, Methods.MthDesc<LT, Emitter.Ent<Emitter.Ent<Emitter.Bot, LT>, RT>> mdesc) The implementation when both operands are simple primitivesThe name of the static method inJitCompiledPassageto invokedefault Opnd.ExtrExt()When loading the right operand, the kind of extension to applyMethods inherited from interface ghidra.pcode.emu.jit.gen.op.BinOpGen
ext, genMpDelegationToStaticMethod, isSigned
-
Method Details
-
rExt
When loading the right operand, the kind of extension to applyThe shift amount is always treated unsigned.
- Specified by:
rExtin interfaceBinOpGen<T extends JitIntBinOp>- Returns:
- the extension kind
-
methodName
String methodName()The name of the static method inJitCompiledPassageto invoke- Returns:
- the name
-
genShiftPrimPrim
default <THIS extends JitCompiledPassage,LT extends Types.BPrim<?>, Emitter<N> genShiftPrimPrimLJT extends JitType.SimpleJitType<LT, LJT>, RT extends Types.BPrim<?>, RJT extends JitType.SimpleJitType<RT, RJT>, N extends Emitter.Next> (Emitter<N> em, Local<Types.TRef<THIS>> localThis, JitCodeGenerator<THIS> gen, JitVar outVar, LJT outType, JitVal lVal, LJT lType, JitVal rVal, RJT rType, Scope scope, Methods.MthDesc<LT, Emitter.Ent<Emitter.Ent<Emitter.Bot, LT>, RT>> mdesc) The implementation when both operands are simple primitives- Type Parameters:
THIS- the type of the generated passageLT- the JVM type of the left operandLJT- the p-code type of the left operandRT- the JVM type of the right operandRJT- the p-code type of the right operandN- the incoming stack- Parameters:
em- the emitter typed with the incoming stacklocalThis- a handle to the local holding thethisreferencegen- the code generatoroutVar- the output operandoutType- the p-code type of the output valuelVal- the left operandlType- the p-code type of the left operandrVal- the right operandrType- the p-code type of the right operandscope- a scope for generating temporary local storagemdesc- the descriptor of the (overloaded) method- Returns:
- the emitter typed with the incoming stack
-
genShiftMpPrim
default <THIS extends JitCompiledPassage,RT extends Types.BPrim<?>, Emitter<N> genShiftMpPrimRJT extends JitType.SimpleJitType<RT, RJT>, N extends Emitter.Next> (Emitter<N> em, Local<Types.TRef<THIS>> localThis, JitCodeGenerator<THIS> gen, JitVar outVar, JitType.MpIntJitType outType, JitVal lVal, JitType.MpIntJitType lType, JitVal rVal, RJT rType, Scope scope, Methods.MthDesc<Types.TVoid, Emitter.Ent<Emitter.Ent<Emitter.Ent<Emitter.Ent<Emitter.Bot, Types.TRef<int[]>>, Types.TInt>, Types.TRef<int[]>>, RT>> mdesc) The implementation when the left operand is an mp-int and the right is a primitive- Type Parameters:
THIS- the type of the generated passageRT- the JVM type of the right operandRJT- the p-code type of the right operandN- the incoming stack- Parameters:
em- the emitter typed with the incoming stacklocalThis- a handle to the local holding thethisreferencegen- the code generatoroutVar- the output operandoutType- the p-code type of the output valuelVal- the left operandlType- the p-code type of the left operandrVal- the right operandrType- the p-code type of the right operandscope- a scope for generating temporary local storagemdesc- the descriptor of the (overloaded) method- Returns:
- the emitter typed with the incoming stack
-
genShiftPrimMp
default <THIS extends JitCompiledPassage,LT extends Types.BPrim<?>, Emitter<N> genShiftPrimMpLJT extends JitType.SimpleJitType<LT, LJT>, N extends Emitter.Next> (Emitter<N> em, Local<Types.TRef<THIS>> localThis, JitCodeGenerator<THIS> gen, JitVar outVar, LJT outType, JitVal lVal, LJT lType, JitVal rVal, JitType.MpIntJitType rType, Scope scope, Methods.MthDesc<LT, Emitter.Ent<Emitter.Ent<Emitter.Bot, LT>, Types.TRef<int[]>>> mdesc) The implementation when the left operand is a primitive and the right operand is an mp-int- Type Parameters:
THIS- the type of the generated passageLT- the JVM type of the left operandLJT- the p-code type of the left operandN- the incoming stack- Parameters:
em- the emitter typed with the incoming stacklocalThis- a handle to the local holding thethisreferencegen- the code generatoroutVar- the output operandoutType- the p-code type of the output valuelVal- the left operandlType- the p-code type of the left operandrVal- the right operandrType- the p-code type of the right operandscope- a scope for generating temporary local storagemdesc- the descriptor of the (overloaded) method- Returns:
- the emitter typed with the incoming stack
-
genShiftMpMp
default <THIS extends JitCompiledPassage,N extends Emitter.Next> Emitter<N> genShiftMpMp(Emitter<N> em, Local<Types.TRef<THIS>> localThis, JitCodeGenerator<THIS> gen, JitVar outVar, JitType.MpIntJitType outType, JitVal lVal, JitType.MpIntJitType lType, JitVal rVal, JitType.MpIntJitType rType, Scope scope, Methods.MthDesc<Types.TVoid, Emitter.Ent<Emitter.Ent<Emitter.Ent<Emitter.Ent<Emitter.Bot, Types.TRef<int[]>>, Types.TInt>, Types.TRef<int[]>>, Types.TRef<int[]>>> mdesc) The implementation when both operands are mp-ints- Type Parameters:
THIS- the type of the generated passageN- the incoming stack- Parameters:
em- the emitter typed with the incoming stacklocalThis- a handle to the local holding thethisreferencegen- the code generatoroutVar- the output operandoutType- the p-code type of the output valuelVal- the left operandlType- the p-code type of the left operandrVal- the right operandrType- the p-code type of the right operandscope- a scope for generating temporary local storagemdesc- the descriptor of the (overloaded) method- Returns:
- the emitter typed with the incoming stack
-
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) Emit 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.This reduces the implementation to just the name of the method to invoke. This will select the JVM signature of the method based on the p-code operand types.
- Specified by:
genRunin interfaceOpGen<T extends JitIntBinOp>- 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
-