Package org.apache.bcel.generic

Examples of org.apache.bcel.generic.BranchInstruction


            if (i > 0) {
                targetInstructions.add(ih);
            }

            il.append(new INSTANCEOF(cp.addClass(hierarchyTop)));
            BranchInstruction bi = InstructionFactory.createBranchInstruction(Constants.IFEQ,
                                                                              null);
            il.append(bi);
            branchInstructions.add(bi);

            il.append(InstructionFactory.createLoad(peType,
View Full Code Here


        il.append(InstructionConstants.ACONST_NULL);
        il.append(InstructionFactory.createStore(Type.OBJECT, 2));
        il.append(InstructionFactory.createLoad(Type.OBJECT, 1));
        il.append(new INSTANCEOF(cp.addClass(new ObjectType(className))));
        BranchInstruction ifeq_6 = InstructionFactory.createBranchInstruction(Constants.IFEQ,
                                                                              null);
        il.append(ifeq_6);
        il.append(InstructionFactory.createLoad(Type.OBJECT, 1));
        il.append(instFactory.createCheckCast(new ObjectType(className)));
        il.append(InstructionFactory.createStore(Type.OBJECT, 2));
        InstructionHandle ih_14 = il.append(InstructionFactory.createLoad(Type.OBJECT,
                                                                          2));
        il.append(new INSTANCEOF(cp.addClass(new ObjectType("java.lang.Cloneable"))));
        BranchInstruction ifne_18 = InstructionFactory.createBranchInstruction(Constants.IFNE,
                                                                               null);
        il.append(ifne_18);
        il.append(instFactory.createFieldAccess("java.lang.System",
                                                "out",
                                                new ObjectType("java.io.PrintStream"),
                                                Constants.GETSTATIC));
        il.append(new PUSH(cp, "Not cloneable!"));
        il.append(instFactory.createInvoke("java.io.PrintStream",
                                           "println",
                                           Type.VOID,
                                           new Type[] { Type.STRING },
                                           Constants.INVOKEVIRTUAL));
        il.append(InstructionConstants.ACONST_NULL);
        il.append(InstructionFactory.createReturn(Type.OBJECT));
        InstructionHandle ih_31 = il.append(InstructionFactory.createLoad(Type.OBJECT,
                                                                          2));
        il.append(instFactory.createInvoke(className,
                                           "clone",
                                           Type.OBJECT,
                                           Type.NO_ARGS,
                                           Constants.INVOKEVIRTUAL));
        il.append(InstructionFactory.createReturn(Type.OBJECT));
        ifeq_6.setTarget(ih_14);
        ifne_18.setTarget(ih_31);
        method.setMaxStack();
        method.setMaxLocals();
        cg.addMethod(method.getMethod());
        il.dispose();
View Full Code Here

  @SuppressWarnings("unused")
  // Called using reflection
  private Instruction createInstructionGoto(Element inst)
  {
    int id= Integer.parseInt(inst.getAttributeValue("label"));
    BranchInstruction bi= new GOTO(null);
    instructionHandlerManager.registerBranchInstruction(bi, id);
    return bi;
  }
View Full Code Here

  @SuppressWarnings("unused")
  // Called using reflection
  private Instruction createInstructionIf_acmpne(Element inst)
  {
    int id= Integer.parseInt(inst.getAttributeValue("label"));
    BranchInstruction bi= new IF_ACMPNE(null);
    instructionHandlerManager.registerBranchInstruction(bi, id);
    return bi;
  }
View Full Code Here

  @SuppressWarnings("unused")
  // Called using reflection
  private Instruction createInstructionIf_icmplt(Element inst)
  {
    int id= Integer.parseInt(inst.getAttributeValue("label"));
    BranchInstruction bi= new IF_ICMPLT(null);
    instructionHandlerManager.registerBranchInstruction(bi, id);
    return bi;
  }
View Full Code Here

  @SuppressWarnings("unused")
  // Called using reflection
  private Instruction createInstructionIf_icmpgt(Element inst)
  {
    int id= Integer.parseInt(inst.getAttributeValue("label"));
    BranchInstruction bi= new IF_ICMPGT(null);
    instructionHandlerManager.registerBranchInstruction(bi, id);
    return bi;
  }
View Full Code Here

  @SuppressWarnings("unused")
  // Called using reflection
  private Instruction createInstructionIf_icmpge(Element inst)
  {
    int id= Integer.parseInt(inst.getAttributeValue("label"));
    BranchInstruction bi= new IF_ICMPGE(null);
    instructionHandlerManager.registerBranchInstruction(bi, id);
    return bi;
  }
View Full Code Here

  @SuppressWarnings("unused")
  // Called using reflection
  private Instruction createInstructionIf_icmple(Element inst)
  {
    int id= Integer.parseInt(inst.getAttributeValue("label"));
    BranchInstruction bi= new IF_ICMPLE(null);
    instructionHandlerManager.registerBranchInstruction(bi, id);
    return bi;
  }
View Full Code Here

  @SuppressWarnings("unused")
  // Called using reflection
  private Instruction createInstructionIf_icmpne(Element inst)
  {
    int id= Integer.parseInt(inst.getAttributeValue("label"));
    BranchInstruction bi= new IF_ICMPNE(null);
    instructionHandlerManager.registerBranchInstruction(bi, id);
    return bi;
  }
View Full Code Here

  @SuppressWarnings("unused")
  // Called using reflection
  private Instruction createInstructionIfeq(Element inst)
  {
    int id= Integer.parseInt(inst.getAttributeValue("label"));
    BranchInstruction bi= new IFEQ(null);
    instructionHandlerManager.registerBranchInstruction(bi, id);
    return bi;
  }
View Full Code Here

TOP

Related Classes of org.apache.bcel.generic.BranchInstruction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.