Package org.apache.bcel.generic

Examples of org.apache.bcel.generic.IFEQ


  final InstructionList il = methodGen.getInstructionList();
  translate(classGen, methodGen);

  if ((type instanceof BooleanType) || (type instanceof IntType)) {
      _falseList.add(il.append(new IFEQ(null)));
  }
    }
View Full Code Here


      if (test instanceof FunctionCall) {
    FunctionCall call = (FunctionCall)test;
    try {
        Type type = call.typeCheck(getParser().getSymbolTable());
        if (type != Type.Boolean) {
      test._falseList.add(il.append(new IFEQ(null)));
        }
    }
    catch (TypeCheckError e) {
        // handled later!
    }
View Full Code Here

            insList.insert(new TABLESWITCH(match, tableTargets, firstIns));
            insList.insert(insFactory.createInvoke(STACK_CLASS, getPopMethod(Type.INT), Type.INT, Type.NO_ARGS, Constants.INVOKEVIRTUAL));
            insList.insert(InstructionFactory.createLoad(STACK_TYPE, method.getMaxLocals()+1));

            // test if the continuation should be restored
            insList.insert(new IFEQ(firstIns));
            insList.insert(insFactory.createInvoke(CONTINUATION_CLASS, RESTORING_METHOD, Type.BOOLEAN, Type.NO_ARGS, Constants.INVOKEVIRTUAL));
            insList.insert(InstructionFactory.createLoad(CONTINUATION_TYPE, method.getMaxLocals()));
        }

        // get stack from current continuation and store in the last local variable
View Full Code Here

                insList.append(new SWAP());
                insList.append(insFactory.createInvoke(STACK_CLASS, getPushMethod(Type.OBJECT), Type.VOID, new Type[]{Type.OBJECT}, Constants.INVOKEVIRTUAL));
            }
        }
        // add isCapturing test
        insList.insert(new IFEQ(handle.getNext()));
        // test if the continuation should be captured after the invocation
        insList.insert(insFactory.createInvoke(CONTINUATION_CLASS, CAPURING_METHOD, Type.BOOLEAN, Type.NO_ARGS, Constants.INVOKEVIRTUAL));
        insList.insert(InstructionFactory.createLoad(CONTINUATION_TYPE, method.getMaxLocals()));
        // test if continuation exists
        insList.insert(new IFNULL(handle.getNext()));
View Full Code Here

            insList.insert(new TABLESWITCH(match, tableTargets, firstIns));
            insList.insert(insFactory.createInvoke(STACK_CLASS, getPopMethod(Type.INT), Type.INT, Type.NO_ARGS, Constants.INVOKEVIRTUAL));
            insList.insert(InstructionFactory.createLoad(STACK_TYPE, method.getMaxLocals()+1));

            // test if the continuation should be restored
            insList.insert(new IFEQ(firstIns));
            insList.insert(insFactory.createInvoke(CONTINUATION_CLASS, RESTORING_METHOD, Type.BOOLEAN, Type.NO_ARGS, Constants.INVOKEVIRTUAL));
            insList.insert(InstructionFactory.createLoad(CONTINUATION_TYPE, method.getMaxLocals()));
        }

        // get stack from current continuation and store in the last local variable
View Full Code Here

                insList.append(new SWAP());
                insList.append(insFactory.createInvoke(STACK_CLASS, getPushMethod(Type.OBJECT), Type.VOID, new Type[]{Type.OBJECT}, Constants.INVOKEVIRTUAL));
            }
        }
        // add isCapturing test
        insList.insert(new IFEQ(handle.getNext()));
        // test if the continuation should be captured after the invocation
        insList.insert(insFactory.createInvoke(CONTINUATION_CLASS, CAPURING_METHOD, Type.BOOLEAN, Type.NO_ARGS, Constants.INVOKEVIRTUAL));
        insList.insert(InstructionFactory.createLoad(CONTINUATION_TYPE, method.getMaxLocals()));
        // test if continuation exists
        insList.insert(new IFNULL(handle.getNext()));
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

  public void addBranch( int pc, int branchType, int targetpc ) {
    switch ( branchType ) {
    default:
    case BRANCH_GOTO: branches[pc= new GOTO(null); break;
    case BRANCH_IFNE:  branches[pc] = new IFNE(null); break;
    case BRANCH_IFEQ:  branches[pc] = new IFEQ(null); break;
    }
    targets[pc] = targetpc;
    append(branches[pc]);
  }
View Full Code Here

TOP

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

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.