Package org.apache.bcel.generic

Examples of org.apache.bcel.generic.BranchHandle


     *
     * @param src object responsible for generating branch
     * @return wrapper for appended unconditional branch
     */
    public BranchWrapper appendUnconditionalBranch(Object src) {
        BranchHandle hand = m_instructionList.append(new GOTO(null));
        setTarget(hand);
        BranchWrapper wrapper =
            new BranchWrapper(hand, m_stackState.toArray(), src);
        m_stackState = null;
        return wrapper;
View Full Code Here


     * @param src object responsible for generating branch
     * @return wrapper for appended conditional branch
     */
    public BranchWrapper appendIFEQ(Object src) {
        verifyStack("int");
        BranchHandle hand = m_instructionList.append(new IFEQ(null));
        setTarget(hand);
        m_stackState.pop();
        return new BranchWrapper(hand, m_stackState.toArray(), src);
    }
View Full Code Here

     * @param src object responsible for generating branch
     * @return wrapper for appended conditional branch
     */
    public BranchWrapper appendIFGE(Object src) {
        verifyStack("int");
        BranchHandle hand = m_instructionList.append(new IFGE(null));
        setTarget(hand);
        m_stackState.pop();
        return new BranchWrapper(hand, m_stackState.toArray(), src);
    }
View Full Code Here

     * @param src object responsible for generating branch
     * @return wrapper for appended conditional branch
     */
    public BranchWrapper appendIFLT(Object src) {
        verifyStack("int");
        BranchHandle hand = m_instructionList.append(new IFLT(null));
        setTarget(hand);
        m_stackState.pop();
        return new BranchWrapper(hand, m_stackState.toArray(), src);
    }
View Full Code Here

     * @param src object responsible for generating branch
     * @return wrapper for appended conditional branch
     */
    public BranchWrapper appendIFNE(Object src) {
        verifyStack("int");
        BranchHandle hand = m_instructionList.append(new IFNE(null));
        setTarget(hand);
        m_stackState.pop();
        return new BranchWrapper(hand, m_stackState.toArray(), src);
    }
View Full Code Here

     * @param src object responsible for generating branch
     * @return wrapper for appended conditional branch
     */
    public BranchWrapper appendIFNONNULL(Object src) {
        verifyStackObject();
        BranchHandle hand = m_instructionList.append(new IFNONNULL(null));
        setTarget(hand);
        m_stackState.pop();
        return new BranchWrapper(hand, m_stackState.toArray(), src);
    }
View Full Code Here

     * @param src object responsible for generating branch
     * @return wrapper for appended conditional branch
     */
    public BranchWrapper appendIFNULL(Object src) {
        verifyStackObject();
        BranchHandle hand = m_instructionList.append(new IFNULL(null));
        setTarget(hand);
        m_stackState.pop();
        return new BranchWrapper(hand, m_stackState.toArray(), src);
    }
View Full Code Here

     * @param src object responsible for generating branch
     * @return wrapper for appended conditional branch
     */
    public BranchWrapper appendIF_ICMPNE(Object src) {
        verifyStack("int", "int");
        BranchHandle hand = m_instructionList.append(new IF_ICMPNE(null));
        setTarget(hand);
        m_stackState.pop(2);
        return new BranchWrapper(hand, m_stackState.toArray(), src);
    }
View Full Code Here

    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
          BooleanType type) {
  final InstructionList il = methodGen.getInstructionList();
  FlowList falsel = translateToDesynthesized(classGen, methodGen, type);
  il.append(ICONST_1);
  final BranchHandle truec = il.append(new GOTO(null));
  falsel.backPatch(il.append(ICONST_0));
  truec.setTarget(il.append(NOP));
    }
View Full Code Here

    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
          StringType type) {
  final InstructionList il = methodGen.getInstructionList();
  getFirstNode(classGen, methodGen);
  il.append(DUP);
  final BranchHandle falsec = il.append(new IFEQ(null));
  Type.Node.translateTo(classGen, methodGen, type);
  final BranchHandle truec = il.append(new GOTO(null));
  falsec.setTarget(il.append(POP));
  il.append(new PUSH(classGen.getConstantPool(), ""));
  truec.setTarget(il.append(NOP));
    }
View Full Code Here

TOP

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

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.