本文整理汇总了Java中org.objectweb.asm.Opcodes.IRETURN属性的典型用法代码示例。如果您正苦于以下问题:Java Opcodes.IRETURN属性的具体用法?Java Opcodes.IRETURN怎么用?Java Opcodes.IRETURN使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.objectweb.asm.Opcodes
的用法示例。
在下文中一共展示了Opcodes.IRETURN属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addDirectExits
private static void addDirectExits(InsnList il, BitSet entryPoints, Map<AbstractInsnNode, int[]> exitPoints) {
int idx = 0; // ignore 0 since it has no preceding instruction
while ((idx = entryPoints.nextSetBit(idx + 1)) != -1) {
AbstractInsnNode prev = il.get(idx - 1);
if (exitPoints.containsKey(prev)) continue;
int type = prev.getType();
if (prev.getOpcode() != Opcodes.ATHROW
&& (prev.getOpcode() < Opcodes.IRETURN || prev.getOpcode() > Opcodes.RETURN)
&& type != AbstractInsnNode.JUMP_INSN
&& type != AbstractInsnNode.TABLESWITCH_INSN
&& type != AbstractInsnNode.LOOKUPSWITCH_INSN) {
exitPoints.put(prev, new int[] { idx });
}
}
}
示例2: asmMethodReturn
/**
* 组装被拦截方法正常返回时的拦截动作
*/
@SuppressWarnings("unchecked")
private static void asmMethodReturn(MethodModifierContext context) {
InsnList il = context.mn.instructions;
Iterator<AbstractInsnNode> it = il.iterator();
while (it.hasNext()) {
AbstractInsnNode abstractInsnNode = it.next();
switch (abstractInsnNode.getOpcode()) {
case Opcodes.RETURN:
il.insertBefore(abstractInsnNode, createVoidReturnInstructions(context));
break;
case Opcodes.IRETURN:
case Opcodes.LRETURN:
case Opcodes.FRETURN:
case Opcodes.ARETURN:
case Opcodes.DRETURN:
il.insertBefore(abstractInsnNode, createReturnInstructions(context));
}
}
}
示例3: onMethodEnter
@SuppressWarnings("unused")
protected void onMethodEnter() {
if (done) return;
overridden = true;
Label start = new Label();
Label normal = new Label();
super.visitLabel(start);
super.visitFieldInsn(Opcodes.GETSTATIC, CONFIGURATION, CONFIGURATION_FIELD_NAME, Type.INT_TYPE.getDescriptor());
super.visitInsn(Opcodes.DUP);
super.visitJumpInsn(Opcodes.IFEQ, normal);
super.visitInsn(Opcodes.IRETURN);
super.visitLabel(normal);
super.visitInsn(Opcodes.POP);
Label end = new Label();
super.visitJumpInsn(Opcodes.GOTO, end);
super.visitLabel(end);
super.visitTryCatchBlock(start, normal, end, Type.getType(Throwable.class).getDescriptor());
}
示例4: hookMethod
@Override
protected MethodVisitor hookMethod(int access, String name, final String desc, String signature, String[] exceptions, MethodVisitor mv) {
if (name.equals("read")) {
return new AdviceAdapter(Opcodes.ASM5, mv, access, name, desc) {
@Override
protected void onMethodExit(int opcode) {
if (opcode == Opcodes.IRETURN) {
if (desc.equals("()I")) {
dup();
loadThis();
invokeStatic(Type.getType(HookHandler.class),
new Method("onInputStreamRead", "(ILjava/lang/Object;)V"));
} else if (desc.equals("([BII)I")) {
dup();
loadThis();
loadArg(0);
loadArg(1);
loadArg(2);
invokeStatic(Type.getType(HookHandler.class),
new Method("onInputStreamRead", "(ILjava/lang/Object;[BII)V"));
}
}
super.onMethodExit(opcode);
}
};
}
return mv;
}
示例5: visitInsn
@Override
public void visitInsn(final int opcode) {
if (mv != null) {
mv.visitInsn(opcode);
}
execute(opcode, 0, null);
if ((opcode >= Opcodes.IRETURN && opcode <= Opcodes.RETURN)
|| opcode == Opcodes.ATHROW) {
this.locals = null;
this.stack = null;
}
}
示例6: getReturnTypeCode
/**
* 针对不同类型返回指令不一样
*
* @param typeS
* @return
*/
private static int getReturnTypeCode(String typeS) {
if ("Z".equals(typeS)) {
return Opcodes.IRETURN;
}
if ("B".equals(typeS)) {
return Opcodes.IRETURN;
}
if ("C".equals(typeS)) {
return Opcodes.IRETURN;
}
if ("S".equals(typeS)) {
return Opcodes.IRETURN;
}
if ("I".equals(typeS)) {
return Opcodes.IRETURN;
}
if ("F".equals(typeS)) {
return Opcodes.FRETURN;
}
if ("D".equals(typeS)) {
return Opcodes.DRETURN;
}
if ("J".equals(typeS)) {
return Opcodes.LRETURN;
}
return Opcodes.ARETURN;
}
示例7: isReturn
private static boolean isReturn(AbstractInsnNode insn) {
return Opcodes.IRETURN <= insn.getOpcode() && insn.getOpcode() <= Opcodes.RETURN;
}