Package org.objectweb.asm

Examples of org.objectweb.asm.CodeVisitor.visitFieldInsn()


        CodeVisitor mv = cv.visitMethod(ACC_PUBLIC, "unfixCe", "()V", null,
                null);
        // speedoFixCount--;
        mv.visitVarInsn(ALOAD, 0);
        mv.visitInsn(DUP);
        mv.visitFieldInsn(GETFIELD, classToWrite, FIX_FIELD_NAME, "I");
        mv.visitInsn(ICONST_1);
        mv.visitInsn(ISUB);
        mv.visitFieldInsn(PUTFIELD, classToWrite, FIX_FIELD_NAME, "I");

        mv.visitInsn(RETURN);
View Full Code Here


        mv.visitVarInsn(ALOAD, 0);
        mv.visitInsn(DUP);
        mv.visitFieldInsn(GETFIELD, classToWrite, FIX_FIELD_NAME, "I");
        mv.visitInsn(ICONST_1);
        mv.visitInsn(ISUB);
        mv.visitFieldInsn(PUTFIELD, classToWrite, FIX_FIELD_NAME, "I");

        mv.visitInsn(RETURN);
        mv.visitMaxs(0, 0);
    }
View Full Code Here

        }
        CodeVisitor mv = cv.visitMethod(ACC_PUBLIC, "getCeFixCount", "()I",
                null, null);
        // return speedoFixCount;
        mv.visitVarInsn(ALOAD, 0);
        mv.visitFieldInsn(GETFIELD, classToWrite, FIX_FIELD_NAME, "I");
        mv.visitInsn(IRETURN);
        mv.visitMaxs(0, 0);
    }

    /**
 
View Full Code Here

        }
        CodeVisitor mv = cv.visitMethod(ACC_PUBLIC, "getCeAge", "()J", null,
                null);
        // return speedoAge;
        mv.visitVarInsn(ALOAD, 0);
        mv.visitFieldInsn(GETFIELD, classToWrite, AGE_FIELD_NAME, "J");
        mv.visitInsn(LRETURN);
        mv.visitMaxs(0, 0);
    }

    /**
 
View Full Code Here

        CodeVisitor mv = cv.visitMethod(ACC_PUBLIC, "setCeAge", "(J)V", null,
                null);
        // this.speedoAge = a;
        mv.visitVarInsn(ALOAD, 0);
        mv.visitVarInsn(LLOAD, 1);
        mv.visitFieldInsn(PUTFIELD, classToWrite, AGE_FIELD_NAME, "J");
        mv.visitInsn(RETURN);
        mv.visitMaxs(0, 0);
    }
}
View Full Code Here

                  hasLongOrDouble |= sp.type.charAt(0) == 'D'
                        || sp.type.charAt(0) == 'J';
                  logger.log(BasicLevel.DEBUG, "add code: this." + sp.name + " = t." + sp.name);
                  _cv.visitVarInsn(Constants.ALOAD, 1); //Can be a long|double value
                  _cv.visitVarInsn(Constants.ALOAD, 0);
                  _cv.visitFieldInsn(Constants.GETFIELD, className, sp.name, sp.type);
                  _cv.visitFieldInsn(Constants.PUTFIELD, uicn, sp.name, sp.type);
              }
          }
      SpeedoClass tmp = current.getSuper();
      current = (tmp == current ? null : tmp);
View Full Code Here

                        || sp.type.charAt(0) == 'J';
                  logger.log(BasicLevel.DEBUG, "add code: this." + sp.name + " = t." + sp.name);
                  _cv.visitVarInsn(Constants.ALOAD, 1); //Can be a long|double value
                  _cv.visitVarInsn(Constants.ALOAD, 0);
                  _cv.visitFieldInsn(Constants.GETFIELD, className, sp.name, sp.type);
                  _cv.visitFieldInsn(Constants.PUTFIELD, uicn, sp.name, sp.type);
              }
          }
      SpeedoClass tmp = current.getSuper();
      current = (tmp == current ? null : tmp);
    }
View Full Code Here

                        methodName,
                        "(Ljava/lang/Object;)" + sp.type,
                        null,
                        null);
                _cv.visitVarInsn(Constants.ALOAD, 0);
                _cv.visitFieldInsn(Constants.GETFIELD, className, sp.name, sp.type);
                Type returnType = Type.getType(sp.type);
                _cv.visitInsn(returnType.getOpcode(Constants.IRETURN));
                _cv.visitMaxs(
                        (sp.type.equals("J") || sp.type.equals("D")) ? 2 : 1,
                        2);
View Full Code Here

                methodName,
                "()Ljava/lang/String;",
                null,
                null);
        mv.visitVarInsn(Constants.ALOAD, 0);
        mv.visitFieldInsn(Constants.GETFIELD,
                className, ADDED_FIELD_NAME, ADDED_FIELD_DESC);
        Type returnType = Type.getType(ADDED_FIELD_DESC);
        mv.visitInsn(returnType.getOpcode(Constants.IRETURN));
        mv.visitMaxs(1, 2);
View Full Code Here

                "(Ljava/lang/String;)V",
                null,
                null);
        mv.visitVarInsn(Constants.ALOAD, 0);
        mv.visitVarInsn(Constants.ALOAD, 1);
        mv.visitFieldInsn(Constants.PUTFIELD,
                className, ADDED_FIELD_NAME, ADDED_FIELD_DESC);
        mv.visitInsn(Constants.RETURN);
        mv.visitMaxs(2, 2);
    }
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.