Package net.sf.cglib.core

Examples of net.sf.cglib.core.CodeEmitter.load_arg()


/*     */   }
/*     */
/*     */   private void generateGet(Class target, Method[] getters) {
/*  58 */     CodeEmitter e = begin_method(1, GET_PROPERTY_VALUES, null, null);
/*  59 */     if (getters.length >= 0) {
/*  60 */       e.load_arg(0);
/*  61 */       e.checkcast(Type.getType(target));
/*  62 */       Local bean = e.make_local();
/*  63 */       e.store_local(bean);
/*  64 */       for (int i = 0; i < getters.length; i++) {
/*  65 */         if (getters[i] != null) {
View Full Code Here


/*  62 */       Local bean = e.make_local();
/*  63 */       e.store_local(bean);
/*  64 */       for (int i = 0; i < getters.length; i++) {
/*  65 */         if (getters[i] != null) {
/*  66 */           MethodInfo getter = ReflectUtils.getMethodInfo(getters[i]);
/*  67 */           e.load_arg(1);
/*  68 */           e.push(i);
/*  69 */           e.load_local(bean);
/*  70 */           e.invoke(getter);
/*  71 */           e.box(getter.getSignature().getReturnType());
/*  72 */           e.aastore();
View Full Code Here

/*      */   private void emitGetCallback(ClassEmitter ce, int[] keys) {
/*  730 */     CodeEmitter e = ce.begin_method(1, GET_CALLBACK, null, null);
/*  731 */     e.load_this();
/*  732 */     e.invoke_static_this(BIND_CALLBACKS);
/*  733 */     e.load_this();
/*  734 */     e.load_arg(0);
/*  735 */     e.process_switch(keys, new ProcessSwitchCallback(e) {
/*      */       public void processCase(int key, Label end) {
/*  737 */         this.val$e.getfield(Enhancer.access$000(key));
/*  738 */         this.val$e.goTo(end);
/*      */       }
View Full Code Here

/*      */   }
/*      */
/*      */   private void emitSetCallback(ClassEmitter ce, int[] keys) {
/*  750 */     CodeEmitter e = ce.begin_method(1, SET_CALLBACK, null, null);
/*  751 */     e.load_this();
/*  752 */     e.load_arg(1);
/*  753 */     e.load_arg(0);
/*  754 */     e.process_switch(keys, new ProcessSwitchCallback(e) {
/*      */       public void processCase(int key, Label end) {
/*  756 */         this.val$e.checkcast(Enhancer.this.callbackTypes[key]);
/*  757 */         this.val$e.putfield(Enhancer.access$000(key));
View Full Code Here

/*      */
/*      */   private void emitSetCallback(ClassEmitter ce, int[] keys) {
/*  750 */     CodeEmitter e = ce.begin_method(1, SET_CALLBACK, null, null);
/*  751 */     e.load_this();
/*  752 */     e.load_arg(1);
/*  753 */     e.load_arg(0);
/*  754 */     e.process_switch(keys, new ProcessSwitchCallback(e) {
/*      */       public void processCase(int key, Label end) {
/*  756 */         this.val$e.checkcast(Enhancer.this.callbackTypes[key]);
/*  757 */         this.val$e.putfield(Enhancer.access$000(key));
/*  758 */         this.val$e.goTo(end);
View Full Code Here

/*      */   }
/*      */
/*      */   private void emitSetCallbacks(ClassEmitter ce) {
/*  770 */     CodeEmitter e = ce.begin_method(1, SET_CALLBACKS, null, null);
/*  771 */     e.load_this();
/*  772 */     e.load_arg(0);
/*  773 */     for (int i = 0; i < this.callbackTypes.length; i++) {
/*  774 */       e.dup2();
/*  775 */       e.aaload(i);
/*  776 */       e.checkcast(this.callbackTypes[i]);
/*  777 */       e.putfield(getCallbackField(i));
View Full Code Here

/*  798 */     e.end_method();
/*      */   }
/*      */
/*      */   private void emitNewInstanceCallbacks(ClassEmitter ce) {
/*  802 */     CodeEmitter e = ce.begin_method(1, NEW_INSTANCE, null, null);
/*  803 */     e.load_arg(0);
/*  804 */     e.invoke_static_this(SET_THREAD_CALLBACKS);
/*  805 */     emitCommonNewInstance(e);
/*      */   }
/*      */
/*      */   private void emitCommonNewInstance(CodeEmitter e) {
View Full Code Here

/*      */     case 1:
/*  826 */       e.push(1);
/*  827 */       e.newarray(CALLBACK);
/*  828 */       e.dup();
/*  829 */       e.push(0);
/*  830 */       e.load_arg(0);
/*  831 */       e.aastore();
/*  832 */       e.invoke_static_this(SET_THREAD_CALLBACKS);
/*  833 */       break;
/*      */     default:
/*  835 */       e.throw_exception(ILLEGAL_STATE_EXCEPTION, "More than one callback object required");
View Full Code Here

/*  837 */     emitCommonNewInstance(e);
/*      */   }
/*      */
/*      */   private void emitNewInstanceMultiarg(ClassEmitter ce, List constructors) {
/*  841 */     CodeEmitter e = ce.begin_method(1, MULTIARG_NEW_INSTANCE, null, null);
/*  842 */     e.load_arg(2);
/*  843 */     e.invoke_static_this(SET_THREAD_CALLBACKS);
/*  844 */     e.new_instance_this();
/*  845 */     e.dup();
/*  846 */     e.load_arg(0);
/*  847 */     EmitUtils.constructor_switch(e, constructors, new ObjectSwitchCallback(e) {
View Full Code Here

/*  841 */     CodeEmitter e = ce.begin_method(1, MULTIARG_NEW_INSTANCE, null, null);
/*  842 */     e.load_arg(2);
/*  843 */     e.invoke_static_this(SET_THREAD_CALLBACKS);
/*  844 */     e.new_instance_this();
/*  845 */     e.dup();
/*  846 */     e.load_arg(0);
/*  847 */     EmitUtils.constructor_switch(e, constructors, new ObjectSwitchCallback(e) {
/*      */       public void processCase(Object key, Label end) {
/*  849 */         MethodInfo constructor = (MethodInfo)key;
/*  850 */         Type[] types = constructor.getSignature().getArgumentTypes();
/*  851 */         for (int i = 0; i < types.length; i++) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.