org.objectweb.asm.Opcodes# SOURCE_DEPRECATED 源码实例Demo

下面列出了org.objectweb.asm.Opcodes# SOURCE_DEPRECATED 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: Concurnas   文件: CodeSizeEvaluator.java

@Override
public void visitMethodInsn(
    final int opcodeAndSource,
    final String owner,
    final String name,
    final String descriptor,
    final boolean isInterface) {
  if (api < Opcodes.ASM5 && (opcodeAndSource & Opcodes.SOURCE_DEPRECATED) == 0) {
    // Redirect the call to the deprecated version of this method.
    super.visitMethodInsn(opcodeAndSource, owner, name, descriptor, isInterface);
    return;
  }
  int opcode = opcodeAndSource & ~Opcodes.SOURCE_MASK;

  if (opcode == INVOKEINTERFACE) {
    minSize += 5;
    maxSize += 5;
  } else {
    minSize += 3;
    maxSize += 3;
  }
  super.visitMethodInsn(opcodeAndSource, owner, name, descriptor, isInterface);
}
 
源代码2 项目: Concurnas   文件: MethodRemapper.java

@Override
public void visitMethodInsn(
    final int opcodeAndSource,
    final String owner,
    final String name,
    final String descriptor,
    final boolean isInterface) {
  if (api < Opcodes.ASM5 && (opcodeAndSource & Opcodes.SOURCE_DEPRECATED) == 0) {
    // Redirect the call to the deprecated version of this method.
    super.visitMethodInsn(opcodeAndSource, owner, name, descriptor, isInterface);
    return;
  }
  super.visitMethodInsn(
      opcodeAndSource,
      remapper.mapType(owner),
      remapper.mapMethodName(owner, name, descriptor),
      remapper.mapMethodDesc(descriptor),
      isInterface);
}
 
源代码3 项目: Concurnas   文件: AdviceAdapter.java

@Override
public void visitMethodInsn(
    final int opcodeAndSource,
    final String owner,
    final String name,
    final String descriptor,
    final boolean isInterface) {
  if (api < Opcodes.ASM5 && (opcodeAndSource & Opcodes.SOURCE_DEPRECATED) == 0) {
    // Redirect the call to the deprecated version of this method.
    super.visitMethodInsn(opcodeAndSource, owner, name, descriptor, isInterface);
    return;
  }
  super.visitMethodInsn(opcodeAndSource, owner, name, descriptor, isInterface);
  int opcode = opcodeAndSource & ~Opcodes.SOURCE_MASK;

  doVisitMethodInsn(opcode, descriptor);
}
 
源代码4 项目: Concurnas   文件: MethodNode.java

@Override
public void visitMethodInsn(
    final int opcodeAndSource,
    final String owner,
    final String name,
    final String descriptor,
    final boolean isInterface) {
  if (api < Opcodes.ASM5 && (opcodeAndSource & Opcodes.SOURCE_DEPRECATED) == 0) {
    // Redirect the call to the deprecated version of this method.
    super.visitMethodInsn(opcodeAndSource, owner, name, descriptor, isInterface);
    return;
  }
  int opcode = opcodeAndSource & ~Opcodes.SOURCE_MASK;

  instructions.add(new MethodInsnNode(opcode, owner, name, descriptor, isInterface));
}
 
源代码5 项目: Cafebabe   文件: MethodNode.java

@Override
public void visitMethodInsn(final int opcodeAndSource, final String owner, final String name, final String descriptor,
		final boolean isInterface) {
	if (api < Opcodes.ASM5 && (opcodeAndSource & Opcodes.SOURCE_DEPRECATED) == 0) {
		// Redirect the call to the deprecated version of this method.
		super.visitMethodInsn(opcodeAndSource, owner, name, descriptor, isInterface);
		return;
	}
	int opcode = opcodeAndSource & ~Opcodes.SOURCE_MASK;

	instructions.add(new MethodInsnNode(opcode, owner, name, descriptor, isInterface));
}
 
源代码6 项目: Concurnas   文件: InstructionAdapter.java

@Override
public void visitMethodInsn(
    final int opcodeAndSource,
    final String owner,
    final String name,
    final String descriptor,
    final boolean isInterface) {
  if (api < Opcodes.ASM5 && (opcodeAndSource & Opcodes.SOURCE_DEPRECATED) == 0) {
    // Redirect the call to the deprecated version of this method.
    super.visitMethodInsn(opcodeAndSource, owner, name, descriptor, isInterface);
    return;
  }
  int opcode = opcodeAndSource & ~Opcodes.SOURCE_MASK;

  switch (opcode) {
    case Opcodes.INVOKESPECIAL:
      invokespecial(owner, name, descriptor, isInterface);
      break;
    case Opcodes.INVOKEVIRTUAL:
      invokevirtual(owner, name, descriptor, isInterface);
      break;
    case Opcodes.INVOKESTATIC:
      invokestatic(owner, name, descriptor, isInterface);
      break;
    case Opcodes.INVOKEINTERFACE:
      invokeinterface(owner, name, descriptor);
      break;
    default:
      throw new IllegalArgumentException();
  }
}
 
源代码7 项目: Concurnas   文件: CheckMethodAdapter.java

@Override
public void visitMethodInsn(
    final int opcodeAndSource,
    final String owner,
    final String name,
    final String descriptor,
    final boolean isInterface) {
  if (api < Opcodes.ASM5 && (opcodeAndSource & Opcodes.SOURCE_DEPRECATED) == 0) {
    // Redirect the call to the deprecated version of this method.
    super.visitMethodInsn(opcodeAndSource, owner, name, descriptor, isInterface);
    return;
  }
  int opcode = opcodeAndSource & ~Opcodes.SOURCE_MASK;

  checkVisitCodeCalled();
  checkVisitMaxsNotCalled();
  checkOpcodeMethod(opcode, Method.VISIT_METHOD_INSN);
  if (opcode != Opcodes.INVOKESPECIAL || !"<init>".equals(name)) {
    checkMethodIdentifier(version, name, "name");
  }
  checkInternalName(version, owner, "owner");
  checkMethodDescriptor(version, descriptor);
  if (opcode == Opcodes.INVOKEVIRTUAL && isInterface) {
    throw new IllegalArgumentException("INVOKEVIRTUAL can't be used with interfaces");
  }
  if (opcode == Opcodes.INVOKEINTERFACE && !isInterface) {
    throw new IllegalArgumentException("INVOKEINTERFACE can't be used with classes");
  }
  if (opcode == Opcodes.INVOKESPECIAL && isInterface && (version & 0xFFFF) < Opcodes.V1_8) {
    throw new IllegalArgumentException(
        "INVOKESPECIAL can't be used with interfaces prior to Java 8");
  }
  super.visitMethodInsn(opcodeAndSource, owner, name, descriptor, isInterface);
  ++insnCount;
}
 
源代码8 项目: Concurnas   文件: AnalyzerAdapter.java

@Override
public void visitMethodInsn(
    final int opcodeAndSource,
    final String owner,
    final String name,
    final String descriptor,
    final boolean isInterface) {
  if (api < Opcodes.ASM5 && (opcodeAndSource & Opcodes.SOURCE_DEPRECATED) == 0) {
    // Redirect the call to the deprecated version of this method.
    super.visitMethodInsn(opcodeAndSource, owner, name, descriptor, isInterface);
    return;
  }
  super.visitMethodInsn(opcodeAndSource, owner, name, descriptor, isInterface);
  int opcode = opcodeAndSource & ~Opcodes.SOURCE_MASK;

  if (this.locals == null) {
    labels = null;
    return;
  }
  pop(descriptor);
  if (opcode != Opcodes.INVOKESTATIC) {
    Object value = pop();
    if (opcode == Opcodes.INVOKESPECIAL && name.equals("<init>")) {
      Object initializedValue;
      if (value == Opcodes.UNINITIALIZED_THIS) {
        initializedValue = this.owner;
      } else {
        initializedValue = uninitializedTypes.get(value);
      }
      for (int i = 0; i < locals.size(); ++i) {
        if (locals.get(i) == value) {
          locals.set(i, initializedValue);
        }
      }
      for (int i = 0; i < stack.size(); ++i) {
        if (stack.get(i) == value) {
          stack.set(i, initializedValue);
        }
      }
    }
  }
  pushDescriptor(descriptor);
  labels = null;
}
 
 方法所在类
 同类方法