Package javassist.bytecode

Examples of javassist.bytecode.CodeIterator.byteAt()


/*     */     try
/*     */     {
/* 160 */       int op0 = it.byteAt(it.next());
/*     */       int pos;
/*     */       int desc;
/* 161 */       return (op0 == 177) || ((op0 == 42) && (it.byteAt(pos = it.next()) == 183) && ((desc = cp.isConstructor(getSuperclassName(), it.u16bitAt(pos + 1))) != 0) && ("()V".equals(cp.getUtf8Info(desc))) && (it.byteAt(it.next()) == 177) && (!it.hasNext()));
/*     */     }
/*     */     catch (BadBytecode e)
/*     */     {
/*     */     }
/*     */
View Full Code Here


/*     */     try
/*     */     {
/* 160 */       int op0 = it.byteAt(it.next());
/*     */       int pos;
/*     */       int desc;
/* 161 */       return (op0 == 177) || ((op0 == 42) && (it.byteAt(pos = it.next()) == 183) && ((desc = cp.isConstructor(getSuperclassName(), it.u16bitAt(pos + 1))) != 0) && ("()V".equals(cp.getUtf8Info(desc))) && (it.byteAt(it.next()) == 177) && (!it.hasNext()));
/*     */     }
/*     */     catch (BadBytecode e)
/*     */     {
/*     */     }
/*     */
View Full Code Here

/*     */   {
/*  62 */     CodeIterator iterator = minfo.getCodeAttribute().iterator();
/*  63 */     while (iterator.hasNext())
/*     */       try {
/*  65 */         int pos = iterator.next();
/*  66 */         int c = iterator.byteAt(pos);
/*     */
/*  68 */         if (c == 50) {
/*  69 */           initFrames(clazz, minfo);
/*     */         }
/*  71 */         if ((c == 50) || (c == 51) || (c == 52) || (c == 49) || (c == 48) || (c == 46) || (c == 47) || (c == 53))
View Full Code Here

        // find return
        int pos = 0;
        while (iter.hasNext()) {
            pos = iter.next();
            if (iter.byteAt(pos) == opcode)
                break;
        }
        return pos;
    }
View Full Code Here

        // find areturn
        int pos = 0;
        while (iter.hasNext()) {
            pos = iter.next();
            if (iter.byteAt(pos) == Opcode.ARETURN)
                break;
        }

        Analyzer analyzer = new Analyzer();
        Frame[] frames = analyzer.analyze(method.getDeclaringClass(), info);
View Full Code Here

        // find aaload
        int pos = 0;
        while (iter.hasNext()) {
            pos = iter.next();
            if (iter.byteAt(pos) == Opcode.AALOAD)
                break;
        }

        Analyzer analyzer = new Analyzer();
        Frame[] frames = analyzer.analyze(clazz, info);
View Full Code Here

    CodeAttribute codeAttribute = methodInfo.getCodeAttribute();
    if (codeAttribute != null) {
      CodeIterator iterator = codeAttribute.iterator();
      while (iterator.hasNext()) {
        int index = iterator.next();
        int op = iterator.byteAt(index);
        if (op == opcode && (removeIndex < 0 || removeIndex == ++currentIndex)) {
          for (int i = 0; i <= index; i++) {
            iterator.writeByte(Opcode.NOP, i);
          }
          removed++;
View Full Code Here

    CodeIterator iterator = codeAttribute.iterator();
    ConstPool constPool = codeAttribute.getConstPool();
    int done = 0;
    while (iterator.hasNext()) {
      int pos = iterator.next();
      int op = iterator.byteAt(pos);
      if (op == Opcode.INVOKEINTERFACE) {
        int mref = iterator.u16bitAt(pos + 1);
        if (constPool.getInterfaceMethodrefClassName(mref).endsWith("Lock")) {
          String name = constPool.getInterfaceMethodrefName(mref);
          boolean remove = false;
View Full Code Here

      while( iter.hasNext() )
      {
        int pos = iter.next();
       
        // update the hash with the opcode
        int opcode = iter.byteAt( pos );
        digest.update( (byte)opcode );
       
        switch( opcode )
        {
          case Opcode.LDC:
View Full Code Here

       
        switch( opcode )
        {
          case Opcode.LDC:
          {
            int constIndex = iter.byteAt( pos + 1 );
            updateHashWithConstant( digest, constants, constIndex );
          }
          break;
         
          case Opcode.LDC_W:
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.