Record Class FieldForArrDirect

java.lang.Object
java.lang.Record
ghidra.pcode.emu.jit.gen.FieldForArrDirect
Record Components:
address - the address contained by the page to pre-fetch
All Implemented Interfaces:
FieldReq, InstanceFieldReq

public record FieldForArrDirect(Address address) extends Record implements InstanceFieldReq
A field request for a pre-fetched page from the JitBytesPcodeExecutorStatePiece.JitBytesPcodeExecutorStateSpace.

The field is used for direct memory accesses. For those, the address space and fixed address is given in the p-code, so we are able to pre-fetch the page and access it directly at run time.

  • Constructor Details

    • FieldForArrDirect

      public FieldForArrDirect(Address address)
      Creates an instance of a FieldForArrDirect record class.
      Parameters:
      address - the value for the address 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 address ram:00600000. The declaration is equivalent to:

       private final byte[] arrDir_ram_600000;
       

      And the initialization is equivalent to:

       arrDir_ram_600000 =
              state.getForSpace(ADDRESS_FACTORY.getAddressSpace(ramId)).getDirect(0x600000);
       
      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.
    • address

      public Address address()
      Returns the value of the address record component.
      Returns:
      the value of the address record component