类 EmitUtils
java.lang.Object
cn.taketoday.bytecode.core.EmitUtils
-
嵌套类概要
嵌套类修饰符和类型类说明(专用程序包) static classprivate static interface -
字段概要
字段修饰符和类型字段说明private static final MethodSignatureprivate static final MethodSignatureprivate static final MethodSignatureprivate static final MethodSignatureprivate static final MethodSignatureprivate static final MethodSignatureprivate static final MethodSignatureprivate static final MethodSignaturestatic final EmitUtils.ArrayDelimitersprivate static final MethodSignatureprivate static final MethodSignatureprivate static final MethodSignatureprivate static final MethodSignatureprivate static final MethodSignatureprivate static final MethodSignatureprivate static final MethodSignatureprivate static final MethodSignaturestatic final Typestatic final Type -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static voidaddProperties(ClassEmitter ce, String[] names, Type[] types) static voidaddProperty(ClassEmitter ce, String name, Type type, String fieldName) static voidappendString(CodeEmitter e, Type type, EmitUtils.ArrayDelimiters delims, CustomizerRegistry registry) private static voidappendStringHelper(CodeEmitter e, Type type, EmitUtils.ArrayDelimiters delims, CustomizerRegistry registry, ProcessArrayCallback callback) static CodeEmitterbeginMethod(ClassEmitter e, MethodInfo method) static CodeEmitterbeginMethod(ClassEmitter e, MethodInfo method, int access) static voidconstructorSwitch(CodeEmitter e, List constructors, ObjectSwitchCallback callback) static StringescapeType(String s) static voidfactoryMethod(ClassEmitter ce, MethodSignature sig) protected static <T> int[]getSwitchKeys(Map<Integer, List<T>> buckets) private static voidhashArray(GeneratorAdapter e, Type type, int multiplier, CustomizerRegistry registry) static voidhashCode(GeneratorAdapter e, Type type, int multiplier, Customizer customizer) 已过时。static voidhashCode(GeneratorAdapter e, Type type, int multiplier, CustomizerRegistry registry) private static voidprivate static voidhashObject(GeneratorAdapter e, Type type, CustomizerRegistry registry) private static voidhashPrimitive(GeneratorAdapter e, Type type) static voidloadClass(CodeEmitter e, Type type) private static voidloadClassHelper(CodeEmitter e, Type type) static voidstatic voidloadEmptyArguments(CodeEmitter codeEmitter) static voidloadMethod(CodeEmitter e, MethodInfo method) private static voidmemberHelperSize(CodeEmitter e, List members, ObjectSwitchCallback callback, EmitUtils.ParameterTyper typer, Label def, Label end) private static voidmemberHelperType(CodeEmitter e, List<MethodInfo> members, ObjectSwitchCallback callback, EmitUtils.ParameterTyper typer, Label def, Label end, BitSet checked) private static voidmemberSwitchHelper(CodeEmitter e, List members, ObjectSwitchCallback callback, boolean useName) static voidmethodSwitch(CodeEmitter e, List methods, ObjectSwitchCallback callback) static voidnotEquals(CodeEmitter e, Type type, Label notEquals, CustomizerRegistry registry) Branches to the specified label if the top two items on the stack are not equal.private static voidnotEqualsHelper(CodeEmitter e, Type type, Label notEquals, CustomizerRegistry registry, ProcessArrayCallback callback) private static voidnullcmp(CodeEmitter e, Label oneNull, Label bothNull) If both objects on the top of the stack are non-null, does nothing.static voidstatic voidprocessArray(GeneratorAdapter e, Type type, ProcessArrayCallback callback) Process an array on the stack.static voidprocessArrays(CodeEmitter e, Type type, ProcessArrayCallback callback) Process two arrays on the stack in parallel.static voidpushArray(CodeEmitter e, Object[] array) static voidpushObject(CodeEmitter e, Object obj) private static Class<?>remapComponentType(Class<?> componentType) private static voidshrinkStringBuffer(CodeEmitter e, int amt) static voidstringSwitch(CodeEmitter e, String[] strings, int switchStyle, ObjectSwitchCallback callback) private static voidstringSwitchHash(CodeEmitter e, String[] strings, ObjectSwitchCallback callback, boolean skipEquals) private static voidstringSwitchHelper(CodeEmitter e, List strings, ObjectSwitchCallback callback, Label def, Label end, int index) private static voidstringSwitchTrie(CodeEmitter e, String[] strings, ObjectSwitchCallback callback) static voidwrapThrowable(Block block, Type wrapper) static voidwrapUndeclaredThrowable(CodeEmitter e, Block handler, Type[] exceptions, Type wrapper)
-
字段详细资料
-
TYPE_BIG_INTEGER
-
TYPE_BIG_DECIMAL
-
CSTRUCT_THROWABLE
-
LENGTH
-
GET_NAME
-
SET_LENGTH
-
FOR_NAME
-
STRING_CHAR_AT
-
APPEND_INT
-
APPEND_LONG
-
APPEND_CHAR
-
APPEND_FLOAT
-
APPEND_DOUBLE
-
APPEND_STRING
-
APPEND_BOOLEAN
-
FLOAT_TO_INT_BITS
-
DOUBLE_TO_LONG_BITS
-
GET_DECLARED_METHOD
-
DEFAULT_DELIMITERS
-
-
构造器详细资料
-
EmitUtils
public EmitUtils()
-
-
方法详细资料
-
factoryMethod
-
nullConstructor
-
processArray
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
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) -
stringSwitchTrie
private static void stringSwitchTrie(CodeEmitter e, String[] strings, ObjectSwitchCallback callback) -
stringSwitchHelper
private static void stringSwitchHelper(CodeEmitter e, List strings, ObjectSwitchCallback callback, Label def, Label end, int index) -
getSwitchKeys
-
stringSwitchHash
private static void stringSwitchHash(CodeEmitter e, String[] strings, ObjectSwitchCallback callback, boolean skipEquals) -
loadClassThis
-
loadClass
-
loadClassHelper
-
pushArray
-
remapComponentType
-
pushObject
-
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) -
hashArray
private static void hashArray(GeneratorAdapter e, Type type, int multiplier, CustomizerRegistry registry) -
hashObject
-
hashPrimitive
-
hashLong
-
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 theequalsmethod for Objects. Arrays are recursively processed in the same manner. -
notEqualsHelper
private static void notEqualsHelper(CodeEmitter e, Type type, Label notEquals, CustomizerRegistry registry, ProcessArrayCallback callback) -
nullcmp
If both objects on the top of the stack are non-null, does nothing. If one is null, or both are null, both are popped off and execution branches to the respective label.- 参数:
oneNull- label to branch to if only one of the objects is nullbothNull- label to branch to if both of the objects are null
-
appendString
public static void appendString(CodeEmitter e, Type type, EmitUtils.ArrayDelimiters delims, CustomizerRegistry registry) -
appendStringHelper
private static void appendStringHelper(CodeEmitter e, Type type, EmitUtils.ArrayDelimiters delims, CustomizerRegistry registry, ProcessArrayCallback callback) -
shrinkStringBuffer
-
loadMethod
-
methodSwitch
-
constructorSwitch
public static void constructorSwitch(CodeEmitter e, List constructors, ObjectSwitchCallback callback) -
memberSwitchHelper
private static void memberSwitchHelper(CodeEmitter e, List members, ObjectSwitchCallback callback, boolean useName) -
memberHelperSize
private static void memberHelperSize(CodeEmitter e, List members, ObjectSwitchCallback callback, EmitUtils.ParameterTyper typer, Label def, Label end) -
memberHelperType
private static void memberHelperType(CodeEmitter e, List<MethodInfo> members, ObjectSwitchCallback callback, EmitUtils.ParameterTyper typer, Label def, Label end, BitSet checked) -
wrapThrowable
-
addProperties
-
addProperty
-
wrapUndeclaredThrowable
public static void wrapUndeclaredThrowable(CodeEmitter e, Block handler, Type[] exceptions, Type wrapper) -
beginMethod
-
beginMethod
-
loadEmptyArguments
-
escapeType
-
hashCode(GeneratorAdapter, Type, int, CustomizerRegistry)instead