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.

  • Enum Constant Details

  • 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, 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
      rv - the visitor for the run method
      Returns:
      the actual p-code type (which determines the JVM type) of the value on the stack