本文整理汇总了Java中org.objectweb.asm.Opcodes.RET属性的典型用法代码示例。如果您正苦于以下问题:Java Opcodes.RET属性的具体用法?Java Opcodes.RET怎么用?Java Opcodes.RET使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.objectweb.asm.Opcodes
的用法示例。
在下文中一共展示了Opcodes.RET属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visitVarInsn
/**
* Imports variable load and store operations, as well as RET?!?
*
* @param opcode Opcode.
* @param var Variable index.
*/
@Override
public void visitVarInsn(final int opcode, final int var) {
switch(opcode) {
case Opcodes.ILOAD: createVarRead(var, Type.INT); break;
case Opcodes.LLOAD: createVarRead(var, Type.LONG); break;
case Opcodes.FLOAD: createVarRead(var, Type.FLOAT); break;
case Opcodes.DLOAD: createVarRead(var, Type.DOUBLE); break;
case Opcodes.ALOAD: createVarRead(var, Type.getFreshRef()); break;
case Opcodes.ISTORE: createVarWrite(var, Type.INT); break;
case Opcodes.LSTORE: createVarWrite(var, Type.LONG); break;
case Opcodes.FSTORE: createVarWrite(var, Type.FLOAT); break;
case Opcodes.DSTORE: createVarWrite(var, Type.DOUBLE); break;
case Opcodes.ASTORE: createVarWrite(var, Type.getFreshRef()); break;
// TODO: RET (paired with JSR)
case Opcodes.RET: throw new RuntimeException("visitVarInsn: RET");
}
}
示例2: visitVarInsn
@Override
public void visitVarInsn(final int opcode, final int var) {
switch (opcode) {
case Opcodes.ILOAD:
load(var, Type.INT_TYPE);
break;
case Opcodes.LLOAD:
load(var, Type.LONG_TYPE);
break;
case Opcodes.FLOAD:
load(var, Type.FLOAT_TYPE);
break;
case Opcodes.DLOAD:
load(var, Type.DOUBLE_TYPE);
break;
case Opcodes.ALOAD:
load(var, OBJECT_TYPE);
break;
case Opcodes.ISTORE:
store(var, Type.INT_TYPE);
break;
case Opcodes.LSTORE:
store(var, Type.LONG_TYPE);
break;
case Opcodes.FSTORE:
store(var, Type.FLOAT_TYPE);
break;
case Opcodes.DSTORE:
store(var, Type.DOUBLE_TYPE);
break;
case Opcodes.ASTORE:
store(var, OBJECT_TYPE);
break;
case Opcodes.RET:
ret(var);
break;
default:
throw new IllegalArgumentException();
}
}
示例3: isControlFlowInstruction
private static boolean isControlFlowInstruction(AbstractInsnNode insn) {
return isReturn(insn) || isThrow(insn) || isSwitch(insn) || (insn instanceof JumpInsnNode)
|| insn.getOpcode() == Opcodes.RET;
}
示例4: getVarTargets
private int[] getVarTargets(VarInsnNode insn) {
if (insn.getOpcode() == Opcodes.RET) {
throw new Unreachable("RET should be handled by the ASM jsr inliner");
}
return NO_TARGETS;
}