public class EmitUtils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
EmitUtils.ArrayDelimiters |
private static interface |
EmitUtils.ParameterTyper |
Modifier and Type | Field and Description |
---|---|
private static Signature |
APPEND_BOOLEAN |
private static Signature |
APPEND_CHAR |
private static Signature |
APPEND_DOUBLE |
private static Signature |
APPEND_FLOAT |
private static Signature |
APPEND_INT |
private static Signature |
APPEND_LONG |
private static Signature |
APPEND_STRING |
private static Signature |
CSTRUCT_NULL |
private static Signature |
CSTRUCT_THROWABLE |
static EmitUtils.ArrayDelimiters |
DEFAULT_DELIMITERS |
private static Signature |
DOUBLE_TO_LONG_BITS |
private static Signature |
EQUALS |
private static Signature |
FLOAT_TO_INT_BITS |
private static Signature |
FOR_NAME |
private static Signature |
GET_DECLARED_METHOD |
private static Signature |
GET_NAME |
private static Signature |
HASH_CODE |
private static Signature |
LENGTH |
private static Signature |
SET_LENGTH |
private static Signature |
STRING_CHAR_AT |
private static Signature |
STRING_LENGTH |
private static Signature |
TO_STRING |
Modifier | Constructor and Description |
---|---|
private |
EmitUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
add_properties(ClassEmitter ce,
java.lang.String[] names,
org.objectweb.asm.Type[] types) |
static void |
add_property(ClassEmitter ce,
java.lang.String name,
org.objectweb.asm.Type type,
java.lang.String fieldName) |
private static void |
append_string_helper(CodeEmitter e,
org.objectweb.asm.Type type,
EmitUtils.ArrayDelimiters delims,
CustomizerRegistry registry,
ProcessArrayCallback callback) |
static void |
append_string(CodeEmitter e,
org.objectweb.asm.Type type,
EmitUtils.ArrayDelimiters delims,
Customizer customizer)
Deprecated.
|
static void |
append_string(CodeEmitter e,
org.objectweb.asm.Type type,
EmitUtils.ArrayDelimiters delims,
CustomizerRegistry registry) |
static CodeEmitter |
begin_method(ClassEmitter e,
MethodInfo method) |
static CodeEmitter |
begin_method(ClassEmitter e,
MethodInfo method,
int access) |
static void |
constructor_switch(CodeEmitter e,
java.util.List constructors,
ObjectSwitchCallback callback) |
static void |
factory_method(ClassEmitter ce,
Signature sig) |
(package private) static int[] |
getSwitchKeys(java.util.Map buckets) |
private static void |
hash_array(CodeEmitter e,
org.objectweb.asm.Type type,
int multiplier,
CustomizerRegistry registry) |
static void |
hash_code(CodeEmitter e,
org.objectweb.asm.Type type,
int multiplier,
Customizer customizer)
Deprecated.
|
static void |
hash_code(CodeEmitter e,
org.objectweb.asm.Type type,
int multiplier,
CustomizerRegistry registry) |
private static void |
hash_long(CodeEmitter e) |
private static void |
hash_object(CodeEmitter e,
org.objectweb.asm.Type type,
CustomizerRegistry registry) |
private static void |
hash_primitive(CodeEmitter e,
org.objectweb.asm.Type type) |
private static void |
load_class_helper(CodeEmitter e,
org.objectweb.asm.Type type) |
static void |
load_class_this(CodeEmitter e) |
static void |
load_class(CodeEmitter e,
org.objectweb.asm.Type type) |
static void |
load_method(CodeEmitter e,
MethodInfo method) |
private static void |
member_helper_size(CodeEmitter e,
java.util.List members,
ObjectSwitchCallback callback,
EmitUtils.ParameterTyper typer,
org.objectweb.asm.Label def,
org.objectweb.asm.Label end) |
private static void |
member_helper_type(CodeEmitter e,
java.util.List members,
ObjectSwitchCallback callback,
EmitUtils.ParameterTyper typer,
org.objectweb.asm.Label def,
org.objectweb.asm.Label end,
java.util.BitSet checked) |
private static void |
member_switch_helper(CodeEmitter e,
java.util.List members,
ObjectSwitchCallback callback,
boolean useName) |
static void |
method_switch(CodeEmitter e,
java.util.List methods,
ObjectSwitchCallback callback) |
private static void |
not_equals_helper(CodeEmitter e,
org.objectweb.asm.Type type,
org.objectweb.asm.Label notEquals,
CustomizerRegistry registry,
ProcessArrayCallback callback) |
static void |
not_equals(CodeEmitter e,
org.objectweb.asm.Type type,
org.objectweb.asm.Label notEquals,
Customizer customizer)
Deprecated.
|
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.
|
static void |
null_constructor(ClassEmitter ce) |
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.
|
static void |
process_array(CodeEmitter e,
org.objectweb.asm.Type type,
ProcessArrayCallback callback)
Process an array on the stack.
|
static void |
process_arrays(CodeEmitter e,
org.objectweb.asm.Type type,
ProcessArrayCallback callback)
Process two arrays on the stack in parallel.
|
static void |
push_array(CodeEmitter e,
java.lang.Object[] array) |
static void |
push_object(CodeEmitter e,
java.lang.Object obj) |
private static java.lang.Class |
remapComponentType(java.lang.Class componentType) |
private static void |
shrinkStringBuffer(CodeEmitter e,
int amt) |
private static void |
string_switch_hash(CodeEmitter e,
java.lang.String[] strings,
ObjectSwitchCallback callback,
boolean skipEquals) |
private static void |
string_switch_trie(CodeEmitter e,
java.lang.String[] strings,
ObjectSwitchCallback callback) |
static void |
string_switch(CodeEmitter e,
java.lang.String[] strings,
int switchStyle,
ObjectSwitchCallback callback) |
private static void |
stringSwitchHelper(CodeEmitter e,
java.util.List strings,
ObjectSwitchCallback callback,
org.objectweb.asm.Label def,
org.objectweb.asm.Label end,
int index) |
static void |
wrap_throwable(Block block,
org.objectweb.asm.Type wrapper) |
static void |
wrap_undeclared_throwable(CodeEmitter e,
Block handler,
org.objectweb.asm.Type[] exceptions,
org.objectweb.asm.Type wrapper) |
private static final Signature CSTRUCT_NULL
private static final Signature CSTRUCT_THROWABLE
private static final Signature GET_NAME
private static final Signature HASH_CODE
private static final Signature EQUALS
private static final Signature STRING_LENGTH
private static final Signature STRING_CHAR_AT
private static final Signature FOR_NAME
private static final Signature DOUBLE_TO_LONG_BITS
private static final Signature FLOAT_TO_INT_BITS
private static final Signature TO_STRING
private static final Signature APPEND_STRING
private static final Signature APPEND_INT
private static final Signature APPEND_DOUBLE
private static final Signature APPEND_FLOAT
private static final Signature APPEND_CHAR
private static final Signature APPEND_LONG
private static final Signature APPEND_BOOLEAN
private static final Signature LENGTH
private static final Signature SET_LENGTH
private static final Signature GET_DECLARED_METHOD
public static final EmitUtils.ArrayDelimiters DEFAULT_DELIMITERS
public static void factory_method(ClassEmitter ce, Signature sig)
public static void null_constructor(ClassEmitter ce)
public static void process_array(CodeEmitter e, org.objectweb.asm.Type type, ProcessArrayCallback callback)
type
- the type of the array (type.isArray() must be true)callback
- the callback triggered for each elementpublic static void process_arrays(CodeEmitter e, org.objectweb.asm.Type type, ProcessArrayCallback callback)
type
- the type of the arrays (type.isArray() must be true)callback
- the callback triggered for each pair of elementspublic static void string_switch(CodeEmitter e, java.lang.String[] strings, int switchStyle, ObjectSwitchCallback callback)
private static void string_switch_trie(CodeEmitter e, java.lang.String[] strings, ObjectSwitchCallback callback) throws java.lang.Exception
java.lang.Exception
private static void stringSwitchHelper(CodeEmitter e, java.util.List strings, ObjectSwitchCallback callback, org.objectweb.asm.Label def, org.objectweb.asm.Label end, int index) throws java.lang.Exception
java.lang.Exception
static int[] getSwitchKeys(java.util.Map buckets)
private static void string_switch_hash(CodeEmitter e, java.lang.String[] strings, ObjectSwitchCallback callback, boolean skipEquals) throws java.lang.Exception
java.lang.Exception
public static void load_class_this(CodeEmitter e)
public static void load_class(CodeEmitter e, org.objectweb.asm.Type type)
private static void load_class_helper(CodeEmitter e, org.objectweb.asm.Type type)
public static void push_array(CodeEmitter e, java.lang.Object[] array)
private static java.lang.Class remapComponentType(java.lang.Class componentType)
public static void push_object(CodeEmitter e, java.lang.Object obj)
@Deprecated public static void hash_code(CodeEmitter e, org.objectweb.asm.Type type, int multiplier, Customizer customizer)
hash_code(CodeEmitter, Type, int, CustomizerRegistry)
insteadpublic static void hash_code(CodeEmitter e, org.objectweb.asm.Type type, int multiplier, CustomizerRegistry registry)
private static void hash_array(CodeEmitter e, org.objectweb.asm.Type type, int multiplier, CustomizerRegistry registry)
private static void hash_object(CodeEmitter e, org.objectweb.asm.Type type, CustomizerRegistry registry)
private static void hash_primitive(CodeEmitter e, org.objectweb.asm.Type type)
private static void hash_long(CodeEmitter e)
@Deprecated public static void not_equals(CodeEmitter e, org.objectweb.asm.Type type, org.objectweb.asm.Label notEquals, Customizer customizer)
not_equals(CodeEmitter, Type, Label, CustomizerRegistry)
insteadpublic static void not_equals(CodeEmitter e, org.objectweb.asm.Type type, org.objectweb.asm.Label notEquals, CustomizerRegistry registry)
equals
method for
Objects. Arrays are recursively processed in the same manner.private static void not_equals_helper(CodeEmitter e, org.objectweb.asm.Type type, org.objectweb.asm.Label notEquals, CustomizerRegistry registry, ProcessArrayCallback callback)
private static void nullcmp(CodeEmitter e, org.objectweb.asm.Label oneNull, org.objectweb.asm.Label bothNull)
oneNull
- label to branch to if only one of the objects is nullbothNull
- label to branch to if both of the objects are null@Deprecated public static void append_string(CodeEmitter e, org.objectweb.asm.Type type, EmitUtils.ArrayDelimiters delims, Customizer customizer)
append_string(CodeEmitter, Type, ArrayDelimiters, CustomizerRegistry)
insteadpublic static void append_string(CodeEmitter e, org.objectweb.asm.Type type, EmitUtils.ArrayDelimiters delims, CustomizerRegistry registry)
private static void append_string_helper(CodeEmitter e, org.objectweb.asm.Type type, EmitUtils.ArrayDelimiters delims, CustomizerRegistry registry, ProcessArrayCallback callback)
private static void shrinkStringBuffer(CodeEmitter e, int amt)
public static void load_method(CodeEmitter e, MethodInfo method)
public static void method_switch(CodeEmitter e, java.util.List methods, ObjectSwitchCallback callback)
public static void constructor_switch(CodeEmitter e, java.util.List constructors, ObjectSwitchCallback callback)
private static void member_switch_helper(CodeEmitter e, java.util.List members, ObjectSwitchCallback callback, boolean useName)
private static void member_helper_size(CodeEmitter e, java.util.List members, ObjectSwitchCallback callback, EmitUtils.ParameterTyper typer, org.objectweb.asm.Label def, org.objectweb.asm.Label end) throws java.lang.Exception
java.lang.Exception
private static void member_helper_type(CodeEmitter e, java.util.List members, ObjectSwitchCallback callback, EmitUtils.ParameterTyper typer, org.objectweb.asm.Label def, org.objectweb.asm.Label end, java.util.BitSet checked) throws java.lang.Exception
java.lang.Exception
public static void wrap_throwable(Block block, org.objectweb.asm.Type wrapper)
public static void add_properties(ClassEmitter ce, java.lang.String[] names, org.objectweb.asm.Type[] types)
public static void add_property(ClassEmitter ce, java.lang.String name, org.objectweb.asm.Type type, java.lang.String fieldName)
public static void wrap_undeclared_throwable(CodeEmitter e, Block handler, org.objectweb.asm.Type[] exceptions, org.objectweb.asm.Type wrapper)
public static CodeEmitter begin_method(ClassEmitter e, MethodInfo method)
public static CodeEmitter begin_method(ClassEmitter e, MethodInfo method, int access)