Package javassist.bytecode

Examples of javassist.bytecode.Bytecode.addIndex()


    code.addInvokeinterface(enabled_class_index,
                            GETFIELDHANDLER_METHOD_NAME, GETFIELDHANDLER_METHOD_DESCRIPTOR,
                            1);
    // ifnonnull
    code.addOpcode(Opcode.IFNONNULL);
    code.addIndex(4);
    // *return // each type
    addTypeDependDataReturn(code, finfo.getDescriptor());
    // *store_1 // each type
    addTypeDependDataStore(code, finfo.getDescriptor(), 1);
    // aload_0
View Full Code Here


    code.addInvokeinterface(enabled_class_index,
                            GETFIELDHANDLER_METHOD_NAME, GETFIELDHANDLER_METHOD_DESCRIPTOR,
                            1);
    // ifnonnull (label1)
    code.addOpcode(Opcode.IFNONNULL);
    code.addIndex(9);
    // aload_0
    code.addAload(0);
    // *load_1
    addTypeDependDataLoad(code, finfo.getDescriptor(), 1);
    // putfield
View Full Code Here

    addTypeDependDataLoad(code, finfo.getDescriptor(), 1);
    // putfield
    code.addOpcode(Opcode.PUTFIELD);
    int base_field_index = cp.addFieldrefInfo(this_class_index, finfo
        .getName(), finfo.getDescriptor());
    code.addIndex(base_field_index);
    code.growStack(-Descriptor.dataSize(finfo.getDescriptor()));
    // return ;
    code.addOpcode(Opcode.RETURN);
    // aload_0
    code.addAload(0);
View Full Code Here

    code.addLdc(finfo.getName());
    // aload_0
    code.addAload(0);
    // getfield // old value of the field
    code.addOpcode(Opcode.GETFIELD);
    code.addIndex(base_field_index);
    code.growStack(Descriptor.dataSize(finfo.getDescriptor()) - 1);
    // *load_1
    addTypeDependDataLoad(code, finfo.getDescriptor(), 1);
    // invokeinterface // callback.write*(..)
    addInvokeFieldHandlerMethod(classfile, code, finfo.getDescriptor(),
View Full Code Here

    // invokeinterface // callback.write*(..)
    addInvokeFieldHandlerMethod(classfile, code, finfo.getDescriptor(),
                                false);
    // putfield // new value of the field
    code.addOpcode(Opcode.PUTFIELD);
    code.addIndex(base_field_index);
    code.growStack(-Descriptor.dataSize(finfo.getDescriptor()));
    // return
    code.addOpcode(Opcode.RETURN);

    minfo.setCodeAttribute(code.toCodeAttribute());
View Full Code Here

/* 1067 */       code.addAload(0);
/* 1068 */       code.addGetstatic(thisClassName, "default_interceptor", HANDLER_TYPE);
/* 1069 */       code.addPutfield(thisClassName, "handler", HANDLER_TYPE);
/* 1070 */       code.addGetstatic(thisClassName, "default_interceptor", HANDLER_TYPE);
/* 1071 */       code.addOpcode(199);
/* 1072 */       code.addIndex(10);
/*      */     }
/*      */
/* 1076 */     code.addAload(0);
/* 1077 */     code.addGetstatic("javassist.util.proxy.RuntimeSupport", "default_interceptor", HANDLER_TYPE);
/* 1078 */     code.addPutfield(thisClassName, "handler", HANDLER_TYPE);
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

/*      */     }
/*  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);
/*  217 */     while (catchList != null)
View Full Code Here

/*  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;
/*      */       }
/*      */     }
/*      */
/*  243 */     if (finallyBlock != null) {
View Full Code Here

/*  281 */       CodeGen.ReturnHook hook = new JsrHook2(this, ret);
/*  282 */       finallyBlock.accept(this);
/*  283 */       hook.remove(this);
/*  284 */       if (!this.hasReturned) {
/*  285 */         bc.addOpcode(167);
/*  286 */         bc.addIndex(pc + 3 - bc.currentPc());
/*      */       }
/*      */     }
/*      */   }
/*      */
/*      */   public void atNewExpr(NewExpr expr) throws CompileError {
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.