Package javassist.bytecode

Examples of javassist.bytecode.Bytecode.currentPc()


        /* 25  */ addJump(code, Opcode.JSR, 31);
        /* 28  */ code.addAload(4);
        /* 30  */ code.addOpcode(Opcode.ATHROW);
        /* 31  */ code.addAstore(3);
        /* 32  */ code.addIload(1);
        int spos = code.currentPc();
        /* 33  */ code.addOpcode(Opcode.LOOKUPSWITCH);
                  code.addIndex(0); // 2 bytes pad - gets us to 36
                  code.add32bit(60 - spos); // default
                  code.add32bit(2); // 2 pairs
                  code.add32bit(15); code.add32bit(60 - spos);
View Full Code Here


/*      */     }
/*      */
/* 1076 */     code.addAload(0);
/* 1077 */     code.addGetstatic("javassist.util.proxy.RuntimeSupport", "default_interceptor", HANDLER_TYPE);
/* 1078 */     code.addPutfield(thisClassName, "handler", HANDLER_TYPE);
/* 1079 */     int pc = code.currentPc();
/*      */
/* 1081 */     code.addAload(0);
/* 1082 */     int s = addLoadParameters(code, cons.getParameterTypes(), 1);
/* 1083 */     code.addInvokespecial(superClass.getName(), "<init>", desc);
/* 1084 */     code.addOpcode(177);
View Full Code Here

/* 123 */       jv.compileStmnt(src);
/* 124 */       b.addAload(var);
/*     */
/* 126 */       int oldHandler = this.etable.handlerPc(this.index);
/* 127 */       b.addOpcode(167);
/* 128 */       b.addIndex(oldHandler - this.iterator.getCodeLength() - b.currentPc() + 1);
/*     */
/* 131 */       this.maxStack = b.getMaxStack();
/* 132 */       this.maxLocals = b.getMaxLocals();
/*     */
/* 134 */       int pos = this.iterator.append(b.get());
View Full Code Here

/*      */
/*  198 */     JsrHook jsrHook = null;
/*  199 */     if (finallyBlock != null) {
/*  200 */       jsrHook = new JsrHook(this);
/*      */     }
/*  202 */     int start = bc.currentPc();
/*  203 */     body.accept(this);
/*  204 */     int end = bc.currentPc();
/*  205 */     if (start == end) {
/*  206 */       throw new CompileError("empty try block");
/*      */     }
View Full Code Here

/*  199 */     if (finallyBlock != null) {
/*  200 */       jsrHook = new JsrHook(this);
/*      */     }
/*  202 */     int start = bc.currentPc();
/*  203 */     body.accept(this);
/*  204 */     int end = bc.currentPc();
/*  205 */     if (start == end) {
/*  206 */       throw new CompileError("empty try block");
/*      */     }
/*  208 */     boolean tryNotReturn = !this.hasReturned;
/*  209 */     if (tryNotReturn) {
View Full Code Here

/*  206 */       throw new CompileError("empty try block");
/*      */     }
/*  208 */     boolean tryNotReturn = !this.hasReturned;
/*  209 */     if (tryNotReturn) {
/*  210 */       bc.addOpcode(167);
/*  211 */       gotoList.add(new Integer(bc.currentPc()));
/*  212 */       bc.addIndex(0);
/*      */     }
/*      */
/*  215 */     int var = getMaxLocals();
/*  216 */     incMaxLocals(1);
View Full Code Here

/*      */
/*  224 */       decl.setLocalVar(var);
/*      */
/*  226 */       CtClass type = this.resolver.lookupClassByJvmName(decl.getClassName());
/*  227 */       decl.setClassName(MemberResolver.javaToJvmName(type.getName()));
/*  228 */       bc.addExceptionHandler(start, end, bc.currentPc(), type);
/*  229 */       bc.growStack(1);
/*  230 */       bc.addAstore(var);
/*  231 */       this.hasReturned = false;
/*  232 */       if (block != null) {
/*  233 */         block.accept(this);
View Full Code Here

/*  232 */       if (block != null) {
/*  233 */         block.accept(this);
/*      */       }
/*  235 */       if (!this.hasReturned) {
/*  236 */         bc.addOpcode(167);
/*  237 */         gotoList.add(new Integer(bc.currentPc()));
/*  238 */         bc.addIndex(0);
/*  239 */         tryNotReturn = true;
/*      */       }
/*      */     }
/*      */
View Full Code Here

/*      */     }
/*      */
/*  243 */     if (finallyBlock != null) {
/*  244 */       jsrHook.remove(this);
/*      */
/*  246 */       int pcAnyCatch = bc.currentPc();
/*  247 */       bc.addExceptionHandler(start, pcAnyCatch, pcAnyCatch, 0);
/*  248 */       bc.growStack(1);
/*  249 */       bc.addAstore(var);
/*  250 */       this.hasReturned = false;
/*  251 */       finallyBlock.accept(this);
View Full Code Here

/*      */       }
/*      */
/*  257 */       addFinally(jsrHook.jsrList, finallyBlock);
/*      */     }
/*      */
/*  260 */     int pcEnd = bc.currentPc();
/*  261 */     patchGoto(gotoList, pcEnd);
/*  262 */     this.hasReturned = (!tryNotReturn);
/*  263 */     if ((finallyBlock != null) &&
/*  264 */       (tryNotReturn))
/*  265 */       finallyBlock.accept(this);
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.