public CodeEmitter begin_static() { return begin_method(Constants.ACC_STATIC, Constants.SIG_STATIC, null); }
public static CodeEmitter begin_method(ClassEmitter e, MethodInfo method, int access) { return e.begin_method(access, method.getSignature(), method.getExceptionTypes()); } }
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { return begin_method(access, new Signature(name, desc), TypeUtils.fromInternalNames(exceptions)); } }
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { return begin_method(access, new Signature(name, desc), TypeUtils.fromInternalNames(exceptions)); } }
public static CodeEmitter begin_method(ClassEmitter e, MethodInfo method, int access) { return e.begin_method(access, method.getSignature(), method.getExceptionTypes()); } }
public void generateClass(ClassVisitor v) throws Exception { ClassEmitter ce = new ClassEmitter(v); ce.begin_class(Constants.V1_2, Constants.ACC_PUBLIC | Constants.ACC_INTERFACE, getClassName(), null, null, Constants.SOURCE_FILE); for (Iterator it = signatures.keySet().iterator(); it.hasNext();) { Signature sig = (Signature)it.next(); Type[] exceptions = (Type[])signatures.get(sig); ce.begin_method(Constants.ACC_PUBLIC | Constants.ACC_ABSTRACT, sig, exceptions).end_method(); } ce.end_class(); } }
private void emitSetStaticCallbacks(ClassEmitter ce) { CodeEmitter e = ce.begin_method(Constants.ACC_PUBLIC | Constants.ACC_STATIC, SET_STATIC_CALLBACKS, null); e.load_arg(0); e.putfield(STATIC_CALLBACKS_FIELD); e.return_value(); e.end_method(); }
public static void null_constructor(ClassEmitter ce) { CodeEmitter e = ce.begin_method(Constants.ACC_PUBLIC, CSTRUCT_NULL, null); e.load_this(); e.super_invoke_constructor(); e.return_value(); e.end_method(); }
private void emitNewInstanceCallbacks(ClassEmitter ce) { CodeEmitter e = ce.begin_method(Constants.ACC_PUBLIC, NEW_INSTANCE, null); Type thisType = getThisType(e); e.load_arg(0); e.invoke_static(thisType, SET_THREAD_CALLBACKS); emitCommonNewInstance(e); }
public CodeEmitter getStaticHook() { if (TypeUtils.isInterface(getAccess())) { throw new IllegalStateException("static hook is invalid for this class"); } if (staticHook == null) { staticHookSig = new Signature("CGLIB$STATICHOOK" + getNextHook(), "()V"); staticHook = begin_method(Constants.ACC_STATIC, staticHookSig, null); if (staticInit != null) { staticInit.invoke_static_this(staticHookSig); } } return staticHook; }
public static void null_constructor(ClassEmitter ce) { CodeEmitter e = ce.begin_method(Constants.ACC_PUBLIC, CSTRUCT_NULL, null); e.load_this(); e.super_invoke_constructor(); e.return_value(); e.end_method(); }
private void emitNewInstanceCallbacks(ClassEmitter ce) { CodeEmitter e = ce.begin_method(Constants.ACC_PUBLIC, NEW_INSTANCE, null); Type thisType = getThisType(e); e.load_arg(0); e.invoke_static(thisType, SET_THREAD_CALLBACKS); emitCommonNewInstance(e); }
public CodeEmitter getStaticHook() { if (TypeUtils.isInterface(getAccess())) { throw new IllegalStateException("static hook is invalid for this class"); } if (staticHook == null) { staticHookSig = new Signature("CGLIB$STATICHOOK" + getNextHook(), "()V"); staticHook = begin_method(Constants.ACC_STATIC, staticHookSig, null); if (staticInit != null) { staticInit.invoke_static_this(staticHookSig); } } return staticHook; }
private void emitSetStaticCallbacks(ClassEmitter ce) { CodeEmitter e = ce.begin_method(Constants.ACC_PUBLIC | Constants.ACC_STATIC, SET_STATIC_CALLBACKS, null); e.load_arg(0); e.putfield(STATIC_CALLBACKS_FIELD); e.return_value(); e.end_method(); }
private void emitSetThreadCallbacks(ClassEmitter ce) { CodeEmitter e = ce.begin_method(Constants.ACC_PUBLIC | Constants.ACC_STATIC, SET_THREAD_CALLBACKS, null); e.getfield(THREAD_CALLBACKS_FIELD); e.load_arg(0); e.invoke_virtual(THREAD_LOCAL, THREAD_LOCAL_SET); e.return_value(); e.end_method(); }
private void emitSetThreadCallbacks(ClassEmitter ce) { CodeEmitter e = ce.begin_method(Constants.ACC_PUBLIC | Constants.ACC_STATIC, SET_THREAD_CALLBACKS, null); e.getfield(THREAD_CALLBACKS_FIELD); e.load_arg(0); e.invoke_virtual(THREAD_LOCAL, THREAD_LOCAL_SET); e.return_value(); e.end_method(); }
public static void factory_method(ClassEmitter ce, Signature sig) { CodeEmitter e = ce.begin_method(Constants.ACC_PUBLIC, sig, null); e.new_instance_this(); e.dup(); e.load_args(); e.invoke_constructor_this(TypeUtils.parseConstructor(sig.getArgumentTypes())); e.return_value(); e.end_method(); }
public static void factory_method(ClassEmitter ce, Signature sig) { CodeEmitter e = ce.begin_method(Constants.ACC_PUBLIC, sig, null); e.new_instance_this(); e.dup(); e.load_args(); e.invoke_constructor_this(TypeUtils.parseConstructor(sig.getArgumentTypes())); e.return_value(); e.end_method(); }
private void emitSetCallbacks(ClassEmitter ce) { CodeEmitter e = ce.begin_method(Constants.ACC_PUBLIC, SET_CALLBACKS, null); e.load_this(); e.load_arg(0); for (int i = 0; i < callbackTypes.length; i++) { e.dup2(); e.aaload(i); e.checkcast(callbackTypes[i]); e.putfield(getCallbackField(i)); } e.return_value(); e.end_method(); }
private void emitSetCallbacks(ClassEmitter ce) { CodeEmitter e = ce.begin_method(Constants.ACC_PUBLIC, SET_CALLBACKS, null); e.load_this(); e.load_arg(0); for (int i = 0; i < callbackTypes.length; i++) { e.dup2(); e.aaload(i); e.checkcast(callbackTypes[i]); e.putfield(getCallbackField(i)); } e.return_value(); e.end_method(); }