Package net.sf.cglib.core
Class CodeEmitter
java.lang.Object
org.objectweb.asm.MethodVisitor
net.sf.cglib.core.LocalVariablesSorter
net.sf.cglib.core.CodeEmitter
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intprivate static final Signatureprivate ClassEmitterprivate static final Signatureprivate static final Signatureprivate static final Signaturestatic final intprivate static final Signaturestatic final intprivate static final Signaturestatic final intstatic final intprivate static final Signaturestatic final intprivate static final Signaturestatic final intstatic final intstatic final intstatic final intstatic final intstatic final intprivate CodeEmitter.Statestatic final intstatic final intstatic final intFields inherited from class net.sf.cglib.core.LocalVariablesSorter
firstLocalFields inherited from class org.objectweb.asm.MethodVisitor
api, mv -
Constructor Summary
ConstructorsConstructorDescriptionCodeEmitter(ClassEmitter ce, org.objectweb.asm.MethodVisitor mv, int access, Signature sig, org.objectweb.asm.Type[] exceptionTypes) CodeEmitter(CodeEmitter wrap) -
Method Summary
Modifier and TypeMethodDescriptionvoidaaload()voidaaload(int index) voidaastore()voidvoidarray_load(org.objectweb.asm.Type type) voidarray_store(org.objectweb.asm.Type type) voidvoidathrow()voidbox(org.objectweb.asm.Type type) If the argument is a primitive class, replaces the primitive value on the top of the stack with the wrapped (Object) equivalent.voidcast_numeric(org.objectweb.asm.Type from, org.objectweb.asm.Type to) Casts from one primitive numeric type to anothervoidcatch_exception(Block block, org.objectweb.asm.Type exception) voidcheckcast(org.objectweb.asm.Type type) voidvoidAllocates and fills an Object[] array with the arguments to the current method.voiddup()voiddup_x1()voiddup_x2()voiddup2()voiddup2_x1()voiddup2_x2()(package private) voidemit_field(int opcode, org.objectweb.asm.Type ctype, String name, org.objectweb.asm.Type ftype) private voidemit_invoke(int opcode, org.objectweb.asm.Type type, Signature sig, boolean isInterface) private voidemit_type(int opcode, org.objectweb.asm.Type type) voidvoidvoidorg.objectweb.asm.TypevoidvoidgoTo(org.objectweb.asm.Label label) voidif_cmp(org.objectweb.asm.Type type, int mode, org.objectweb.asm.Label label) voidif_icmp(int mode, org.objectweb.asm.Label label) voidif_jump(int mode, org.objectweb.asm.Label label) voidifnonnull(org.objectweb.asm.Label label) voidifnull(org.objectweb.asm.Label label) voidvoidinstance_of(org.objectweb.asm.Type type) voidvoidinvoke(MethodInfo method) voidinvoke(MethodInfo method, org.objectweb.asm.Type virtualType) voidinvoke_constructor(org.objectweb.asm.Type type) voidinvoke_constructor(org.objectweb.asm.Type type, Signature sig) voidvoidvoidinvoke_interface(org.objectweb.asm.Type owner, Signature sig) voidinvoke_static(org.objectweb.asm.Type owner, Signature sig) Deprecated.voidinvoke_static(org.objectweb.asm.Type owner, Signature sig, boolean isInterface) voidvoidinvoke_virtual(org.objectweb.asm.Type owner, Signature sig) voidprivate static booleanisSorted(int[] keys) booleanvoidload_arg(int index) Pushes the specified argument of the current method onto the stack.voidPushes all of the arguments of the current method onto the stack.voidload_args(int fromArg, int count) voidload_local(Local local) private voidload_local(org.objectweb.asm.Type t, int pos) voidorg.objectweb.asm.Labelmake_local(org.objectweb.asm.Type type) (package private) org.objectweb.asm.Labelmark()voidmark(org.objectweb.asm.Label label) voidmath(int op, org.objectweb.asm.Type type) voidvoidvoidnew_instance(org.objectweb.asm.Type type) voidvoidnewarray()voidnewarray(org.objectweb.asm.Type type) voidnot()Toggles the integer on the top of the stack from 1 to 0 or vice versavoidpop()voidpop2()voidprocess_switch(int[] keys, ProcessSwitchCallback callback) voidprocess_switch(int[] keys, ProcessSwitchCallback callback, boolean useTable) voidpush(boolean value) voidpush(double value) voidpush(float value) voidpush(int i) voidpush(long value) voidvoidvoidvoidvoidprivate intskipArgs(int numArgs) voidstore_local(Local local) private voidstore_local(org.objectweb.asm.Type t, int pos) voidsuper_getfield(String name, org.objectweb.asm.Type type) voidsuper_getstatic(String name, org.objectweb.asm.Type type) voidvoidsuper_invoke(Signature sig) voidvoidvoidsuper_putfield(String name, org.objectweb.asm.Type type) voidsuper_putstatic(String name, org.objectweb.asm.Type type) voidswap()voidswap(org.objectweb.asm.Type prev, org.objectweb.asm.Type type) voidthrow_exception(org.objectweb.asm.Type type, String msg) voidunbox(org.objectweb.asm.Type type) If the argument is a primitive class, replaces the object on the top of the stack with the unwrapped (primitive) equivalent.voidunbox_or_zero(org.objectweb.asm.Type type) Unboxes the object on the top of the stack.voidvisitMaxs(int maxStack, int maxLocals) voidzero_or_null(org.objectweb.asm.Type type) Pushes a zero onto the stack if the argument is a primitive class, or a null otherwise.Methods inherited from class net.sf.cglib.core.LocalVariablesSorter
newLocal, visitIincInsn, visitLocalVariable, visitVarInsnMethods inherited from class org.objectweb.asm.MethodVisitor
visitAnnotableParameterCount, visitAnnotation, visitAnnotationDefault, visitAttribute, visitCode, visitEnd, visitFieldInsn, visitFrame, visitInsn, visitInsnAnnotation, visitIntInsn, visitInvokeDynamicInsn, visitJumpInsn, visitLabel, visitLdcInsn, visitLineNumber, visitLocalVariableAnnotation, visitLookupSwitchInsn, visitMethodInsn, visitMethodInsn, visitMultiANewArrayInsn, visitParameter, visitParameterAnnotation, visitTableSwitchInsn, visitTryCatchAnnotation, visitTryCatchBlock, visitTypeAnnotation, visitTypeInsn
-
Field Details
-
BOOLEAN_VALUE
-
CHAR_VALUE
-
LONG_VALUE
-
DOUBLE_VALUE
-
FLOAT_VALUE
-
INT_VALUE
-
CSTRUCT_NULL
-
CSTRUCT_STRING
-
ADD
public static final int ADD- See Also:
-
MUL
public static final int MUL- See Also:
-
XOR
public static final int XOR- See Also:
-
USHR
public static final int USHR- See Also:
-
SUB
public static final int SUB- See Also:
-
DIV
public static final int DIV- See Also:
-
NEG
public static final int NEG- See Also:
-
REM
public static final int REM- See Also:
-
AND
public static final int AND- See Also:
-
OR
public static final int OR- See Also:
-
GT
public static final int GT- See Also:
-
LT
public static final int LT- See Also:
-
GE
public static final int GE- See Also:
-
LE
public static final int LE- See Also:
-
NE
public static final int NE- See Also:
-
EQ
public static final int EQ- See Also:
-
ce
-
state
-
-
Constructor Details
-
CodeEmitter
CodeEmitter(ClassEmitter ce, org.objectweb.asm.MethodVisitor mv, int access, Signature sig, org.objectweb.asm.Type[] exceptionTypes) -
CodeEmitter
-
-
Method Details
-
isStaticHook
public boolean isStaticHook() -
getSignature
-
getReturnType
public org.objectweb.asm.Type getReturnType() -
getMethodInfo
-
getClassEmitter
-
end_method
public void end_method() -
begin_block
-
catch_exception
-
goTo
public void goTo(org.objectweb.asm.Label label) -
ifnull
public void ifnull(org.objectweb.asm.Label label) -
ifnonnull
public void ifnonnull(org.objectweb.asm.Label label) -
if_jump
public void if_jump(int mode, org.objectweb.asm.Label label) -
if_icmp
public void if_icmp(int mode, org.objectweb.asm.Label label) -
if_cmp
public void if_cmp(org.objectweb.asm.Type type, int mode, org.objectweb.asm.Label label) -
pop
public void pop() -
pop2
public void pop2() -
dup
public void dup() -
dup2
public void dup2() -
dup_x1
public void dup_x1() -
dup_x2
public void dup_x2() -
dup2_x1
public void dup2_x1() -
dup2_x2
public void dup2_x2() -
swap
public void swap() -
aconst_null
public void aconst_null() -
swap
public void swap(org.objectweb.asm.Type prev, org.objectweb.asm.Type type) -
monitorenter
public void monitorenter() -
monitorexit
public void monitorexit() -
math
public void math(int op, org.objectweb.asm.Type type) -
array_load
public void array_load(org.objectweb.asm.Type type) -
array_store
public void array_store(org.objectweb.asm.Type type) -
cast_numeric
public void cast_numeric(org.objectweb.asm.Type from, org.objectweb.asm.Type to) Casts from one primitive numeric type to another -
push
public void push(int i) -
push
public void push(long value) -
push
public void push(float value) -
push
public void push(double value) -
push
-
newarray
public void newarray() -
newarray
public void newarray(org.objectweb.asm.Type type) -
arraylength
public void arraylength() -
load_this
public void load_this() -
load_args
public void load_args()Pushes all of the arguments of the current method onto the stack. -
load_arg
public void load_arg(int index) Pushes the specified argument of the current method onto the stack.- Parameters:
index- the zero-based index into the argument list
-
load_args
public void load_args(int fromArg, int count) -
skipArgs
private int skipArgs(int numArgs) -
load_local
private void load_local(org.objectweb.asm.Type t, int pos) -
store_local
private void store_local(org.objectweb.asm.Type t, int pos) -
iinc
-
store_local
-
load_local
-
return_value
public void return_value() -
getfield
-
putfield
-
super_getfield
-
super_putfield
-
super_getstatic
-
super_putstatic
-
getfield
-
putfield
-
getstatic
-
putstatic
-
emit_field
void emit_field(int opcode, org.objectweb.asm.Type ctype, String name, org.objectweb.asm.Type ftype) -
super_invoke
public void super_invoke() -
super_invoke
-
invoke_constructor
public void invoke_constructor(org.objectweb.asm.Type type) -
super_invoke_constructor
public void super_invoke_constructor() -
invoke_constructor_this
public void invoke_constructor_this() -
emit_invoke
private void emit_invoke(int opcode, org.objectweb.asm.Type type, Signature sig, boolean isInterface) -
invoke_interface
-
invoke_virtual
-
invoke_static
Deprecated. -
invoke_static
-
invoke_virtual_this
-
invoke_static_this
-
invoke_constructor
-
invoke_constructor_this
-
super_invoke_constructor
-
new_instance_this
public void new_instance_this() -
new_instance
public void new_instance(org.objectweb.asm.Type type) -
emit_type
private void emit_type(int opcode, org.objectweb.asm.Type type) -
aaload
public void aaload(int index) -
aaload
public void aaload() -
aastore
public void aastore() -
athrow
public void athrow() -
make_label
public org.objectweb.asm.Label make_label() -
make_local
-
make_local
-
checkcast_this
public void checkcast_this() -
checkcast
public void checkcast(org.objectweb.asm.Type type) -
instance_of
public void instance_of(org.objectweb.asm.Type type) -
instance_of_this
public void instance_of_this() -
process_switch
-
process_switch
-
isSorted
private static boolean isSorted(int[] keys) -
mark
public void mark(org.objectweb.asm.Label label) -
mark
org.objectweb.asm.Label mark() -
push
public void push(boolean value) -
not
public void not()Toggles the integer on the top of the stack from 1 to 0 or vice versa -
throw_exception
-
box
public void box(org.objectweb.asm.Type type) If the argument is a primitive class, replaces the primitive value on the top of the stack with the wrapped (Object) equivalent. For example, char -> Character. If the class is Void, a null is pushed onto the stack instead.- Parameters:
type- the class indicating the current type of the top stack value
-
unbox
public void unbox(org.objectweb.asm.Type type) If the argument is a primitive class, replaces the object on the top of the stack with the unwrapped (primitive) equivalent. For example, Character -> char.- Parameters:
type- the class indicating the desired type of the top stack value
-
create_arg_array
public void create_arg_array()Allocates and fills an Object[] array with the arguments to the current method. Primitive values are inserted as their boxed (Object) equivalents. -
zero_or_null
public void zero_or_null(org.objectweb.asm.Type type) Pushes a zero onto the stack if the argument is a primitive class, or a null otherwise. -
unbox_or_zero
public void unbox_or_zero(org.objectweb.asm.Type type) Unboxes the object on the top of the stack. If the object is null, the unboxed primitive value becomes zero. -
visitMaxs
public void visitMaxs(int maxStack, int maxLocals) - Overrides:
visitMaxsin classLocalVariablesSorter
-
invoke
-
invoke
-