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 aFieldForVarnode
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.void
generateClinitCode
(JitCodeGenerator gen, org.objectweb.asm.ClassVisitor cv, org.objectweb.asm.MethodVisitor sv) Emit the field declaration and its initialization bytecodevoid
generateLoadCode
(JitCodeGenerator gen, org.objectweb.asm.MethodVisitor rv) Emit code to load the field onto the JVM stackfinal int
hashCode()
Returns a hash code value for this object.name()
Derive a suitable name for the fieldfinal String
toString()
Returns a string representation of this record class.vn()
Returns the value of thevn
record component.
-
Constructor Details
-
FieldForVarnode
Creates an instance of aFieldForVarnode
record class.- Parameters:
vn
- the value for thevn
record component
-
-
Method Details
-
name
Description copied from interface:FieldReq
Derive 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
Varnode
VARNODE_ram_400000_4 =createVarnode
(ADDRESS_FACTORY, "ram", 0x400000, 4);- Specified by:
generateClinitCode
in 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 theVarnode
instance. 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:
generateLoadCode
in interfaceFieldReq
- Parameters:
gen
- the code generatorrv
- the visitor often for therun
method, 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 thevn
record component.- Returns:
- the value of the
vn
record component
-