Package javassist.bytecode

Examples of javassist.bytecode.Bytecode.toCodeAttribute()


/* 1325 */     Bytecode code = new Bytecode(cp, 0, 1);
/* 1326 */     code.addAload(0);
/* 1327 */     code.addInvokestatic("javassist.util.proxy.RuntimeSupport", "makeSerializedProxy", "(Ljava/lang/Object;)Ljavassist/util/proxy/SerializedProxy;");
/*      */
/* 1330 */     code.addOpcode(176);
/* 1331 */     minfo.setCodeAttribute(code.toCodeAttribute());
/* 1332 */     return minfo;
/*      */   }
/*      */
/*      */   public static abstract interface ClassLoaderProvider
/*      */   {
View Full Code Here


/*  65 */         regno += code.addLoad(regno, params[i]);
/*  66 */       code.setMaxLocals(regno + 1);
/*  67 */       code.addInvokespecial(this.clazz, "<init>", desc);
/*     */
/*  69 */       code.addReturn(null);
/*  70 */       minfo.setCodeAttribute(code.toCodeAttribute());
/*  71 */       cf.addMethod(minfo);
/*     */     }
/*     */     catch (CannotCompileException e) {
/*  74 */       throw new CompileError(e);
/*     */     }
View Full Code Here

/* 127 */         code.addInvokestatic(this.clazz, name, desc);
/*     */       else {
/* 129 */         code.addInvokevirtual(this.clazz, name, desc);
/*     */       }
/* 131 */       code.addReturn(Descriptor.getReturnType(desc, pool));
/* 132 */       minfo.setCodeAttribute(code.toCodeAttribute());
/* 133 */       cf.addMethod(minfo);
/*     */     }
/*     */     catch (CannotCompileException e) {
/* 136 */       throw new CompileError(e);
/*     */     }
View Full Code Here

/* 179 */         code.addGetfield(Bytecode.THIS, fieldName, fieldType);
/* 180 */         code.setMaxLocals(1);
/*     */       }
/*     */
/* 183 */       code.addReturn(Descriptor.toCtClass(fieldType, pool));
/* 184 */       minfo.setCodeAttribute(code.toCodeAttribute());
/* 185 */       cf.addMethod(minfo);
/* 186 */       this.accessors.put(key, minfo);
/* 187 */       return minfo;
/*     */     }
/*     */     catch (CannotCompileException e) {
View Full Code Here

/*  41 */       throw new CannotCompileException(e);
/*     */     }
/*     */
/*  44 */     Bytecode code = makeBody(declaring, declaring.getClassFile2(), body, parameterTypes, returnType, constParam);
/*     */
/*  46 */     mt.getMethodInfo2().setCodeAttribute(code.toCodeAttribute());
/*  47 */     return mt;
/*     */   }
/*     */
/*     */   static Bytecode makeBody(CtClass clazz, ClassFile classfile, CtMethod wrappedBody, CtClass[] parameters, CtClass returnType, CtMethod.ConstParameter cparam)
/*     */     throws CannotCompileException
View Full Code Here

/* 234 */         code.addPutfield(Bytecode.THIS, fieldName, fieldType);
/*     */       }
/*     */
/* 237 */       code.addReturn(null);
/* 238 */       code.setMaxLocals(reg);
/* 239 */       minfo.setCodeAttribute(code.toCodeAttribute());
/* 240 */       cf.addMethod(minfo);
/* 241 */       this.accessors.put(key, minfo);
/* 242 */       return minfo;
/*     */     }
/*     */     catch (CannotCompileException e) {
View Full Code Here

/* 282 */       throw new CannotCompileException(e);
/*     */     }
/*     */
/* 285 */     Bytecode code = CtNewWrappedMethod.makeBody(clazz, clazz.getClassFile2(), mbody, params, retType, constParam);
/*     */
/* 290 */     CodeAttribute cattr = code.toCodeAttribute();
/* 291 */     this.methodInfo.setCodeAttribute(cattr);
/* 292 */     this.methodInfo.setAccessFlags(this.methodInfo.getAccessFlags() & 0xFFFFFBFF);
/*     */   }
/*     */
/*     */   static class StringConstParameter extends CtMethod.ConstParameter
View Full Code Here

/* 148 */       throw new CannotCompileException(e);
/*     */     }
/*     */
/* 151 */     code.add(177);
/*     */
/* 154 */     cons.getMethodInfo2().setCodeAttribute(code.toCodeAttribute());
/* 155 */     return cons;
/*     */   }
/*     */
/*     */   public static CtConstructor skeleton(CtClass[] parameters, CtClass[] exceptions, CtClass declaring)
/*     */     throws CannotCompileException
View Full Code Here

/*  397 */       Javac jv = new Javac(cc);
/*  398 */       if (delegateMethod != null) {
/*  399 */         jv.recordProceed(delegateObj, delegateMethod);
/*      */       }
/*  401 */       Bytecode b = jv.compileBody(this, src);
/*  402 */       this.methodInfo.setCodeAttribute(b.toCodeAttribute());
/*  403 */       this.methodInfo.setAccessFlags(this.methodInfo.getAccessFlags() & 0xFFFFFBFF);
/*      */
/*  405 */       this.methodInfo.rebuildStackMapIf6(cc.getClassPool(), cc.getClassFile2());
/*  406 */       this.declaringClass.rebuildClassFile();
/*      */     }
View Full Code Here

/*    */     {
/* 35 */       CtConstructor cons = new CtConstructor(parameterTypes, declaring);
/* 36 */       cons.setExceptionTypes(exceptionTypes);
/* 37 */       Bytecode code = makeBody(declaring, declaring.getClassFile2(), howToCallSuper, body, parameterTypes, constParam);
/*    */
/* 40 */       cons.getMethodInfo2().setCodeAttribute(code.toCodeAttribute());
/* 41 */       return cons;
/*    */     } catch (NotFoundException e) {
/*    */     }
/* 44 */     throw new CannotCompileException(e);
/*    */   }
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.