当前位置: 首页>>代码示例>>Java>>正文


Java Opcodes.GOTO属性代码示例

本文整理汇总了Java中org.objectweb.asm.Opcodes.GOTO属性的典型用法代码示例。如果您正苦于以下问题:Java Opcodes.GOTO属性的具体用法?Java Opcodes.GOTO怎么用?Java Opcodes.GOTO使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.objectweb.asm.Opcodes的用法示例。


在下文中一共展示了Opcodes.GOTO属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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

示例2: visitJumpInsn

@Override
public void visitJumpInsn(final int opcode, final Label label) {
    if (mv != null) {
        mv.visitJumpInsn(opcode, label);
    }
    execute(opcode, 0, null);
    if (opcode == Opcodes.GOTO) {
        this.locals = null;
        this.stack = null;
    }
}
 
开发者ID:ItzSomebody,项目名称:DirectLeaks-AntiReleak-Remover,代码行数:11,代码来源:AnalyzerAdapter.java

示例3: getJumpTargets

private int[] getJumpTargets(JumpInsnNode jump) {
  switch (jump.getOpcode()) {
    case Opcodes.IFEQ:
    case Opcodes.IFNE:
    case Opcodes.IFLT:
    case Opcodes.IFGE:
    case Opcodes.IFGT:
    case Opcodes.IFLE:
    case Opcodes.IF_ICMPEQ:
    case Opcodes.IF_ICMPNE:
    case Opcodes.IF_ICMPLT:
    case Opcodes.IF_ICMPGE:
    case Opcodes.IF_ICMPGT:
    case Opcodes.IF_ICMPLE:
    case Opcodes.IF_ACMPEQ:
    case Opcodes.IF_ACMPNE:
    case Opcodes.IFNULL:
    case Opcodes.IFNONNULL:
      return new int[]{getOffset(jump.label), getOffset(jump.getNext())};
    case Opcodes.GOTO:
      return new int[]{getOffset(jump.label)};
    case Opcodes.JSR: {
      throw new Unreachable("JSR should be handled by the ASM jsr inliner");
    }
    default:
      throw new Unreachable("Unexpected opcode in jump instruction: " + jump);
  }
}
 
开发者ID:inferjay,项目名称:r8,代码行数:28,代码来源:JarSourceCode.java

示例4: CanvasHook

public CanvasHook() {
	super(new Regex(
			new Instruction(Opcodes.GOTO, false),
			new Instruction(Opcodes.GETSTATIC, true),
			new Instruction(Opcodes.CHECKCAST, false),
			new Instruction(Opcodes.ALOAD, false),
			new Instruction(Opcodes.GETFIELD, false),
			new Instruction(Opcodes.LDC, false),
			new Instruction(Opcodes.INVOKEVIRTUAL, true),
			new Instruction(Opcodes.GOTO, false)
		));
}
 
开发者ID:jonathanedgecombe,项目名称:mithril,代码行数:12,代码来源:CanvasHook.java

示例5: visitJumpInsn

/**
 * Imports branch instructions, both conditional and unconditional.
 *
 * @param opcode Opcode.
 * @param label  Destination of branch.
 */
@Override
public void visitJumpInsn(final int opcode, final Label label) {
  BasicBlock section = getBasicBlock(label);
    
  switch(opcode) {
    // Unconditional Branch
    case Opcodes.GOTO: finishBlock(section); setCurrent(null); break;
    
    // Zero Test
    case Opcodes.IFEQ: createZeroCondition(Condition.Operator.EQ, section); break;
    case Opcodes.IFNE: createZeroCondition(Condition.Operator.NE, section); break;
    case Opcodes.IFLT: createZeroCondition(Condition.Operator.LT, section); break;
    case Opcodes.IFGE: createZeroCondition(Condition.Operator.GE, section); break;
    case Opcodes.IFGT: createZeroCondition(Condition.Operator.GT, section); break;
    case Opcodes.IFLE: createZeroCondition(Condition.Operator.LE, section); break;
    
    // Integer Comparison
    case Opcodes.IF_ICMPEQ: createCondition(Condition.Operator.EQ, section); break;
    case Opcodes.IF_ICMPNE: createCondition(Condition.Operator.NE, section); break;
    case Opcodes.IF_ICMPLT: createCondition(Condition.Operator.LT, section); break;
    case Opcodes.IF_ICMPGE: createCondition(Condition.Operator.GE, section); break;
    case Opcodes.IF_ICMPGT: createCondition(Condition.Operator.GT, section); break;
    case Opcodes.IF_ICMPLE: createCondition(Condition.Operator.LE, section); break;

    // Reference Comparisons
    case Opcodes.IF_ACMPEQ: createCondition(Condition.Operator.EQ, section); break;
    case Opcodes.IF_ACMPNE: createCondition(Condition.Operator.NE, section); break;
    case Opcodes.IFNULL:    createNullCondition(Condition.Operator.EQ, section); break;
    case Opcodes.IFNONNULL: createNullCondition(Condition.Operator.NE, section); break;
    
    // TODO: JSR (paired with RET)
    case Opcodes.JSR: System.err.println("visitJumpInsn: JSR");
  }
}
 
开发者ID:adnanmitf09,项目名称:Rubus,代码行数:40,代码来源:MethodImporter.java

示例6: onMethodEnter

protected void onMethodEnter() {
	Label target = super.newLabel();
	// invoke the logger, note that we may not know about the Log class yet so we must catch and ignore the
	// exception here.
	super.visitLdcInsn(className);
	Label start = super.mark();
	super.visitMethodInsn(Opcodes.INVOKESTATIC, LOG_INTERNAL, LOG_METHOD_NAME, LOG_METHOD_SIGNATURE);
	Label end = super.mark();
	super.visitJumpInsn(Opcodes.GOTO,target);
	// catch the exception, discard the exception
	super.catchException(start,end,JAVA_LANG_THROWABLE_TYPE);
	super.pop();
	super.mark(target);
	// remainder of the <clinit>
}
 
开发者ID:RuiChen08,项目名称:dacapobench,代码行数:15,代码来源:ClinitInstrument.java

示例7: 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();
    }
}
 
开发者ID:ItzSomebody,项目名称:DirectLeaks-AntiReleak-Remover,代码行数:61,代码来源:InstructionAdapter.java


注:本文中的org.objectweb.asm.Opcodes.GOTO属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。