本文整理汇总了Java中jdk.internal.org.objectweb.asm.Opcodes.IF_ACMPNE属性的典型用法代码示例。如果您正苦于以下问题:Java Opcodes.IF_ACMPNE属性的具体用法?Java Opcodes.IF_ACMPNE怎么用?Java Opcodes.IF_ACMPNE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类jdk.internal.org.objectweb.asm.Opcodes
的用法示例。
在下文中一共展示了Opcodes.IF_ACMPNE属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generateCmpBasedCode
private void generateCmpBasedCode(Type type, int nonIntOpcode, int intOpcode) {
boolean useNonIntOpcode = false;
if (type.equals(TypeList.LONG) || type.equals(TypeList.FLOAT)
|| type.equals(TypeList.DOUBLE)) {
if (type.equals(TypeList.LONG)) {
currentMV.visitInsn(Opcodes.LCMP);
} else if (type.equals(TypeList.FLOAT)) {
currentMV.visitInsn(Opcodes.FCMPL);
} else {
currentMV.visitInsn(Opcodes.DCMPL);
}
useNonIntOpcode = true;
}
int opcodeToUse;
if (!useNonIntOpcode) {
if (type instanceof TypeKlass) {
if (intOpcode == Opcodes.IF_ICMPEQ) {
opcodeToUse = Opcodes.IF_ACMPEQ;
} else if (intOpcode == Opcodes.IF_ICMPNE) {
opcodeToUse = Opcodes.IF_ACMPNE;
} else {
throw new Error("Can't compare references");
}
} else {
opcodeToUse = intOpcode;
}
} else {
opcodeToUse = nonIntOpcode;
}
Label retTrue = new Label();
Label end = new Label();
currentMV.visitJumpInsn(opcodeToUse, retTrue);
currentMV.visitInsn(Opcodes.ICONST_0);
currentMV.visitJumpInsn(Opcodes.GOTO, end);
currentMV.visitLabel(retTrue);
currentMV.visitInsn(Opcodes.ICONST_1);
currentMV.visitLabel(end);
}
示例2: visitJumpInsn
@Override
public void visitJumpInsn(final int opcode, final Label label) {
switch (opcode) {
case Opcodes.IFEQ:
ifeq(label);
break;
case Opcodes.IFNE:
ifne(label);
break;
case Opcodes.IFLT:
iflt(label);
break;
case Opcodes.IFGE:
ifge(label);
break;
case Opcodes.IFGT:
ifgt(label);
break;
case Opcodes.IFLE:
ifle(label);
break;
case Opcodes.IF_ICMPEQ:
ificmpeq(label);
break;
case Opcodes.IF_ICMPNE:
ificmpne(label);
break;
case Opcodes.IF_ICMPLT:
ificmplt(label);
break;
case Opcodes.IF_ICMPGE:
ificmpge(label);
break;
case Opcodes.IF_ICMPGT:
ificmpgt(label);
break;
case Opcodes.IF_ICMPLE:
ificmple(label);
break;
case Opcodes.IF_ACMPEQ:
ifacmpeq(label);
break;
case Opcodes.IF_ACMPNE:
ifacmpne(label);
break;
case Opcodes.GOTO:
goTo(label);
break;
case Opcodes.JSR:
jsr(label);
break;
case Opcodes.IFNULL:
ifnull(label);
break;
case Opcodes.IFNONNULL:
ifnonnull(label);
break;
default:
throw new IllegalArgumentException();
}
}