Package javassist.bytecode

Examples of javassist.bytecode.Bytecode.addLoad()


/*  60 */       CtClass[] params = Descriptor.getParameterTypes(desc, pool);
/*  61 */       Bytecode code = new Bytecode(cp);
/*  62 */       code.addAload(0);
/*  63 */       int regno = 1;
/*  64 */       for (int i = 0; i < params.length; i++)
/*  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());
View Full Code Here


/*     */       }
/* 119 */       CtClass[] params = Descriptor.getParameterTypes(accDesc, pool);
/* 120 */       int regno = 0;
/* 121 */       Bytecode code = new Bytecode(cp);
/* 122 */       for (int i = 0; i < params.length; i++) {
/* 123 */         regno += code.addLoad(regno, params[i]);
/*     */       }
/* 125 */       code.setMaxLocals(regno);
/* 126 */       if (desc == accDesc)
/* 127 */         code.addInvokestatic(this.clazz, name, desc);
/*     */       else {
View Full Code Here

/* 222 */       minfo.setAccessFlags(8);
/* 223 */       minfo.addAttribute(new SyntheticAttribute(cp));
/* 224 */       Bytecode code = new Bytecode(cp);
/*     */       int reg;
/* 226 */       if (is_static) {
/* 227 */         int reg = code.addLoad(0, Descriptor.toCtClass(fieldType, pool));
/* 228 */         code.addPutstatic(Bytecode.THIS, fieldName, fieldType);
/*     */       }
/*     */       else {
/* 231 */         code.addAload(0);
/* 232 */         reg = code.addLoad(1, Descriptor.toCtClass(fieldType, pool)) + 1;
View Full Code Here

/* 227 */         int reg = code.addLoad(0, Descriptor.toCtClass(fieldType, pool));
/* 228 */         code.addPutstatic(Bytecode.THIS, fieldName, fieldType);
/*     */       }
/*     */       else {
/* 231 */         code.addAload(0);
/* 232 */         reg = code.addLoad(1, Descriptor.toCtClass(fieldType, pool)) + 1;
/*     */
/* 234 */         code.addPutfield(Bytecode.THIS, fieldName, fieldType);
/*     */       }
/*     */
/* 237 */       code.addReturn(null);
View Full Code Here

/* 231 */         bytecode.addStore(retVar, retType);
/*     */       }
/*     */
/* 234 */       jc.compileStmnt(statement);
/* 235 */       if (retType != CtClass.voidType) {
/* 236 */         bytecode.addLoad(retVar, retType);
/*     */       }
/* 238 */       replace0(pos, bytecode, opcodeSize);
/*     */     } catch (CompileError e) {
/* 240 */       throw new CannotCompileException(e); } catch (NotFoundException e) {
/* 241 */       throw new CannotCompileException(e);
View Full Code Here

/*     */
/* 118 */       bytecode.addConstZero(retType);
/* 119 */       bytecode.addStore(retVar, retType);
/*     */
/* 121 */       jc.compileStmnt(statement);
/* 122 */       bytecode.addLoad(retVar, retType);
/*     */
/* 124 */       replace0(pos, bytecode, 3);
/*     */     } catch (CompileError e) {
/* 126 */       throw new CannotCompileException(e); } catch (NotFoundException e) {
/* 127 */       throw new CannotCompileException(e);
View Full Code Here

/* 206 */           bytecode.addStore(retVar, retType);
/*     */         }
/*     */       }
/* 209 */       jc.compileStmnt(statement);
/* 210 */       if (read) {
/* 211 */         bytecode.addLoad(retVar, retType);
/*     */       }
/* 213 */       replace0(pos, bytecode, 3);
/*     */     } catch (CompileError e) {
/* 215 */       throw new CannotCompileException(e); } catch (NotFoundException e) {
/* 216 */       throw new CannotCompileException(e);
View Full Code Here

/*     */
/* 124 */       bytecode.addConstZero(retType);
/* 125 */       bytecode.addStore(retVar, retType);
/*     */
/* 127 */       jc.compileStmnt(statement);
/* 128 */       bytecode.addLoad(retVar, retType);
/*     */
/* 130 */       replace0(pos, bytecode, 3);
/*     */     } catch (CompileError e) {
/* 132 */       throw new CannotCompileException(e); } catch (NotFoundException e) {
/* 133 */       throw new CannotCompileException(e);
View Full Code Here

/* 272 */     Bytecode code = new Bytecode(cp, 3, 3);
/*     */     try {
/* 274 */       String fieldName = finfo.getName();
/* 275 */       if ((finfo.getAccessFlags() & 0x8) == 0) {
/* 276 */         code.addAload(0);
/* 277 */         code.addLoad(1, field.getType());
/* 278 */         code.addPutfield(Bytecode.THIS, fieldName, fieldType);
/*     */       }
/*     */       else {
/* 281 */         code.addLoad(1, field.getType());
/* 282 */         code.addPutstatic(Bytecode.THIS, fieldName, fieldType);
View Full Code Here

/* 276 */         code.addAload(0);
/* 277 */         code.addLoad(1, field.getType());
/* 278 */         code.addPutfield(Bytecode.THIS, fieldName, fieldType);
/*     */       }
/*     */       else {
/* 281 */         code.addLoad(1, field.getType());
/* 282 */         code.addPutstatic(Bytecode.THIS, fieldName, fieldType);
/*     */       }
/*     */
/* 285 */       code.addReturn(null);
/*     */     }
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.