Package ghidra.pcode.emu.jit

# Class JitBytesPcodeExecutorStatePiece

java.lang.Object
ghidra.pcode.exec.AbstractLongOffsetPcodeExecutorStatePiece<byte[],byte[],JitBytesPcodeExecutorStatePiece.JitBytesPcodeExecutorStateSpace>
ghidra.pcode.exec.AbstractBytesPcodeExecutorStatePiece<JitBytesPcodeExecutorStatePiece.JitBytesPcodeExecutorStateSpace>
ghidra.pcode.emu.jit.JitBytesPcodeExecutorStatePiece

All Implemented Interfaces:
  `PcodeExecutorStatePiece<byte[],byte[]>`

public class JitBytesPcodeExecutorStatePiece extends AbstractBytesPcodeExecutorStatePiece<JitBytesPcodeExecutorStatePiece.JitBytesPcodeExecutorStateSpace>
The state piece for `JitDefaultBytesPcodeExecutorState`

This provides access to the internals so that translated passages can pre-fetch certain objects to optimize state accesses.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `class`
  `JitBytesPcodeExecutorStatePiece.JitBytesPcodeExecutorStateSpace`
  An object to manage state for a specific `AddressSpace`

  ## Nested classes/interfaces inherited from class ghidra.pcode.exec.AbstractBytesPcodeExecutorStatePiece

  `AbstractBytesPcodeExecutorStatePiece.StateMemBuffer`

  ## Nested classes/interfaces inherited from interface ghidra.pcode.exec.PcodeExecutorStatePiece

  `PcodeExecutorStatePiece.Reason`

- ## Field Summary

  ### Fields inherited from class ghidra.pcode.exec.AbstractBytesPcodeExecutorStatePiece

  `spaceMap`

  ### Fields inherited from class ghidra.pcode.exec.AbstractLongOffsetPcodeExecutorStatePiece

  `addressArithmetic, arithmetic, cb, language, uniqueSpace`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `JitBytesPcodeExecutorStatePiece(Language language, PcodeStateCallbacks cb)`
  Construct a state piece

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `clear()`
  Erase the entire state or piece
  `JitBytesPcodeExecutorStatePiece.JitBytesPcodeExecutorStateSpace`
  `getForSpace(AddressSpace space, boolean toWrite)`
  Get the internal space for the given address space
  `protected JitBytesPcodeExecutorStatePiece.JitBytesPcodeExecutorStateSpace`
  `newSpace(AddressSpace space)`

  ### Methods inherited from class ghidra.pcode.exec.AbstractBytesPcodeExecutorStatePiece

  `getConcreteBuffer, getFromSpace, getRegisterValuesFromSpace, setInSpace`

  ### Methods inherited from class ghidra.pcode.exec.AbstractLongOffsetPcodeExecutorStatePiece

  `checkSize, forkMap, getAddressArithmetic, getArithmetic, getFromNullSpace, getLanguage, getRegisterValues, getUnique, getVar, getVar, getVarInternal, getVarInternal, getVarInternal, setUnique, setVar, setVar, setVarInternal, setVarInternal, setVarInternal, streamPieces`

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

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface ghidra.pcode.exec.PcodeExecutorStatePiece

  `checkRange, fork, getNextEntryInternal, getNextEntryInternal, getVar, getVar, getVar, inspectBigInteger, inspectByte, inspectConcrete, inspectInt, inspectLong, inspectRegisterValue, inspectShort, quantizeOffset, setBigInteger, setByte, setConcrete, setInt, setLong, setRegisterValue, setRegisterValue, setShort, setVar, setVar, setVar`

- ## Constructor Details

  - ### JitBytesPcodeExecutorStatePiece

    public JitBytesPcodeExecutorStatePiece(Language language, PcodeStateCallbacks cb)
    Construct a state piece
    Parameters:
      `language` - the emulation target language
      `cb` - callbacks to receive emulation events. Note that many accesses by the JIT are direct and so will not generate a callback. DO NOT rely on state callbacks yet.

- ## Method Details

  - ### newSpace

    protected JitBytesPcodeExecutorStatePiece.JitBytesPcodeExecutorStateSpace newSpace(AddressSpace space)
    Specified by:
      `newSpace` in class `AbstractBytesPcodeExecutorStatePiece<JitBytesPcodeExecutorStatePiece.JitBytesPcodeExecutorStateSpace>`

  - ### clear

    public void clear()
    Description copied from interface: `PcodeExecutorStatePiece`
    Erase the entire state or piece

    This is generally only useful when the state is itself a cache to another object. This will ensure the state is reading from that object rather than a stale cache. If this is not a cache, this could in fact clear the whole state, and the machine using it will be left in the dark.

    Specified by:
      `clear` in interface `PcodeExecutorStatePiece<byte[],byte[]>`
    Overrides:
      `clear` in class `AbstractBytesPcodeExecutorStatePiece<JitBytesPcodeExecutorStatePiece.JitBytesPcodeExecutorStateSpace>`

  - ### getForSpace

    public JitBytesPcodeExecutorStatePiece.JitBytesPcodeExecutorStateSpace getForSpace(AddressSpace space, boolean toWrite)
    Get the internal space for the given address space

    Overridden to grant public access. The JIT-generated constructors will need to invoke this method.

    Overrides:
      `getForSpace` in class `AbstractBytesPcodeExecutorStatePiece<JitBytesPcodeExecutorStatePiece.JitBytesPcodeExecutorStateSpace>`
    Parameters:
      `space` - the address space
      `toWrite` - in case internal spaces are generated lazily, this indicates the space must be present, because it is going to be written to.
    Returns:
      the space, or `null`