Package ghidra.pcode.emu.jit.alloc
Record Class IntVarAlloc
java.lang.Object
java.lang.Record
ghidra.pcode.emu.jit.alloc.IntVarAlloc
- Record Components:
local- the JVM localtype- the p-code type
- All Implemented Interfaces:
SimpleVarHandler<Types.TInt,,JitType.IntJitType> VarHandler
public record IntVarAlloc(JvmLocal<Types.TInt,JitType.IntJitType> local, JitType.IntJitType type)
extends Record
implements SimpleVarHandler<Types.TInt,JitType.IntJitType>
The handler for a p-code variable allocated in one JVM
int.-
Constructor Summary
ConstructorsConstructorDescriptionIntVarAlloc(JvmLocal<Types.TInt, JitType.IntJitType> local, JitType.IntJitType type) Creates an instance of aIntVarAllocrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal 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.<N extends Emitter.Next>
Emitter<Emitter.Ent<N, Types.TInt>> genLoadToBool(Emitter<N> em, JitCodeGenerator<?> gen) Emit bytecode to load the varnode's value, interpreted as a boolean, as an integer onto the JVM stack.<N extends Emitter.Next>
Opnd.OpndEm<JitType.MpIntJitType, N> genLoadToOpnd(Emitter<N> em, JitCodeGenerator<?> gen, JitType.MpIntJitType type, Opnd.Ext ext, Scope scope) Emit bytecode to load the varnode's value into several locals.Opnd.MpToStackConv<Types.TInt, JitType.IntJitType, JitType.MpIntJitType, Types.TInt, JitType.IntJitType> Get the converter of multi-precision integers to the stack type of this handler's local.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.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface ghidra.pcode.emu.jit.alloc.SimpleVarHandler
genLoadLegToStackC1, genLoadLegToStackC2, genLoadToArray, genLoadToStack, genStoreFromArray, genStoreFromOpnd, genStoreFromStack, vnMethods inherited from interface ghidra.pcode.emu.jit.alloc.VarHandler
name
-
Constructor Details
-
Method Details
-
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
-
genLoadToOpnd
public <N extends Emitter.Next> Opnd.OpndEm<JitType.MpIntJitType,N> genLoadToOpnd(Emitter<N> em, JitCodeGenerator<?> gen, JitType.MpIntJitType type, Opnd.Ext ext, Scope scope) Description copied from interface:VarHandlerEmit bytecode to load the varnode's value into several locals.- Specified by:
genLoadToOpndin interfaceSimpleVarHandler<Types.TInt,JitType.IntJitType> - Specified by:
genLoadToOpndin 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 value expected on the JVM stack by the proceeding bytecodeext- the kind of extension to applyscope- a scope for generating temporary local storage- Returns:
- the operand containing the locals, and the emitter typed with the incoming stack
-
getConvToStack
public Opnd.MpToStackConv<Types.TInt,JitType.IntJitType, getConvToStack()JitType.MpIntJitType, Types.TInt, JitType.IntJitType> Description copied from interface:SimpleVarHandlerGet the converter of multi-precision integers to the stack type of this handler's local.Note that the converter need only extract the least 1 or 2 legs of the source multi-precision int, depending on the category of the destination's type. The converter knows how to handle both the operand (series of locals) and array forms.
- Specified by:
getConvToStackin interfaceSimpleVarHandler<Types.TInt,JitType.IntJitType> - Returns:
- the converter
-
genLoadToBool
public <N extends Emitter.Next> Emitter<Emitter.Ent<N,Types.TInt>> genLoadToBool(Emitter<N> em, JitCodeGenerator<?> gen) Description copied from interface:VarHandlerEmit bytecode to load the varnode's value, interpreted as a boolean, as an integer onto the JVM stack.- Specified by:
genLoadToBoolin interfaceVarHandler- Type Parameters:
N- the incoming stack- Parameters:
em- the emitter typed with the incoming stackgen- the code generator- Returns:
- the emitter typed with the resulting stack, i.e., having the int boolean 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. All components in this record class are compared withObjects::equals(Object,Object). -
local
Returns the value of thelocalrecord component.- Specified by:
localin interfaceSimpleVarHandler<Types.TInt,JitType.IntJitType> - Returns:
- the value of the
localrecord component
-
type
Returns the value of thetyperecord component.- Specified by:
typein interfaceSimpleVarHandler<Types.TInt,JitType.IntJitType> - Specified by:
typein interfaceVarHandler- Returns:
- the value of the
typerecord component
-