@Override
 public void visitCode() {
   mv.visitVarInsn(ALOAD, 0);
   mv.visitVarInsn(ALOAD, 0);
   // mv.visitFieldInsn(GETFIELD, owner, TraceSQL.PSTMT_PARAM_FIELD,
   // "Lscouter/agent/trace/SqlParameter;");
   mv.visitMethodInsn(Opcodes.INVOKESTATIC, TRACESQL, METHOD, SIGNATURE);
   super.visitCode();
 }
Example #2
0
  @Override
  public void visitCode() {

    AsmUtil.PUSH(mv, methodName);

    boolean flag = false;
    int sidx = isStatic ? 0 : 1;
    for (int i = 0; i < paramTypes.length; i++) {
      Type tp = paramTypes[i];
      if ("java/lang/String".equals(tp.getInternalName())) {
        mv.visitVarInsn(Opcodes.ALOAD, sidx);
        flag = true;
        break;
      }
      sidx += tp.getSize();
    }

    if (flag == false) {
      AsmUtil.PUSH(mv, "");
    }
    mv.visitMethodInsn(Opcodes.INVOKESTATIC, CLASS, METHOD, SIGNATURE, false);
    super.visitCode();
  }