Package ghidra.pcode.emu.jit.gen

# Record Class FieldForUserop

java.lang.Object
java.lang.Record
ghidra.pcode.emu.jit.gen.FieldForUserop

Record Components:
  `userop` - the definition to pre-fetch

All Implemented Interfaces:
  `FieldReq`, `InstanceFieldReq`

public record FieldForUserop(PcodeUseropLibrary.PcodeUseropDefinition<?> userop) extends Record implements InstanceFieldReq
A field request for a pre-fetched userop definition

These are used to invoke userops using the Standard or Direct strategies.

See Also:
  - `JitDataFlowUseropLibrary`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FieldForUserop(PcodeUseropLibrary.PcodeUseropDefinition<?> userop)`
  Creates an instance of a `FieldForUserop` record class.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `final boolean`
  `equals(Object o)`
  Indicates whether some other object is "equal to" this one.
  `void`
  `generateInitCode(JitCodeGenerator gen, org.objectweb.asm.ClassVisitor cv, org.objectweb.asm.MethodVisitor iv)`
  Emit the field declaration and its initialization bytecode
  `void`
  `generateLoadCode(JitCodeGenerator gen, org.objectweb.asm.MethodVisitor rv)`
  Emit code to load the field onto the JVM stack
  `final int`
  `hashCode()`
  Returns a hash code value for this object.
  `String`
  `name()`
  Derive a suitable name for the field
  `final String`
  `toString()`
  Returns a string representation of this record class.
  `PcodeUseropLibrary.PcodeUseropDefinition<?>`
  `userop()`
  Returns the value of the `userop` record component.

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### FieldForUserop

    public FieldForUserop(PcodeUseropLibrary.PcodeUseropDefinition<?> userop)
    Creates an instance of a `FieldForUserop` record class.
    Parameters:
      `userop` - the value for the `userop` record component

- ## Method Details

  - ### name

    public String name()
    Description copied from interface: `FieldReq`
    Derive a suitable name for the field
    Specified by:
      `name` in interface `FieldReq`
    Returns:
      the name

  - ### generateInitCode

    public void generateInitCode(JitCodeGenerator gen, org.objectweb.asm.ClassVisitor cv, org.objectweb.asm.MethodVisitor iv)
    Emit the field declaration and its initialization bytecode

    The declaration is emitted into the class definition, and the initialization code is emitted into the class constructor.

    Consider the userop `syscall()`. The declaration is equivalent to:

         private final PcodeUseropLibrary.PcodeUseropDefinition userop_syscall;

    And the initialization is equivalent to:

         userop_syscall = getUseropdDefinition("syscall");

    Specified by:
      `generateInitCode` in interface `InstanceFieldReq`
    Parameters:
      `gen` - the code generator
      `cv` - the visitor for the class definition
      `iv` - the visitor for the class constructor

  - ### generateLoadCode

    public void generateLoadCode(JitCodeGenerator gen, org.objectweb.asm.MethodVisitor rv)
    Description copied from interface: `FieldReq`
    Emit code to load the field onto the JVM stack
    Specified by:
      `generateLoadCode` in interface `FieldReq`
    Parameters:
      `gen` - the code generator
      `rv` - the visitor often for the `run` method, but could be the static initializer or constructor

  - ### toString

    public final String 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.
    Specified by:
      `toString` in class `Record`
    Returns:
      a string representation of this object

  - ### 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.
    Specified by:
      `hashCode` in class `Record`
    Returns:
      a hash code value for this object

  - ### equals

    public final boolean equals(Object o)
    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 with `Objects::equals(Object,Object)`.
    Specified by:
      `equals` in class `Record`
    Parameters:
      `o` - the object with which to compare
    Returns:
      `true` if this object is the same as the `o` argument; `false` otherwise.

  - ### userop

    public PcodeUseropLibrary.PcodeUseropDefinition<?> userop()
    Returns the value of the `userop` record component.
    Returns:
      the value of the `userop` record component