Package ghidra.pcode.emu.jit.alloc
Record Class JvmLocal<T extends Types.BPrim<?>,JT extends JitType.SimpleJitType<T,JT>>
java.lang.Object
java.lang.Record
ghidra.pcode.emu.jit.alloc.JvmLocal<T,JT>
- Type Parameters:
T- the JVM type of this localJT- the p-code type of this local- Record Components:
local- the declared local this wrapstype- a type for this localvn- the varnode whose value this local holdsopnd- this local as an operand
public record JvmLocal<T extends Types.BPrim<?>,JT extends JitType.SimpleJitType<T,JT>> (Local<T extends Types.BPrim<?>> local, JT extends JitType.SimpleJitType<T,JT> type, Varnode vn, SimpleOpnd<T extends Types.BPrim<?>,JT extends JitType.SimpleJitType<T,JT>> opnd)
extends Record
An allocated JVM local
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<TT extends Types.BPrim<?>,TJT extends JitType.SimpleJitType<TT, TJT>>
JvmLocal<TT, TJT> castOf(TJT type) Cast this local to satisfy checkers when a type variable is known to be of a given typefinal booleanIndicates whether some other object is "equal to" this one.<THIS extends JitCompiledPassage,N extends Emitter.Next>
Emitter<N> genBirthCode(Emitter<N> em, Local<Types.TRef<THIS>> localThis, JitCodeGenerator<THIS> gen) Emit bytecode to bring this varnode into scope.<N extends Emitter.Next>
Emitter<N> genInit(Emitter<N> em, JitCodeGenerator<?> gen) Emit bytecode into the class constructor needed to access the varnode's actual value from the underlyingPcodeExecutorState.<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 this local's value onto the JVM stack as the given type<THIS extends JitCompiledPassage,N extends Emitter.Next>
Emitter<N> genRetireCode(Emitter<N> em, Local<Types.TRef<THIS>> localThis, JitCodeGenerator<THIS> gen) Emit bytecode to take this varnode out of scope.<FT extends Types.BPrim<?>,FJT extends JitType.SimpleJitType<FT, FJT>, N1 extends Emitter.Next, N0 extends Emitter.Ent<N1, FT>>
Emitter<N1> genStoreFromStack(Emitter<N0> em, JitCodeGenerator<?> gen, FJT type, Opnd.Ext ext, Scope scope) Emit bytecode to store the value on the JVM stack into the localfinal inthashCode()Returns a hash code value for this object.local()Returns the value of thelocalrecord component.Returns the maximum address that would be occupied by the full primitive type.name()Get the name of the wrapped localstatic <T extends Types.BPrim<?>,JT extends JitType.SimpleJitType<T, JT>>
JvmLocal<T, JT> Create aJvmLocalwith the given local, type, and varnodeopnd()Returns the value of theopndrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.vn()Returns the value of thevnrecord component.
-
Constructor Details
-
Method Details
-
of
public static <T extends Types.BPrim<?>,JT extends JitType.SimpleJitType<T, JvmLocal<T,JT>> JT> of(Local<T> local, JT type, Varnode vn) Create aJvmLocalwith the given local, type, and varnode- Type Parameters:
T- the JVM type of the localJT- the p-code type of the local- Parameters:
local- the localtype- the p-code type of the localvn- the varnode to assign to the local- Returns:
- the new local (wrapper)
-
name
Get the name of the wrapped local- Returns:
- the name
-
castOf
public <TT extends Types.BPrim<?>,TJT extends JitType.SimpleJitType<TT, JvmLocal<TT,TJT>> TJT> castOf(TJT type) Cast this local to satisfy checkers when a type variable is known to be of a given typeThis will verify at runtime that the types are in fact identical.
- Type Parameters:
TT- the "to" JVM typeTJT- the "to" p-code type- Parameters:
type- the "to" p-code type- Returns:
- this local as the given type
-
genInit
Emit bytecode into the class constructor needed to access the varnode's actual value from the underlyingPcodeExecutorState.- Type Parameters:
N- the incoming stack- Parameters:
em- the emitter typed with the incoming stackgen- the code generator- Returns:
- the emitter typed with the incoming stack
-
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) Emit bytecode to load this local's value onto the JVM stack as the given type- Type Parameters:
TT- the desired JVM typeTJT- the desired p-code typeN- the incoming stack- Parameters:
em- the emitter typed with the incoming stackgen- the code generatortype- the desired p-code typeext- the kind of extension to apply- Returns:
- the emitter typed with the resulting stack, i.e., having pushed the value
-
genStoreFromStack
public <FT extends Types.BPrim<?>,FJT extends JitType.SimpleJitType<FT, Emitter<N1> genStoreFromStackFJT>, N1 extends Emitter.Next, N0 extends Emitter.Ent<N1, FT>> (Emitter<N0> em, JitCodeGenerator<?> gen, FJT type, Opnd.Ext ext, Scope scope) Emit bytecode to store the value on the JVM stack into the local- Type Parameters:
FT- the JVM type of the value on the stackFJT- the p-code type of the value on the stackN1- the tail of the incoming stackN0- the incoming stack with the value on top- Parameters:
em- the emitter typed with the incoming stackgen- the code generatortype- the p-code type of the value on the stackext- the kind of extension to applyscope- a scope for generating temporary local storage- Returns:
- the emitter typed with the resulting stack, i.e., having popped the value
-
genBirthCode
public <THIS extends JitCompiledPassage,N extends Emitter.Next> Emitter<N> genBirthCode(Emitter<N> em, Local<Types.TRef<THIS>> localThis, JitCodeGenerator<THIS> gen) Emit bytecode to bring this varnode into scope.This will copy the value from the
stateinto the local variable.- Type Parameters:
THIS- the type of the compiled passageN- the incoming stack- Parameters:
em- the emitter typed with the incoming stacklocalThis- a handle to the local holding thethisreferencegen- the code generator- Returns:
- the emitter typed with the incoming stack
-
genRetireCode
public <THIS extends JitCompiledPassage,N extends Emitter.Next> Emitter<N> genRetireCode(Emitter<N> em, Local<Types.TRef<THIS>> localThis, JitCodeGenerator<THIS> gen) Emit bytecode to take this varnode out of scope.This will copy the value from the local variable into the
state.- Type Parameters:
THIS- the type of the compiled passageN- the incoming stack- Parameters:
em- the emitter typed with the incoming stacklocalThis- a handle to the local holding thethisreferencegen- the code generator- Returns:
- the emitter typed with the incoming stack
-
maxPrimAddr
Returns the maximum address that would be occupied by the full primitive type.- Returns:
- the maximum address that would be occupied by the full primitive type
-
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.- Returns:
- the value of the
localrecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
vn
Returns the value of thevnrecord component.- Returns:
- the value of the
vnrecord component
-
opnd
Returns the value of theopndrecord component.- Returns:
- the value of the
opndrecord component
-