當前位置: 首頁>>代碼示例>>Java>>正文


Java Opcodes.IRETURN屬性代碼示例

本文整理匯總了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 });
		}
	}
}
 
開發者ID:sfPlayer1,項目名稱:Matcher,代碼行數:17,代碼來源:Analysis.java

示例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));
        }
    }
}
 
開發者ID:yutian-tianpl,項目名稱:byte-cobweb,代碼行數:24,代碼來源:MethodModifier.java

示例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());
}
 
開發者ID:RuiChen08,項目名稱:dacapobench,代碼行數:19,代碼來源:RuntimeInstrument.java

示例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;
}
 
開發者ID:baidu,項目名稱:openrasp,代碼行數:28,代碼來源:JettyHttpInputHook.java

示例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;
    }
}
 
開發者ID:ItzSomebody,項目名稱:DirectLeaks-AntiReleak-Remover,代碼行數:12,代碼來源:AnalyzerAdapter.java

示例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;
}
 
開發者ID:Meituan-Dianping,項目名稱:Robust,代碼行數:33,代碼來源:RobustAsmUtils.java

示例7: isReturn

private static boolean isReturn(AbstractInsnNode insn) {
  return Opcodes.IRETURN <= insn.getOpcode() && insn.getOpcode() <= Opcodes.RETURN;
}
 
開發者ID:inferjay,項目名稱:r8,代碼行數:3,代碼來源:JarSourceCode.java


注:本文中的org.objectweb.asm.Opcodes.IRETURN屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。