Package ghidra.pcode.emu.jit.gen.var

# Enum Class ConstValGen

java.lang.Object
java.lang.Enum<ConstValGen>
ghidra.pcode.emu.jit.gen.var.ConstValGen

All Implemented Interfaces:
  `ValGen<JitConstVal>`, `Serializable`, `Comparable<ConstValGen>`, `Constable`

public enum ConstValGen extends Enum<ConstValGen> implements ValGen<JitConstVal>
The generator for a constant value.

This can load directly the requested constant as the required JVM type onto the JVM stack. It simply emits an `ldc` bytecode.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class java.lang.Enum

  `Enum.EnumDesc<E extends Enum<E>>`

- ## Enum Constant Summary

  Enum Constants
  Enum Constant
  Description
  `GEN`
  Singleton

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `generateValInitCode(JitCodeGenerator gen, JitConstVal v, org.objectweb.asm.MethodVisitor iv)`
  Prepare any class-level items required to use this variable
  `JitType`
  `generateValReadCode(JitCodeGenerator gen, JitConstVal v, JitTypeBehavior typeReq, TypeConversions.Ext ext, org.objectweb.asm.MethodVisitor rv)`
  Read the value onto the stack
  `static ConstValGen`
  `valueOf(String name)`
  Returns the enum constant of this class with the specified name.
  `static ConstValGen[]`
  `values()`
  Returns an array containing the constants of this enum class, in the order they are declared.

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

  `clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

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

  `getClass, notify, notifyAll, wait, wait, wait`

- ## Enum Constant Details

  - ### GEN

    public static final ConstValGen GEN
    Singleton

- ## Method Details

  - ### values

    public static ConstValGen[] values()
    Returns an array containing the constants of this enum class, in the order they are declared.
    Returns:
      an array containing the constants of this enum class, in the order they are declared

  - ### valueOf

    public static ConstValGen valueOf(String name)
    Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
    Parameters:
      `name` - the name of the enum constant to be returned.
    Returns:
      the enum constant with the specified name
    Throws:
      `IllegalArgumentException` - if this enum class has no constant with the specified name
      `NullPointerException` - if the argument is null

  - ### generateValInitCode

    public void generateValInitCode(JitCodeGenerator gen, JitConstVal v, org.objectweb.asm.MethodVisitor iv)
    Description copied from interface: `ValGen`
    Prepare any class-level items required to use this variable

    For example, if this represents a direct memory variable, then this can prepare a reference to the portion of the state involved, allowing it to access it readily.

    Specified by:
      `generateValInitCode` in interface `ValGen<JitConstVal>`
    Parameters:
      `gen` - the code generator
      `v` - the value
      `iv` - the constructor visitor

  - ### generateValReadCode

    public JitType generateValReadCode(JitCodeGenerator gen, JitConstVal v, JitTypeBehavior typeReq, TypeConversions.Ext ext, org.objectweb.asm.MethodVisitor rv)
    Description copied from interface: `ValGen`
    Read the value onto the stack
    Specified by:
      `generateValReadCode` in interface `ValGen<JitConstVal>`
    Parameters:
      `gen` - the code generator
      `v` - the value to read
      `typeReq` - the required type of the value
      `ext` - the kind of extension to apply when adjusting from JVM size to varnode size
      `rv` - the visitor for the `run` method
    Returns:
      the actual p-code type (which determines the JVM type) of the value on the stack