本文整理匯總了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;
}