类 EmitUtils

java.lang.Object
cn.taketoday.bytecode.core.EmitUtils

public abstract class EmitUtils extends Object
  • 字段详细资料

    • TYPE_BIG_INTEGER

      public static final Type TYPE_BIG_INTEGER
    • TYPE_BIG_DECIMAL

      public static final Type TYPE_BIG_DECIMAL
    • DEFAULT_DELIMITERS

      public static final cn.taketoday.bytecode.core.EmitUtils.ArrayDelimiters DEFAULT_DELIMITERS
  • 构造器详细资料

    • EmitUtils

      public EmitUtils()
  • 方法详细资料

    • factoryMethod

      public static void factoryMethod(ClassEmitter ce, MethodSignature sig)
    • nullConstructor

      public static void nullConstructor(ClassEmitter ce)
    • processArray

      public static void processArray(GeneratorAdapter e, Type type, ProcessArrayCallback callback)
      Process an array on the stack. Assumes the top item on the stack is an array of the specified type. For each element in the array, puts the element on the stack and triggers the callback.
      参数:
      type - the type of the array (type.isArray() must be true)
      callback - the callback triggered for each element
    • processArrays

      public static void processArrays(CodeEmitter e, Type type, ProcessArrayCallback callback)
      Process two arrays on the stack in parallel. Assumes the top two items on the stack are arrays of the specified class. The arrays must be the same length. For each pair of elements in the arrays, puts the pair on the stack and triggers the callback.
      参数:
      type - the type of the arrays (type.isArray() must be true)
      callback - the callback triggered for each pair of elements
    • stringSwitch

      public static void stringSwitch(CodeEmitter e, String[] strings, int switchStyle, ObjectSwitchCallback callback)
    • getSwitchKeys

      protected static <T> int[] getSwitchKeys(Map<Integer,List<T>> buckets)
    • loadClassThis

      public static void loadClassThis(CodeEmitter e)
    • loadClass

      public static void loadClass(CodeEmitter e, Type type)
    • pushArray

      public static void pushArray(CodeEmitter e, Object[] array)
    • pushObject

      public static void pushObject(CodeEmitter e, Object obj)
    • hashCode

      @Deprecated public static void hashCode(GeneratorAdapter e, Type type, int multiplier, Customizer customizer)
    • hashCode

      public static void hashCode(GeneratorAdapter e, Type type, int multiplier, CustomizerRegistry registry)
    • notEquals

      public static void notEquals(CodeEmitter e, Type type, Label notEquals, CustomizerRegistry registry)
      Branches to the specified label if the top two items on the stack are not equal. The items must both be of the specified class. Equality is determined by comparing primitive values directly and by invoking the equals method for Objects. Arrays are recursively processed in the same manner.
    • appendString

      public static void appendString(CodeEmitter e, Type type, cn.taketoday.bytecode.core.EmitUtils.ArrayDelimiters delims, CustomizerRegistry registry)
    • loadMethod

      public static void loadMethod(CodeEmitter e, MethodInfo method)
    • methodSwitch

      public static void methodSwitch(CodeEmitter e, List methods, ObjectSwitchCallback callback)
    • constructorSwitch

      public static void constructorSwitch(CodeEmitter e, List constructors, ObjectSwitchCallback callback)
    • wrapThrowable

      public static void wrapThrowable(Block block, Type wrapper)
    • addProperties

      public static void addProperties(ClassEmitter ce, String[] names, Type[] types)
    • addProperty

      public static void addProperty(ClassEmitter ce, String name, Type type, String fieldName)
    • wrapUndeclaredThrowable

      public static void wrapUndeclaredThrowable(CodeEmitter e, Block handler, Type[] exceptions, Type wrapper)
    • beginMethod

      public static CodeEmitter beginMethod(ClassEmitter e, MethodInfo method)
    • beginMethod

      public static CodeEmitter beginMethod(ClassEmitter e, MethodInfo method, int access)
    • loadEmptyArguments

      public static void loadEmptyArguments(CodeEmitter codeEmitter)
    • escapeType

      public static String escapeType(String s)