Top Inners Fields Constructors Methods
org.springframework.cglib.core

public Class CodeEmitter

extends LocalVariablesSorter
Class Inheritance
Annotations
@SuppressWarnings:fallthrough
Imports
java.util.Arrays, org.springframework.asm.Label, .MethodVisitor, .Type

Author
Juozas Baliuka, Chris Nokleberg

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
public static final int
public static final int
private static final Signature
private ClassEmitter
private static final Signature
private static final Signature
private static final Signature
public static final int
private static final Signature
public static final int
private static final Signature
public static final int
public static final int
private static final Signature
public static final int
private static final Signature
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
private CodeEmitter.State
public static final int
public static final int
public static final int
Inherited from org.springframework.cglib.core.LocalVariablesSorter:
firstLocal

Constructor Summary

AccessConstructor and Description
pack-priv
CodeEmitter(ClassEmitter ce, MethodVisitor mv, int access, Signature sig, Type[] exceptionTypes)

public

Method Summary

Modifier and TypeMethod and Description
public void
aaload(int index)

public void
public void
public void
public void
public void
public void
public void
public Block
public void
box(Type
the class indicating the current type of the top stack value
type
)

If the argument is a primitive class, replaces the primitive value on the top of the stack with the wrapped (Object) equivalent.

public void
cast_numeric(Type from, Type to)

Casts from one primitive numeric type to another

public void
catch_exception(Block block, Type exception)

public void
public void
public void
create_arg_array()

Allocates and fills an Object[] array with the arguments to the current method.

public void
dup()

public void
dup2()

public void
public void
public void
public void
pack-priv void
emit_field(int opcode, Type ctype, String name, Type ftype)

private void
emit_invoke(int opcode, Type type, Signature sig, boolean isInterface)

private void
emit_type(int opcode, Type type)

public void
public ClassEmitter
public void
public void
getfield(Type owner, String name, Type type)

public MethodInfo
public Type
public Signature
public void
getstatic(Type owner, String name, Type type)

public void
goTo(Label label)

public void
if_cmp(Type type, int mode, Label label)

public void
if_icmp(int mode, Label label)

public void
if_jump(int mode, Label label)

public void
public void
ifnull(Label label)

public void
iinc(Local local, int amount)

public void
public void
public void
invoke(MethodInfo method, Type virtualType)

public void
public void
public void
public void
public void
public void
public void
invoke_static(Type owner, Signature sig)

Deprecated
public void
invoke_static(Type owner, Signature sig, boolean isInterface)

public void
public void
public void
private static boolean
isSorted(int[] keys)

public boolean
public void
load_arg(int
the zero-based index into the argument list
index
)

Pushes the specified argument of the current method onto the stack.

public void
load_args()

Pushes all of the arguments of the current method onto the stack.

public void
load_args(int fromArg, int count)

private void
load_local(Type t, int pos)

public void
public void
public Label
public Local
public Local
public void
mark(Label label)

pack-priv Label
mark()

public void
math(int op, Type type)

public void
public void
public void
public void
public void
public void
newarray(Type type)

public void
not()

Toggles the integer on the top of the stack from 1 to 0 or vice versa

public void
pop()

public void
pop2()

public void
process_switch(int[] keys, ProcessSwitchCallback callback)

public void
process_switch(int[] keys, ProcessSwitchCallback callback, boolean useTable)

public void
push(int i)

public void
push(long value)

public void
push(float value)

public void
push(double value)

public void
push(String value)

public void
push(boolean value)

public void
public void
putfield(Type owner, String name, Type type)

public void
putstatic(Type owner, String name, Type type)

public void
private int
skipArgs(int numArgs)

private void
store_local(Type t, int pos)

public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
swap()

public void
swap(Type prev, Type type)

public void
public void
unbox(Type
the class indicating the desired type of the top stack value
type
)

If the argument is a primitive class, replaces the object on the top of the stack with the unwrapped (primitive) equivalent.

public void
unbox_or_zero(Type type)

Unboxes the object on the top of the stack.

public void
visitMaxs(int
maximum stack size of the method.
maxStack
,
int
maximum number of local variables for the method.
maxLocals
)

Overrides org.springframework.cglib.core.LocalVariablesSorter.visitMaxs.

Visits the maximum stack size and the maximum number of local variables of the method.
public void
zero_or_null(Type type)

Pushes a zero onto the stack if the argument is a primitive class, or a null otherwise.

Inherited from org.springframework.cglib.core.LocalVariablesSorter:
newLocalvisitIincInsnvisitLocalVariablevisitVarInsn

Field Detail

ADDback to summary
public static final int ADD
ANDback to summary
public static final int AND
BOOLEAN_VALUEback to summary
private static final Signature BOOLEAN_VALUE
ceback to summary
private ClassEmitter ce
CHAR_VALUEback to summary
private static final Signature CHAR_VALUE
CSTRUCT_NULLback to summary
private static final Signature CSTRUCT_NULL
CSTRUCT_STRINGback to summary
private static final Signature CSTRUCT_STRING
DIVback to summary
public static final int DIV
DOUBLE_VALUEback to summary
private static final Signature DOUBLE_VALUE
EQback to summary
public static final int EQ
FLOAT_VALUEback to summary
private static final Signature FLOAT_VALUE
GEback to summary
public static final int GE
GTback to summary
public static final int GT
INT_VALUEback to summary
private static final Signature INT_VALUE
LEback to summary
public static final int LE
LONG_VALUEback to summary
private static final Signature LONG_VALUE
LTback to summary
public static final int LT
MULback to summary
public static final int MUL
NEback to summary
public static final int NE
NEGback to summary
public static final int NEG
ORback to summary
public static final int OR
REMback to summary
public static final int REM
stateback to summary
private CodeEmitter.State state

Hides org.springframework.cglib.core.LocalVariablesSorter.state.

SUBback to summary
public static final int SUB
USHRback to summary
public static final int USHR
XORback to summary
public static final int XOR

Constructor Detail

CodeEmitterback to summary
pack-priv CodeEmitter(ClassEmitter ce, MethodVisitor mv, int access, Signature sig, Type[] exceptionTypes)
CodeEmitterback to summary
public CodeEmitter(CodeEmitter wrap)

Method Detail

aaloadback to summary
public void aaload(int index)
aaloadback to summary
public void aaload()
aastoreback to summary
public void aastore()
aconst_nullback to summary
public void aconst_null()
array_loadback to summary
public void array_load(Type type)
array_storeback to summary
public void array_store(Type type)
arraylengthback to summary
public void arraylength()
athrowback to summary
public void athrow()
begin_blockback to summary
public Block begin_block()
boxback to summary
public void box(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:Type

the class indicating the current type of the top stack value

cast_numericback to summary
public void cast_numeric(Type from, Type to)

Casts from one primitive numeric type to another

catch_exceptionback to summary
public void catch_exception(Block block, Type exception)
checkcastback to summary
public void checkcast(Type type)
checkcast_thisback to summary
public void checkcast_this()
create_arg_arrayback to summary
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.

dupback to summary
public void dup()
dup2back to summary
public void dup2()
dup2_x1back to summary
public void dup2_x1()
dup2_x2back to summary
public void dup2_x2()
dup_x1back to summary
public void dup_x1()
dup_x2back to summary
public void dup_x2()
emit_fieldback to summary
pack-priv void emit_field(int opcode, Type ctype, String name, Type ftype)
emit_invokeback to summary
private void emit_invoke(int opcode, Type type, Signature sig, boolean isInterface)
emit_typeback to summary
private void emit_type(int opcode, Type type)
end_methodback to summary
public void end_method()
getClassEmitterback to summary
public ClassEmitter getClassEmitter()
getfieldback to summary
public void getfield(String name)
getfieldback to summary
public void getfield(Type owner, String name, Type type)
getMethodInfoback to summary
public MethodInfo getMethodInfo()
getReturnTypeback to summary
public Type getReturnType()
getSignatureback to summary
public Signature getSignature()
getstaticback to summary
public void getstatic(Type owner, String name, Type type)
goToback to summary
public void goTo(Label label)
if_cmpback to summary
public void if_cmp(Type type, int mode, Label label)
if_icmpback to summary
public void if_icmp(int mode, Label label)
if_jumpback to summary
public void if_jump(int mode, Label label)
ifnonnullback to summary
public void ifnonnull(Label label)
ifnullback to summary
public void ifnull(Label label)
iincback to summary
public void iinc(Local local, int amount)
instance_ofback to summary
public void instance_of(Type type)
instance_of_thisback to summary
public void instance_of_this()
invokeback to summary
public void invoke(MethodInfo method, Type virtualType)
invokeback to summary
public void invoke(MethodInfo method)
invoke_constructorback to summary
public void invoke_constructor(Type type)
invoke_constructorback to summary
public void invoke_constructor(Type type, Signature sig)
invoke_constructor_thisback to summary
public void invoke_constructor_this()
invoke_constructor_thisback to summary
public void invoke_constructor_this(Signature sig)
invoke_interfaceback to summary
public void invoke_interface(Type owner, Signature sig)
invoke_staticback to summary
public void invoke_static(Type owner, Signature sig)

Deprecated

Annotations
@Deprecated
invoke_staticback to summary
public void invoke_static(Type owner, Signature sig, boolean isInterface)
invoke_static_thisback to summary
public void invoke_static_this(Signature sig)
invoke_virtualback to summary
public void invoke_virtual(Type owner, Signature sig)
invoke_virtual_thisback to summary
public void invoke_virtual_this(Signature sig)
isSortedback to summary
private static boolean isSorted(int[] keys)
isStaticHookback to summary
public boolean isStaticHook()
load_argback to summary
public void load_arg(int index)

Pushes the specified argument of the current method onto the stack.

Parameters
index:int

the zero-based index into the argument list

load_argsback to summary
public void load_args()

Pushes all of the arguments of the current method onto the stack.

load_argsback to summary
public void load_args(int fromArg, int count)
load_localback to summary
private void load_local(Type t, int pos)
load_localback to summary
public void load_local(Local local)
load_thisback to summary
public void load_this()
make_labelback to summary
public Label make_label()
make_localback to summary
public Local make_local()
make_localback to summary
public Local make_local(Type type)
markback to summary
public void mark(Label label)
markback to summary
pack-priv Label mark()
mathback to summary
public void math(int op, Type type)
monitorenterback to summary
public void monitorenter()
monitorexitback to summary
public void monitorexit()
new_instanceback to summary
public void new_instance(Type type)
new_instance_thisback to summary
public void new_instance_this()
newarrayback to summary
public void newarray()
newarrayback to summary
public void newarray(Type type)
notback to summary
public void not()

Toggles the integer on the top of the stack from 1 to 0 or vice versa

popback to summary
public void pop()
pop2back to summary
public void pop2()
process_switchback to summary
public void process_switch(int[] keys, ProcessSwitchCallback callback)
process_switchback to summary
public void process_switch(int[] keys, ProcessSwitchCallback callback, boolean useTable)
pushback to summary
public void push(int i)
pushback to summary
public void push(long value)
pushback to summary
public void push(float value)
pushback to summary
public void push(double value)
pushback to summary
public void push(String value)
pushback to summary
public void push(boolean value)
putfieldback to summary
public void putfield(String name)
putfieldback to summary
public void putfield(Type owner, String name, Type type)
putstaticback to summary
public void putstatic(Type owner, String name, Type type)
return_valueback to summary
public void return_value()
skipArgsback to summary
private int skipArgs(int numArgs)
store_localback to summary
private void store_local(Type t, int pos)
store_localback to summary
public void store_local(Local local)
super_getfieldback to summary
public void super_getfield(String name, Type type)
super_getstaticback to summary
public void super_getstatic(String name, Type type)
super_invokeback to summary
public void super_invoke()
super_invokeback to summary
public void super_invoke(Signature sig)
super_invoke_constructorback to summary
public void super_invoke_constructor()
super_invoke_constructorback to summary
public void super_invoke_constructor(Signature sig)
super_putfieldback to summary
public void super_putfield(String name, Type type)
super_putstaticback to summary
public void super_putstatic(String name, Type type)
swapback to summary
public void swap()
swapback to summary
public void swap(Type prev, Type type)
throw_exceptionback to summary
public void throw_exception(Type type, String msg)
unboxback to summary
public void unbox(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:Type

the class indicating the desired type of the top stack value

unbox_or_zeroback to summary
public void unbox_or_zero(Type type)

Unboxes the object on the top of the stack. If the object is null, the unboxed primitive value becomes zero.

visitMaxsback to summary
public void visitMaxs(int maxStack, int maxLocals)

Overrides org.springframework.cglib.core.LocalVariablesSorter.visitMaxs.

Doc from org.springframework.asm.MethodVisitor.visitMaxs.

Visits the maximum stack size and the maximum number of local variables of the method.

Parameters
maxStack:int

maximum stack size of the method.

maxLocals:int

maximum number of local variables for the method.

Annotations
@Override
zero_or_nullback to summary
public void zero_or_null(Type type)

Pushes a zero onto the stack if the argument is a primitive class, or a null otherwise.

org.springframework.cglib.core back to summary

private Class CodeEmitter.State

extends MethodInfo
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv int
pack-priv Type[]
pack-priv ClassInfo
pack-priv Type[]
pack-priv int
pack-priv Signature

Constructor Summary

AccessConstructor and Description
pack-priv
State(ClassInfo classInfo, int access, Signature sig, Type[] exceptionTypes)

Method Summary

Modifier and TypeMethod and Description
public ClassInfo
public Type[]
public int
public Signature
Inherited from org.springframework.cglib.core.MethodInfo:
equalshashCodetoString

Field Detail

accessback to summary
pack-priv int access
argumentTypesback to summary
pack-priv Type[] argumentTypes
classInfoback to summary
pack-priv ClassInfo classInfo
exceptionTypesback to summary
pack-priv Type[] exceptionTypes
localOffsetback to summary
pack-priv int localOffset
sigback to summary
pack-priv Signature sig

Constructor Detail

Stateback to summary
pack-priv State(ClassInfo classInfo, int access, Signature sig, Type[] exceptionTypes)

Method Detail

getClassInfoback to summary
public ClassInfo getClassInfo()

Implements abstract org.springframework.cglib.core.MethodInfo.getClassInfo.

Annotations
@Override
getExceptionTypesback to summary
public Type[] getExceptionTypes()

Implements abstract org.springframework.cglib.core.MethodInfo.getExceptionTypes.

Annotations
@Override
getModifiersback to summary
public int getModifiers()

Implements abstract org.springframework.cglib.core.MethodInfo.getModifiers.

Annotations
@Override
getSignatureback to summary
public Signature getSignature()

Implements abstract org.springframework.cglib.core.MethodInfo.getSignature.

Annotations
@Override