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

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

源代码1 项目: obfuscator   文件: NodeUtils.java

public static AbstractInsnNode getWrapperMethod(Type type) {
    if (type.getSort() != Type.VOID && TYPE_TO_WRAPPER.containsKey(type)) {
        return new MethodInsnNode(Opcodes.INVOKESTATIC, TYPE_TO_WRAPPER.get(type), "valueOf", "(" + type.toString() + ")L" + TYPE_TO_WRAPPER.get(type) + ";", false);
    }

    return new InsnNode(Opcodes.NOP);
}
 
源代码2 项目: obfuscator   文件: NodeUtils.java

public static AbstractInsnNode getUnWrapMethod(Type type) {
    if (TYPE_TO_WRAPPER.containsKey(type)) {
        String internalName = Utils.getInternalName(type);
        return new MethodInsnNode(Opcodes.INVOKESTATIC, TYPE_TO_WRAPPER.get(type), internalName + "Value", "(L" + TYPE_TO_WRAPPER.get(type) + ";)" + type.toString(), false);
    }

    return new InsnNode(Opcodes.NOP);
}
 
源代码3 项目: javaide   文件: LintUtils.java

/**
 * Returns the previous opcode prior to the given node, ignoring label and
 * line number nodes
 *
 * @param node the node to look up the previous opcode for
 * @return the previous opcode, or {@link Opcodes#NOP} if no previous node
 *         was found
 */
public static int getPrevOpcode(@NonNull AbstractInsnNode node) {
    AbstractInsnNode prev = getPrevInstruction(node);
    if (prev != null) {
        return prev.getOpcode();
    } else {
        return Opcodes.NOP;
    }
}
 
源代码4 项目: javaide   文件: LintUtils.java

/**
 * Returns the next opcode after to the given node, ignoring label and line
 * number nodes
 *
 * @param node the node to look up the next opcode for
 * @return the next opcode, or {@link Opcodes#NOP} if no next node was found
 */
public static int getNextOpcode(@NonNull AbstractInsnNode node) {
    AbstractInsnNode next = getNextInstruction(node);
    if (next != null) {
        return next.getOpcode();
    } else {
        return Opcodes.NOP;
    }
}
 

/**
 * Test method for {@link ByteInstruction#ByteInstruction(int, int)} .
 */
public void testByteInstruction() {

   final int code = Opcodes.NOP;
   final ByteInstruction bi = new ByteInstruction(code,
           ByteInstruction.START_STACK_INDEX);

   assertNotNull(bi);

   assertEquals(Opcodes.NOP, bi.code);
   assertEquals(ByteInstruction.START_STACK_INDEX, bi.stackIndex);
   assertEquals(ByteInstruction.START_STACK_INDEX, bi.nextStackIndex);
}
 
源代码6 项目: cacheonix-core   文件: ByteInstruction.java

/**
 * Class Constructor
 */
public ByteInstruction() {

   this.code = Opcodes.NOP;
   this.stackIndex = START_STACK_INDEX;
   this.nextStackIndex = START_STACK_INDEX;
}
 

@Override
public void visitFrame(int type, int numLocal, Object[] local, int numStack, Object[] stack) {
    if (padding) {
        super.visitInsn(Opcodes.NOP);
    } else {
        padding = true;
    }
    super.visitFrame(type, numLocal, local, numStack, stack);
}
 
源代码8 项目: Concurnas   文件: CheckMethodAdapter.java

/**
 * Checks that the method to visit the given opcode is equal to the given method.
 *
 * @param opcode the opcode to be checked.
 * @param method the expected visit method.
 */
private static void checkOpcodeMethod(final int opcode, final Method method) {
  if (opcode < Opcodes.NOP || opcode > Opcodes.IFNONNULL || OPCODE_METHODS[opcode] != method) {
    throw new IllegalArgumentException("Invalid opcode: " + opcode);
  }
}
 

/**
 * Checks that the method to visit the given opcode is equal to the given method.
 *
 * @param opcode the opcode to be checked.
 * @param method the expected visit method.
 */
private static void checkOpcodeMethod(final int opcode, final Method method) {
  if (opcode < Opcodes.NOP || opcode > Opcodes.IFNONNULL || OPCODE_METHODS[opcode] != method) {
    throw new IllegalArgumentException("Invalid opcode: " + opcode);
  }
}
 
源代码10 项目: JReFrameworker   文件: CheckMethodAdapter.java

/**
 * Checks that the method to visit the given opcode is equal to the given method.
 *
 * @param opcode the opcode to be checked.
 * @param method the expected visit method.
 */
private static void checkOpcodeMethod(final int opcode, final Method method) {
  if (opcode < Opcodes.NOP || opcode > Opcodes.IFNONNULL || OPCODE_METHODS[opcode] != method) {
    throw new IllegalArgumentException("Invalid opcode: " + opcode);
  }
}
 
 方法所在类
 同类方法