當前位置: 首頁>>代碼示例>>Java>>正文


Java Printer.OPCODES屬性代碼示例

本文整理匯總了Java中org.objectweb.asm.util.Printer.OPCODES屬性的典型用法代碼示例。如果您正苦於以下問題:Java Printer.OPCODES屬性的具體用法?Java Printer.OPCODES怎麽用?Java Printer.OPCODES使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.objectweb.asm.util.Printer的用法示例。


在下文中一共展示了Printer.OPCODES屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: visitTableSwitchInsn

@Override
public final void visitTableSwitchInsn(final int min, final int max,
        final Label dflt, final Label... labels) {
    AttributesImpl attrs = new AttributesImpl();
    attrs.addAttribute("", "min", "min", "", Integer.toString(min));
    attrs.addAttribute("", "max", "max", "", Integer.toString(max));
    attrs.addAttribute("", "dflt", "dflt", "", getLabel(dflt));
    String o = Printer.OPCODES[Opcodes.TABLESWITCH];
    sa.addStart(o, attrs);
    for (int i = 0; i < labels.length; i++) {
        AttributesImpl att2 = new AttributesImpl();
        att2.addAttribute("", "name", "name", "", getLabel(labels[i]));
        sa.addElement("label", att2);
    }
    sa.addEnd(o);
}
 
開發者ID:ItzSomebody,項目名稱:DirectLeaks-AntiReleak-Remover,代碼行數:16,代碼來源:SAXCodeAdapter.java

示例2: checkIntComparisonOpcode

private static void checkIntComparisonOpcode(Type comparisonType, int opcode) {
  switch (opcode) {
    case Opcodes.IFEQ:
    case Opcodes.IFNE:
      return;
    case Opcodes.IFGT:
    case Opcodes.IFGE:
    case Opcodes.IFLT:
    case Opcodes.IFLE:
      if (comparisonType.getSort() == Type.ARRAY || comparisonType.getSort() == Type.OBJECT) {
        throw new IllegalArgumentException(
            "Type: " + comparisonType + " cannot be compared via " + Printer.OPCODES[opcode]);
      }
      return;
    default:
      throw new IllegalArgumentException(
          "Unsupported opcode for comparison operation: " + opcode);
  }
}
 
開發者ID:google,項目名稱:closure-templates,代碼行數:19,代碼來源:BytecodeUtils.java

示例3: visitTableSwitchInsn

@Override
public final void visitTableSwitchInsn(
    final int min,
    final int max,
    final Label dflt,
    final Label... labels)
{
    AttributesImpl attrs = new AttributesImpl();
    attrs.addAttribute("", "min", "min", "", Integer.toString(min));
    attrs.addAttribute("", "max", "max", "", Integer.toString(max));
    attrs.addAttribute("", "dflt", "dflt", "", getLabel(dflt));
    String o = Printer.OPCODES[Opcodes.TABLESWITCH];
    sa.addStart(o, attrs);
    for (int i = 0; i < labels.length; i++) {
        AttributesImpl att2 = new AttributesImpl();
        att2.addAttribute("", "name", "name", "", getLabel(labels[i]));
        sa.addElement("label", att2);
    }
    sa.addEnd(o);
}
 
開發者ID:nxmatic,項目名稱:objectweb-asm-4.0,代碼行數:20,代碼來源:SAXCodeAdapter.java

示例4: visitLookupSwitchInsn

@Override
public final void visitLookupSwitchInsn(
    final Label dflt,
    final int[] keys,
    final Label[] labels)
{
    AttributesImpl att = new AttributesImpl();
    att.addAttribute("", "dflt", "dflt", "", getLabel(dflt));
    String o = Printer.OPCODES[Opcodes.LOOKUPSWITCH];
    sa.addStart(o, att);
    for (int i = 0; i < labels.length; i++) {
        AttributesImpl att2 = new AttributesImpl();
        att2.addAttribute("", "name", "name", "", getLabel(labels[i]));
        att2.addAttribute("", "key", "key", "", Integer.toString(keys[i]));
        sa.addElement("label", att2);
    }
    sa.addEnd(o);
}
 
開發者ID:nxmatic,項目名稱:objectweb-asm-4.0,代碼行數:18,代碼來源:SAXCodeAdapter.java

示例5: visitLookupSwitchInsn

@Override
public final void visitLookupSwitchInsn(final Label dflt, final int[] keys,
        final Label[] labels) {
    AttributesImpl att = new AttributesImpl();
    att.addAttribute("", "dflt", "dflt", "", getLabel(dflt));
    String o = Printer.OPCODES[Opcodes.LOOKUPSWITCH];
    sa.addStart(o, att);
    for (int i = 0; i < labels.length; i++) {
        AttributesImpl att2 = new AttributesImpl();
        att2.addAttribute("", "name", "name", "", getLabel(labels[i]));
        att2.addAttribute("", "key", "key", "", Integer.toString(keys[i]));
        sa.addElement("label", att2);
    }
    sa.addEnd(o);
}
 
開發者ID:ItzSomebody,項目名稱:DirectLeaks-AntiReleak-Remover,代碼行數:15,代碼來源:SAXCodeAdapter.java

示例6: opname

/**
 * Gets the name of the given opcode.
 *
 * @param opcode The opcode.
 * @return The name of the given opcode.
 */
public static String opname(int opcode) {
    if (opcode >= 0 && opcode < Printer.OPCODES.length) {
        return Printer.OPCODES[opcode];
    }
    return Integer.toString(opcode);
}
 
開發者ID:disassemble-io,項目名稱:asm-framework-full,代碼行數:12,代碼來源:Assembly.java

示例7: getOpcodeString

/**
 * Converts the opcode to string
 * @param opCode instruction number
 * @return mnemonic representation of the opcode
 */
public static String getOpcodeString(int opCode) {
	String op = "";
	if (opCode > -1) {
		op = Printer.OPCODES[opCode];
	}
	return op;
}
 
開發者ID:JozefCeluch,項目名稱:thesis-disassembler,代碼行數:12,代碼來源:Util.java

示例8: getInstructionType

/**
 * <p>
 * getInstructionType
 * </p>
 * 
 * @return a {@link java.lang.String} object.
 */
public String getInstructionType() {

	if (asmNode.getOpcode() >= 0 && asmNode.getOpcode() < Printer.OPCODES.length)
		return Printer.OPCODES[asmNode.getOpcode()];

	if (isLineNumber())
		return "LINE " + this.getLineNumber();

	return getType();
}
 
開發者ID:EvoSuite,項目名稱:evosuite,代碼行數:17,代碼來源:ASMWrapper.java

示例9: toString

@Override
public String toString()
{
    return instruction.getOpcode() != -1
        ? Printer.OPCODES[instruction.getOpcode()]
        : super.toString();
}
 
開發者ID:fge,項目名稱:grappa,代碼行數:7,代碼來源:InstructionGraphNode.java

示例10: toStringSrcs

private static String toStringSrcs(Collection<SinkableArrayValue> c)
{
	String r = "[";
	if(c != null)
	for(SinkableArrayValue s : c)
	{
		if(s.getSrc() != null)
			r += Printer.OPCODES[s.getSrc().getOpcode()]+ ", ";
	}
	return r+"]";
}
 
開發者ID:gmu-swe,項目名稱:phosphor,代碼行數:11,代碼來源:InstMethodSinkInterpreter.java

示例11: toString

@Override
public String toString() {
	if (this == NULL_VALUE)
		return "N";
	else
		return (flowsToInstMethodCall ? "T" : "F") + formatDesc() + " "+ (dontPropogateToDeps ? "T" : "F")+ (src != null && src.getOpcode() > 0 ? Printer.OPCODES[src.getOpcode()] : "????");
}
 
開發者ID:gmu-swe,項目名稱:phosphor,代碼行數:7,代碼來源:SinkableArrayValue.java

示例12: toString

@Override
public String toString() {
   	return Printer.OPCODES[opcode()] + ", " + operand;
   }
 
開發者ID:8BitPlus,項目名稱:BitPlus,代碼行數:4,代碼來源:IntInsnNode.java

示例13: toString

@Override
public String toString() {
   	return "INSNNODE: " + Printer.OPCODES[opcode];
   }
 
開發者ID:8BitPlus,項目名稱:BitPlus,代碼行數:4,代碼來源:InsnNode.java

示例14: toString

@Override
public String toString() {
    return instruction.getOpcode() != -1 ? Printer.OPCODES[instruction.getOpcode()] : super.toString();
}
 
開發者ID:parboiled1,項目名稱:parboiled,代碼行數:4,代碼來源:InstructionGraphNode.java

示例15: disassemble

private static String disassemble(AbstractInsnNode node,MethodNode method) 
{
    final int opCode = node.getOpcode();
    String mnemonic = Printer.OPCODES[opCode];

    switch( node.getType() ) 
    {
        case AbstractInsnNode.FIELD_INSN: // GETSTATIC, PUTSTATIC, GETFIELD , PUTFIELD
        FieldInsnNode tmp = (FieldInsnNode) node;
        mnemonic += " "+ ( tmp.owner+"#"+tmp.name );
        break;
        case AbstractInsnNode.IINC_INSN: // IINC
            IincInsnNode tmp2 = (IincInsnNode) node;
            mnemonic += " "+ ( tmp2.var+" , "+tmp2.incr );
            break;
        case AbstractInsnNode.INSN: // regular opcodes
            break;
        case AbstractInsnNode.INT_INSN: // BIPUSH, SIPUSH or NEWARRAY
            IntInsnNode tmp3 = (IntInsnNode) node;
            mnemonic += " "+ ( tmp3.operand );
            break;
        case AbstractInsnNode.INVOKE_DYNAMIC_INSN: // INVOKEDYNAMIC
            break;
        case AbstractInsnNode.JUMP_INSN: // IFEQ, IFNE, IFLT, IFGE, IFGT, IFLE, IF_ICMPEQ,IF_ICMPNE, IF_ICMPLT, IF_ICMPGE, IF_ICMPGT, IF_ICMPLE,IF_ACMPEQ, IF_ACMPNE, GOTO, JSR, IFNULL or IFNONNULL
            JumpInsnNode tmp4 = (JumpInsnNode) node;
            int index = method.instructions.indexOf( tmp4.label );
            while ( method.instructions.get( index ).getOpcode() == -1 ) {
            	index++;
            }
            mnemonic += " "+ index;
            break;
        case AbstractInsnNode.LDC_INSN: // load constant
            LdcInsnNode tmp5 = (LdcInsnNode) node;
            Class<?> clazz = tmp5.cst.getClass();
            if ( clazz == String.class ) {
                mnemonic += " \""+ tmp5.cst+"\"";
            } else if ( clazz == org.objectweb.asm.Type.class ) {
                org.objectweb.asm.Type type = (org.objectweb.asm.Type) tmp5.cst;
                mnemonic += " (a "+type.getClassName()+")";
            } else {
                mnemonic += " "+ tmp5.cst+" ("+tmp5.cst.getClass().getName()+")";
            }
            break;
        case AbstractInsnNode.LOOKUPSWITCH_INSN: // LOOKUPSWITCH
            break;
        case AbstractInsnNode.METHOD_INSN: // INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC , INVOKEINTERFACE
            MethodInsnNode tmp6 = (MethodInsnNode) node;
            mnemonic += " "+ ( tmp6.owner+"#"+tmp6.name+"()" );
            break;
        case AbstractInsnNode.MULTIANEWARRAY_INSN: // MULTIANEWARRAY
            break;
        case AbstractInsnNode.TABLESWITCH_INSN: // TABLESWITCH
            break;
        case AbstractInsnNode.TYPE_INSN: // NEW, ANEWARRAY, CHECKCAST , INSTANCEOF
            TypeInsnNode tmp8 = (TypeInsnNode) node;
            mnemonic += " "+tmp8.desc;
            break;
        case AbstractInsnNode.VAR_INSN: // ILOAD, LLOAD, FLOAD, DLOAD, ALOAD, ISTORE, LSTORE, FSTORE, DSTORE, ASTORE , RET
            VarInsnNode tmp7 = (VarInsnNode) node;
            mnemonic += "_"+tmp7.var;
            break;
            // -- VIRTUAL --
        case AbstractInsnNode.FRAME: /* VIRTUAL */
        case AbstractInsnNode.LABEL: /* VIRTUAL */
        case AbstractInsnNode.LINE: /* VIRTUAL */
        default:
            throw new RuntimeException("Internal error, unhandled node type: "+node);
    }
    return mnemonic;
}
 
開發者ID:toby1984,項目名稱:controlflow,代碼行數:70,代碼來源:Disassembler.java


注:本文中的org.objectweb.asm.util.Printer.OPCODES屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。