Package ghidra.pcode.emu.jit.gen
Record Class FieldForVarnode
java.lang.Object
java.lang.Record
ghidra.pcode.emu.jit.gen.FieldForVarnode
- Record Components:
vn- the varnode to pre-construct
- All Implemented Interfaces:
FieldReq,StaticFieldReq
A field request for a pre-constructed varnode
These are used to invoke userops using the Standard strategy.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of aFieldForVarnoderecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.voidgenerateClinitCode(JitCodeGenerator gen, org.objectweb.asm.ClassVisitor cv, org.objectweb.asm.MethodVisitor sv) Emit the field declaration and its initialization bytecodevoidgenerateLoadCode(JitCodeGenerator gen, org.objectweb.asm.MethodVisitor rv) Emit code to load the field onto the JVM stackfinal inthashCode()Returns a hash code value for this object.name()Derive a suitable name for the fieldfinal StringtoString()Returns a string representation of this record class.vn()Returns the value of thevnrecord component.
-
Constructor Details
-
FieldForVarnode
Creates an instance of aFieldForVarnoderecord class.- Parameters:
vn- the value for thevnrecord component
-
-
Method Details
-
name
Description copied from interface:FieldReqDerive a suitable name for the field -
generateClinitCode
public void generateClinitCode(JitCodeGenerator gen, org.objectweb.asm.ClassVisitor cv, org.objectweb.asm.MethodVisitor sv) Emit the field declaration and its initialization bytecodeThe declaration is emitted into the class definition, and the initialization code is emitted into the class initializer.
Consider the varnode (ram:00400000,4). The code is equivalent to:
private static final
VarnodeVARNODE_ram_400000_4 =createVarnode(ADDRESS_FACTORY, "ram", 0x400000, 4);- Specified by:
generateClinitCodein interfaceStaticFieldReq- Parameters:
gen- the code generatorcv- the visitor for the class definitionsv- the visitor for the class (static) initializer
-
generateLoadCode
Emit code to load the field onto the JVM stackTo clarify, this does not load a varnode's current value onto the JVM stack. That is done by
VarGen. This loads a ref to theVarnodeinstance. Also, it's not precisely the same instance as given, but a re-construction of it as a plainVarnode, i.e., just the (space,offset,size) triple.- Specified by:
generateLoadCodein interfaceFieldReq- Parameters:
gen- the code generatorrv- the visitor often for therunmethod, but could be the static initializer or constructor
-
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). -
vn
Returns the value of thevnrecord component.- Returns:
- the value of the
vnrecord component
-