Package ghidra.pcode.emu.jit.alloc
Record Class LongInLongHandler
java.lang.Object
java.lang.Record
ghidra.pcode.emu.jit.alloc.LongInLongHandler
- Record Components:
local- seelocal()type- seetype()vn- seevn()(wrt. the sub variable)byteShift- seebyteShift()
- All Implemented Interfaces:
SubInLongHandler<Types.TLong,,JitType.LongJitType> SubVarHandler<Types.TLong,,JitType.LongJitType, Types.TLong, JitType.LongJitType> VarHandler
public record LongInLongHandler(JvmLocal<Types.TLong,JitType.LongJitType> local, JitType.LongJitType type, Varnode vn, int byteShift)
extends Record
implements SubInLongHandler<Types.TLong,JitType.LongJitType>
The handler for an
long p-code variable stored in part of a JVM long.-
Constructor Summary
ConstructorsConstructorDescriptionLongInLongHandler(JvmLocal<Types.TLong, JitType.LongJitType> local, JitType.LongJitType type, Varnode vn, int byteShift) Creates an instance of aLongInLongHandlerrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thebyteShiftrecord component.final booleanIndicates whether some other object is "equal to" this one.<N extends Emitter.Next>
Emitter<Emitter.Ent<N, Types.TInt>> genLoadLegToStack(Emitter<N> em, JitCodeGenerator<?> gen, JitType.MpIntJitType type, int leg, Opnd.Ext ext) Emit bytecode to load one leg of a multi-precision value from the varnode onto the JVM stack.<TT extends Types.BPrim<?>,TJT extends JitType.SimpleJitType<TT, TJT>, N extends Emitter.Next>
Emitter<Emitter.Ent<N, TT>> genLoadToStack(Emitter<N> em, JitCodeGenerator<?> gen, TJT type, Opnd.Ext ext) Emit bytecode to load the varnode's value onto the JVM stack.Opnd.MpToStackConv<Types.TInt, JitType.IntJitType, JitType.MpIntJitType, Types.TLong, JitType.LongJitType> Get the converter of multi-precision integers to the type of the sub variable.final inthashCode()Returns a hash code value for this object.local()Returns the value of thelocalrecord component.Create a handler for aPcodeOp.SUBPIECEof a value.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.vn()Returns the value of thevnrecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface ghidra.pcode.emu.jit.alloc.SubInLongHandler
genLoadToBool, genStoreFromStackMethods inherited from interface ghidra.pcode.emu.jit.alloc.SubVarHandler
assertShiftFits, bitShift, bitSize, genLoadToArray, genLoadToOpnd, genStoreFromArray, genStoreFromOpnd, intMask, longMaskMethods inherited from interface ghidra.pcode.emu.jit.alloc.VarHandler
name
-
Constructor Details
-
LongInLongHandler
public LongInLongHandler(JvmLocal<Types.TLong, JitType.LongJitType> local, JitType.LongJitType type, Varnode vn, int byteShift) Creates an instance of aLongInLongHandlerrecord class.
-
-
Method Details
-
getConvToSub
public Opnd.MpToStackConv<Types.TInt,JitType.IntJitType, getConvToSub()JitType.MpIntJitType, Types.TLong, JitType.LongJitType> Description copied from interface:SubVarHandlerGet the converter of multi-precision integers to the type of the sub variable.The converter need not worry about positioning or masking wrt. the sub variable. It should extract from the multi-precision integer the minimum number of legs needed to fill the sub variable, i.e., it need only consider the sub variable's size. This handler will then mask and position it within the containing variable for storage.
- Specified by:
getConvToSubin interfaceSubVarHandler<Types.TLong,JitType.LongJitType, Types.TLong, JitType.LongJitType> - Returns:
- the converter
-
genLoadToStack
public <TT extends Types.BPrim<?>,TJT extends JitType.SimpleJitType<TT, Emitter<Emitter.Ent<N,TJT>, N extends Emitter.Next> TT>> genLoadToStack(Emitter<N> em, JitCodeGenerator<?> gen, TJT type, Opnd.Ext ext) Description copied from interface:VarHandlerEmit bytecode to load the varnode's value onto the JVM stack.- Specified by:
genLoadToStackin interfaceVarHandler- Type Parameters:
TT- the JVM type of the value to load onto the stackTJT- the p-code type of the value to load onto the stackN- the incoming stack- Parameters:
em- the emitter typed with the incoming stackgen- the code generatortype- the p-code type of the value expected on the JVM stack by the proceeding bytecodeext- the kind of extension to apply when adjusting from JVM size to varnode size- Returns:
- the emitter typed with the resulting stack
-
genLoadLegToStack
public <N extends Emitter.Next> Emitter<Emitter.Ent<N,Types.TInt>> genLoadLegToStack(Emitter<N> em, JitCodeGenerator<?> gen, JitType.MpIntJitType type, int leg, Opnd.Ext ext) Description copied from interface:VarHandlerEmit bytecode to load one leg of a multi-precision value from the varnode onto the JVM stack.- Specified by:
genLoadLegToStackin interfaceVarHandler- Type Parameters:
N- the incoming stack- Parameters:
em- the emitter typed with the incoming stackgen- the code generatortype- the p-code type of the complete multi-precision valueleg- the index of the leg to load, 0 being least significantext- the kind of extension to apply- Returns:
- the emitter typed with the resulting stack, i.e., having the int leg pushed onto it
-
subpiece
Description copied from interface:VarHandlerCreate a handler for aPcodeOp.SUBPIECEof a value.To implement
subpiece, we could load the entire varnode and then extract the designated portion. Or, we could load only the designated portion, averting any code and execution cost of loading the un-designated portions. We accomplish this by re-writing the subpiece op and a load of the sub-varnode.- Specified by:
subpiecein interfaceVarHandler- Parameters:
endian- the endianness of the emulation targetbyteOffset- the number of least-significant bytes to removemaxByteSize- the maximum size of the resulting variable. In general, a subpiece should never exceed the size of the parent varnode, but if it does, this will truncate that excess.- Returns:
- the resulting subpiece handler
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
local
Returns the value of thelocalrecord component.- Specified by:
localin interfaceSubVarHandler<Types.TLong,JitType.LongJitType, Types.TLong, JitType.LongJitType> - Returns:
- the value of the
localrecord component
-
type
Returns the value of thetyperecord component.- Specified by:
typein interfaceSubVarHandler<Types.TLong,JitType.LongJitType, Types.TLong, JitType.LongJitType> - Specified by:
typein interfaceVarHandler- Returns:
- the value of the
typerecord component
-
vn
Returns the value of thevnrecord component.- Specified by:
vnin interfaceVarHandler- Returns:
- the value of the
vnrecord component
-
byteShift
public int byteShift()Returns the value of thebyteShiftrecord component.- Specified by:
byteShiftin interfaceSubVarHandler<Types.TLong,JitType.LongJitType, Types.TLong, JitType.LongJitType> - Returns:
- the value of the
byteShiftrecord component
-