Package net.sf.cglib.core
Class EmitUtils
java.lang.Object
net.sf.cglib.core.EmitUtils
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classprivate static interface -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Signatureprivate static final Signatureprivate static final Signatureprivate static final Signatureprivate static final Signatureprivate static final Signatureprivate static final Signatureprivate static final Signatureprivate static final Signaturestatic final EmitUtils.ArrayDelimitersprivate static final Signatureprivate static final Signatureprivate static final Signatureprivate static final Signatureprivate static final Signatureprivate static final Signatureprivate static final Signatureprivate static final Signatureprivate static final Signatureprivate static final Signatureprivate static final Signatureprivate static final Signature -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidadd_properties(ClassEmitter ce, String[] names, org.objectweb.asm.Type[] types) static voidadd_property(ClassEmitter ce, String name, org.objectweb.asm.Type type, String fieldName) static voidappend_string(CodeEmitter e, org.objectweb.asm.Type type, EmitUtils.ArrayDelimiters delims, Customizer customizer) Deprecated.static voidappend_string(CodeEmitter e, org.objectweb.asm.Type type, EmitUtils.ArrayDelimiters delims, CustomizerRegistry registry) private static voidappend_string_helper(CodeEmitter e, org.objectweb.asm.Type type, EmitUtils.ArrayDelimiters delims, CustomizerRegistry registry, ProcessArrayCallback callback) static CodeEmitterbegin_method(ClassEmitter e, MethodInfo method) static CodeEmitterbegin_method(ClassEmitter e, MethodInfo method, int access) static voidconstructor_switch(CodeEmitter e, List constructors, ObjectSwitchCallback callback) static voidfactory_method(ClassEmitter ce, Signature sig) (package private) static int[]getSwitchKeys(Map buckets) private static voidhash_array(CodeEmitter e, org.objectweb.asm.Type type, int multiplier, CustomizerRegistry registry) static voidhash_code(CodeEmitter e, org.objectweb.asm.Type type, int multiplier, Customizer customizer) Deprecated.static voidhash_code(CodeEmitter e, org.objectweb.asm.Type type, int multiplier, CustomizerRegistry registry) private static voidprivate static voidhash_object(CodeEmitter e, org.objectweb.asm.Type type, CustomizerRegistry registry) private static voidhash_primitive(CodeEmitter e, org.objectweb.asm.Type type) static voidload_class(CodeEmitter e, org.objectweb.asm.Type type) private static voidload_class_helper(CodeEmitter e, org.objectweb.asm.Type type) static voidstatic voidload_method(CodeEmitter e, MethodInfo method) private static voidmember_helper_size(CodeEmitter e, List members, ObjectSwitchCallback callback, EmitUtils.ParameterTyper typer, org.objectweb.asm.Label def, org.objectweb.asm.Label end) private static voidmember_helper_type(CodeEmitter e, List members, ObjectSwitchCallback callback, EmitUtils.ParameterTyper typer, org.objectweb.asm.Label def, org.objectweb.asm.Label end, BitSet checked) private static voidmember_switch_helper(CodeEmitter e, List members, ObjectSwitchCallback callback, boolean useName) static voidmethod_switch(CodeEmitter e, List methods, ObjectSwitchCallback callback) static voidnot_equals(CodeEmitter e, org.objectweb.asm.Type type, org.objectweb.asm.Label notEquals, Customizer customizer) Deprecated.static voidnot_equals(CodeEmitter e, org.objectweb.asm.Type type, org.objectweb.asm.Label notEquals, CustomizerRegistry registry) Branches to the specified label if the top two items on the stack are not equal.private static voidnot_equals_helper(CodeEmitter e, org.objectweb.asm.Type type, org.objectweb.asm.Label notEquals, CustomizerRegistry registry, ProcessArrayCallback callback) static voidprivate static voidnullcmp(CodeEmitter e, org.objectweb.asm.Label oneNull, org.objectweb.asm.Label bothNull) If both objects on the top of the stack are non-null, does nothing.static voidprocess_array(CodeEmitter e, org.objectweb.asm.Type type, ProcessArrayCallback callback) Process an array on the stack.static voidprocess_arrays(CodeEmitter e, org.objectweb.asm.Type type, ProcessArrayCallback callback) Process two arrays on the stack in parallel.static voidpush_array(CodeEmitter e, Object[] array) static voidpush_object(CodeEmitter e, Object obj) private static ClassremapComponentType(Class componentType) private static voidshrinkStringBuffer(CodeEmitter e, int amt) static voidstring_switch(CodeEmitter e, String[] strings, int switchStyle, ObjectSwitchCallback callback) private static voidstring_switch_hash(CodeEmitter e, String[] strings, ObjectSwitchCallback callback, boolean skipEquals) private static voidstring_switch_trie(CodeEmitter e, String[] strings, ObjectSwitchCallback callback) private static voidstringSwitchHelper(CodeEmitter e, List strings, ObjectSwitchCallback callback, org.objectweb.asm.Label def, org.objectweb.asm.Label end, int index) static voidwrap_throwable(Block block, org.objectweb.asm.Type wrapper) static voidwrap_undeclared_throwable(CodeEmitter e, Block handler, org.objectweb.asm.Type[] exceptions, org.objectweb.asm.Type wrapper)
-
Field Details
-
CSTRUCT_NULL
-
CSTRUCT_THROWABLE
-
GET_NAME
-
HASH_CODE
-
EQUALS
-
STRING_LENGTH
-
STRING_CHAR_AT
-
FOR_NAME
-
DOUBLE_TO_LONG_BITS
-
FLOAT_TO_INT_BITS
-
TO_STRING
-
APPEND_STRING
-
APPEND_INT
-
APPEND_DOUBLE
-
APPEND_FLOAT
-
APPEND_CHAR
-
APPEND_LONG
-
APPEND_BOOLEAN
-
LENGTH
-
SET_LENGTH
-
GET_DECLARED_METHOD
-
DEFAULT_DELIMITERS
-
-
Constructor Details
-
EmitUtils
private EmitUtils()
-
-
Method Details
-
factory_method
-
null_constructor
-
process_array
public static void process_array(CodeEmitter e, org.objectweb.asm.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.- Parameters:
type- the type of the array (type.isArray() must be true)callback- the callback triggered for each element
-
process_arrays
public static void process_arrays(CodeEmitter e, org.objectweb.asm.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.- Parameters:
type- the type of the arrays (type.isArray() must be true)callback- the callback triggered for each pair of elements
-
string_switch
public static void string_switch(CodeEmitter e, String[] strings, int switchStyle, ObjectSwitchCallback callback) -
string_switch_trie
private static void string_switch_trie(CodeEmitter e, String[] strings, ObjectSwitchCallback callback) throws Exception - Throws:
Exception
-
stringSwitchHelper
private static void stringSwitchHelper(CodeEmitter e, List strings, ObjectSwitchCallback callback, org.objectweb.asm.Label def, org.objectweb.asm.Label end, int index) throws Exception - Throws:
Exception
-
getSwitchKeys
-
string_switch_hash
private static void string_switch_hash(CodeEmitter e, String[] strings, ObjectSwitchCallback callback, boolean skipEquals) throws Exception - Throws:
Exception
-
load_class_this
-
load_class
-
load_class_helper
-
push_array
-
remapComponentType
-
push_object
-
hash_code
@Deprecated public static void hash_code(CodeEmitter e, org.objectweb.asm.Type type, int multiplier, Customizer customizer) Deprecated. -
hash_code
public static void hash_code(CodeEmitter e, org.objectweb.asm.Type type, int multiplier, CustomizerRegistry registry) -
hash_array
private static void hash_array(CodeEmitter e, org.objectweb.asm.Type type, int multiplier, CustomizerRegistry registry) -
hash_object
private static void hash_object(CodeEmitter e, org.objectweb.asm.Type type, CustomizerRegistry registry) -
hash_primitive
-
hash_long
-
not_equals
@Deprecated public static void not_equals(CodeEmitter e, org.objectweb.asm.Type type, org.objectweb.asm.Label notEquals, Customizer customizer) Deprecated. -
not_equals
public static void not_equals(CodeEmitter e, org.objectweb.asm.Type type, org.objectweb.asm.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. -
not_equals_helper
private static void not_equals_helper(CodeEmitter e, org.objectweb.asm.Type type, org.objectweb.asm.Label notEquals, CustomizerRegistry registry, ProcessArrayCallback callback) -
nullcmp
private static void nullcmp(CodeEmitter e, org.objectweb.asm.Label oneNull, org.objectweb.asm.Label bothNull) 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.- Parameters:
oneNull- label to branch to if only one of the objects is nullbothNull- label to branch to if both of the objects are null
-
append_string
@Deprecated public static void append_string(CodeEmitter e, org.objectweb.asm.Type type, EmitUtils.ArrayDelimiters delims, Customizer customizer) Deprecated. -
append_string
public static void append_string(CodeEmitter e, org.objectweb.asm.Type type, EmitUtils.ArrayDelimiters delims, CustomizerRegistry registry) -
append_string_helper
private static void append_string_helper(CodeEmitter e, org.objectweb.asm.Type type, EmitUtils.ArrayDelimiters delims, CustomizerRegistry registry, ProcessArrayCallback callback) -
shrinkStringBuffer
-
load_method
-
method_switch
-
constructor_switch
public static void constructor_switch(CodeEmitter e, List constructors, ObjectSwitchCallback callback) -
member_switch_helper
private static void member_switch_helper(CodeEmitter e, List members, ObjectSwitchCallback callback, boolean useName) -
member_helper_size
private static void member_helper_size(CodeEmitter e, List members, ObjectSwitchCallback callback, EmitUtils.ParameterTyper typer, org.objectweb.asm.Label def, org.objectweb.asm.Label end) throws Exception - Throws:
Exception
-
member_helper_type
private static void member_helper_type(CodeEmitter e, List members, ObjectSwitchCallback callback, EmitUtils.ParameterTyper typer, org.objectweb.asm.Label def, org.objectweb.asm.Label end, BitSet checked) throws Exception - Throws:
Exception
-
wrap_throwable
-
add_properties
-
add_property
public static void add_property(ClassEmitter ce, String name, org.objectweb.asm.Type type, String fieldName) -
wrap_undeclared_throwable
public static void wrap_undeclared_throwable(CodeEmitter e, Block handler, org.objectweb.asm.Type[] exceptions, org.objectweb.asm.Type wrapper) -
begin_method
-
begin_method
-
append_string(CodeEmitter, Type, ArrayDelimiters, CustomizerRegistry)instead