本文整理匯總了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);
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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();
}
示例9: toString
@Override
public String toString()
{
return instruction.getOpcode() != -1
? Printer.OPCODES[instruction.getOpcode()]
: super.toString();
}
示例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+"]";
}
示例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()] : "????");
}
示例12: toString
@Override
public String toString() {
return Printer.OPCODES[opcode()] + ", " + operand;
}
示例13: toString
@Override
public String toString() {
return "INSNNODE: " + Printer.OPCODES[opcode];
}
示例14: toString
@Override
public String toString() {
return instruction.getOpcode() != -1 ? Printer.OPCODES[instruction.getOpcode()] : super.toString();
}
示例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;
}