コード例 #1
0
 @Override
 public void visitFrame(int arg0, int arg1, Object[] arg2, int arg3, Object[] arg4) {
   if (removingMethodBody()) {
     return;
   }
   super.visitFrame(arg0, arg1, arg2, arg3, arg4);
 }
 public void visitMethodInsn(int opcode, String owner, String name, String desc) {
   // 调用父类的构造函数时
   if (opcode == Opcodes.INVOKESPECIAL && name.equals("<init>")) {
     owner = superClassName;
   }
   super.visitMethodInsn(opcode, owner, name, desc); // 改写父类为 superClassName
 }
コード例 #3
0
 @Override
 public void visitInsn(final int opcode) {
   if (opcode == Opcodes.DUP) {
     machine.gotDup();
     if (machine.skipInstruction()) return;
   }
   super.visitInsn(opcode);
 }
コード例 #4
0
 @Override
 public void visitAttribute(Attribute attr) {
   if (removingMethodBody()) {
     return;
   }
   instrumentationStatsRecord.addInstruction();
   super.visitAttribute(attr);
 }
コード例 #5
0
 @Override
 public void visitIincInsn(int var, int increment) {
   if (removingMethodBody()) {
     return;
   }
   instrumentationStatsRecord.addInstruction();
   super.visitIincInsn(var, increment);
 }
コード例 #6
0
 @Override
 public void visitLdcInsn(Object arg0) {
   if (removingMethodBody()) {
     return;
   }
   instrumentationStatsRecord.addInstruction();
   super.visitLdcInsn(arg0);
 }
コード例 #7
0
 @Override
 public void visitFieldInsn(int opcode, String owner, String name, String desc) {
   if (removingMethodBody()) {
     return;
   }
   instrumentationStatsRecord.addInstruction();
   super.visitFieldInsn(opcode, owner, name, desc);
 }
コード例 #8
0
 @Override
 public void visitTableSwitchInsn(int arg0, int arg1, Label arg2, Label[] arg3) {
   if (removingMethodBody()) {
     return;
   }
   instrumentationStatsRecord.addInstruction();
   super.visitTableSwitchInsn(arg0, arg1, arg2, arg3);
 }
コード例 #9
0
 @Override
 public void visitTypeInsn(int arg0, String arg1) {
   if (removingMethodBody()) {
     return;
   }
   instrumentationStatsRecord.addInstruction();
   super.visitTypeInsn(arg0, arg1);
 }
コード例 #10
0
 @Override
 public void visitVarInsn(int opcode, int var) {
   if (removingMethodBody()) {
     return;
   }
   instrumentationStatsRecord.addInstruction();
   super.visitVarInsn(opcode, var);
 }
コード例 #11
0
 @Override
 public void visitFieldInsn(
     final int opcode, final String owner, final String name, final String desc) {
   if (opcode == Opcodes.PUTSTATIC) {
     machine.gotPutStatic(owner);
     if (machine.skipInstruction()) return;
   }
   super.visitFieldInsn(opcode, owner, name, desc);
 }
コード例 #12
0
 @Override
 public void visitTypeInsn(final int opcode, final String desc) {
   System.out.println(desc);
   if (opcode == Opcodes.NEW) {
     machine.gotNew(desc);
     if (machine.skipInstruction()) return;
   }
   super.visitTypeInsn(opcode, desc);
 }
コード例 #13
0
 @Override
 public void visitMethodInsn(
     final int opcode, final String owner, final String name, final String desc) {
   if (opcode == Opcodes.INVOKESPECIAL) {
     machine.gotInvokeSpecial(owner);
     if (machine.skipInstruction()) return;
   }
   super.visitMethodInsn(opcode, owner, name, desc);
 }
コード例 #14
0
 /** * Parse the local variables */
 @Override
 public void visitLocalVariable(
     String name, String desc, String signature, Label start, Label end, int index) {
   if (removingMethodBody()) {
     return;
   }
   instrumentationStatsRecord.addInstruction();
   super.visitLocalVariable(name, desc, signature, start, end, index);
 }
コード例 #15
0
 public void visitInsn(final int opcode) {
   if (opcode == RETURN) {
     for (Iterator i4 = m_mixinFields.values().iterator(); i4.hasNext(); ) {
       MixinFieldInfo fieldInfo = (MixinFieldInfo) i4.next();
       if (!fieldInfo.isStatic) {
         initializeMemberMixinField(mv, fieldInfo);
       }
     }
   }
   super.visitInsn(opcode);
 }
コード例 #16
0
  @Override
  public void visitLabel(Label arg0) {
    if (removingMethodBody()) {
      return;
    }

    if (allStartingTryCatchingBlockLabels != null
        && allStartingTryCatchingBlockLabels.contains(arg0)) {
      ++tryCatchDepth;
    } else if (allEndingTryCatchingBlockLabels != null
        && allEndingTryCatchingBlockLabels.contains(arg0)) {
      --tryCatchDepth;
    }
    super.visitLabel(arg0);
  }
コード例 #17
0
 @Override
 public void visitIntInsn(final int opcode, final int operand) {
   machine.gotSomethingWrong();
   super.visitIntInsn(opcode, operand);
 }
コード例 #18
0
 @Override
 public void visitJumpInsn(final int opcode, final Label label) {
   machine.gotSomethingWrong();
   super.visitJumpInsn(opcode, label);
 }
コード例 #19
0
 @Override
 public void visitLdcInsn(final Object cst) {
   machine.gotSomethingWrong();
   super.visitLdcInsn(cst);
 }
コード例 #20
0
 @Override
 public void visitIincInsn(final int var, final int increment) {
   machine.gotSomethingWrong();
   super.visitIincInsn(var, increment);
 }
コード例 #21
0
 @Override
 public void visitTableSwitchInsn(
     final int min, final int max, final Label dflt, final Label[] labels) {
   machine.gotSomethingWrong();
   super.visitTableSwitchInsn(min, max, dflt, labels);
 }
コード例 #22
0
 @Override
 public void visitLookupSwitchInsn(final Label dflt, final int[] keys, final Label[] labels) {
   machine.gotSomethingWrong();
   super.visitLookupSwitchInsn(dflt, keys, labels);
 }
コード例 #23
0
 @Override
 public void visitMultiANewArrayInsn(final String desc, final int dims) {
   machine.gotSomethingWrong();
   super.visitMultiANewArrayInsn(desc, dims);
 }
コード例 #24
0
 @Override
 public void visitVarInsn(final int opcode, final int var) {
   machine.gotSomethingWrong();
   super.visitVarInsn(opcode, var);
 }