Package ghidra.pcode.emu.jit.op

# Interface JitCallOtherOpIf

All Superinterfaces:
  `JitOp`

All Known Implementing Classes:
  `JitCallOtherDefOp`, `JitCallOtherOp`

public interface JitCallOtherOpIf extends JitOp
A use-def node for a `PcodeOp.CALLOTHER`.

This requires the `userop()` to exist. For the case of a missing userop, we use `JitCallOtherMissingOp`.

TODO: We have several considerations remaining, esp., since we'd like to handle system calls via userops efficiently:

1. There are more inputs than listed in the op itself. In fact, the invocation is just `syscall()`. The actual inputs are at least `RAX` and whatever parameters that specific syscall wants.
2. We'd like to be able to evaluate `RAX` statically.
3. We Might like to inject the p-code rather than trying to compile and run it separately. Then, in the case of a syscall, the actual Java callback should have known inputs and outputs. Would probably not want to embed a huge if-elseif tree for syscall numbers, though, which is why we'd like to evaluate RAX ahead of time. What if we can't, though? My thought is to retire all the variables and just interpret the syscall.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `List<JitVal>`
  `args()`
  The arguments to the userop.
  `default boolean`
  `canBeRemoved()`
  Indicates the operation can be removed if its output is never used.
  `JitDataFlowState.MiniDFState`
  `dfState()`
  Get the captured data flow state at the call site.
  `default List<JitVal>`
  `inputs()`
  The input operand use-def nodes in some defined order
  `List<JitTypeBehavior>`
  `inputTypes()`
  The type behavior for each parameter in the userop definition
  `default void`
  `link()`
  Add this op to the `JitVal.uses()` of each input operand, and (if applicable) set the `JitOutVar.definition()` of the output operand to this op.
  `default JitTypeBehavior`
  `typeFor(int position)`
  Get the required type behavior for the input at the given position in `JitOp.inputs()`
  `default void`
  `unlink()`
  Remove this op from the `JitVal.uses()` of each input operand, and (if applicable) unset the `JitOutVar.definition()` of the output operand.
  `PcodeUseropLibrary.PcodeUseropDefinition<Object>`
  `userop()`
  The userop definition.

  ### Methods inherited from interface ghidra.pcode.emu.jit.op.JitOp

  `op`

- ## Method Details

  - ### userop

    PcodeUseropLibrary.PcodeUseropDefinition<Object> userop()
    The userop definition.
    Returns:
      the definition from the library

  - ### args

    List<JitVal> args()
    The arguments to the userop.
    Returns:
      the list of use-def value nodes

  - ### inputs

    default List<JitVal> inputs()
    Description copied from interface: `JitOp`
    The input operand use-def nodes in some defined order
    Specified by:
      `inputs` in interface `JitOp`
    Returns:
      the list of inputs

  - ### inputTypes

    List<JitTypeBehavior> inputTypes()
    The type behavior for each parameter in the userop definition

    These should correspond to each argument (input).

    Returns:
      the list of behaviors

  - ### typeFor

    default JitTypeBehavior typeFor(int position)
    Description copied from interface: `JitOp`
    Get the required type behavior for the input at the given position in `JitOp.inputs()`
    Specified by:
      `typeFor` in interface `JitOp`
    Parameters:
      `position` - the input position
    Returns:
      the behavior

  - ### dfState

    JitDataFlowState.MiniDFState dfState()
    Get the captured data flow state at the call site.
    Returns:
      the state

  - ### canBeRemoved

    default boolean canBeRemoved()
    Description copied from interface: `JitOp`
    Indicates the operation can be removed if its output is never used.
    Specified by:
      `canBeRemoved` in interface `JitOp`
    Returns:
      true if removable

  - ### link

    default void link()
    Description copied from interface: `JitOp`
    Add this op to the `JitVal.uses()` of each input operand, and (if applicable) set the `JitOutVar.definition()` of the output operand to this op.
    Specified by:
      `link` in interface `JitOp`

  - ### unlink

    default void unlink()
    Description copied from interface: `JitOp`
    Remove this op from the `JitVal.uses()` of each input operand, and (if applicable) unset the `JitOutVar.definition()` of the output operand.
    Specified by:
      `unlink` in interface `JitOp`