Package org.apache.bcel.generic

Examples of org.apache.bcel.generic.InstructionHandle


                        BranchWrapper merge = new BranchWrapper
                            (m_instructionList.insert(inst, new GOTO(null)),
                            types, this);
                        String[] stack = m_targetBranches[0].getStackState();
                        m_stackState = new StringStack(stack);
                        InstructionHandle poph = m_instructionList.
                            insert(inst, InstructionConstants.POP);
                        for (int i = 0; i < m_targetBranches.length; i++) {
                            m_targetBranches[i].setTarget(poph, stack, this);
                        }
                        m_stackState.pop();
View Full Code Here


     * @param inst compound instruction to be appended as branch target
     * @return branch target information
     */
    private BranchTarget appendTargetInstruction(CompoundInstruction inst) {
        String[] types = m_stackState.toArray();
        InstructionHandle hand = m_instructionList.append(inst);
        return new BranchTarget(hand, types);
    }
View Full Code Here

     * @param inst instruction to be appended as branch target
     * @return branch target information
     */
    private BranchTarget appendTargetInstruction(Instruction inst) {
        String[] types = m_stackState.toArray();
        InstructionHandle hand = m_instructionList.append(inst);
        return new BranchTarget(hand, types);
    }
View Full Code Here

     * subclasses when they need access to the actual instruction handle.
     *
     * @param name fully qualified class name
     */
    protected InstructionHandle internalAppendCreateNew(String name) {
        InstructionHandle handle = m_instructionList.append
            (m_instructionBuilder.createNew(name));
        m_stackState.push(name);
        return handle;
    }
View Full Code Here

        if (index >= 0) {
            m_generator.addException(FRAMEWORK_EXCEPTION_CLASS);
            m_exceptions.remove(index);
        }
        if (m_exceptions.size() > 0) {
            InstructionHandle begin = getFirstInstruction();
            InstructionHandle end = getLastInstruction();
            InstructionHandle handle = genExceptionHandler();
            for (int i = 0; i < m_exceptions.size(); i++) {
                m_generator.addExceptionHandler(begin, end, handle,
                    (ObjectType)ClassItem.
                    typeFromName((String)m_exceptions.get(i)));
            }
View Full Code Here

       
        // instruction sequence is create new exception object, duplicate two
        //  down (below caught exception), swap (so order is new, new, caught),
        //  load message, swap again, invoke constructor, and throw exception
        initStackState(new String[] {"java.lang.Exception"});
        InstructionHandle start =
            internalAppendCreateNew(FRAMEWORK_EXCEPTION_CLASS);
        appendDUP_X1();
        appendSWAP();
        appendLoadConstant(MARSHAL_EXCEPTION_TEXT);
        appendSWAP();
View Full Code Here

       
        // first part of instruction sequence is create new exception object,
        //  duplicate two down (below caught exception), swap (so order is new,
        //  new, caught)
        initStackState(new String[] {"java.lang.Exception"});
        InstructionHandle start =
            internalAppendCreateNew(FRAMEWORK_EXCEPTION_CLASS);
        appendDUP_X1();
        appendSWAP();
       
        // second part of sequence is build StringBuffer, duplicate, load lead
View Full Code Here

      // this is not a correct methodname.
      return null;
    }
    logger.info("the level of enabling is: " + level);
    logger.info("Inserting GETSTATIC");
    InstructionHandle insertHandle =
      il.insert(getStaticHandle, getStaticHandle.getInstruction().copy());
    il.insert(
      getStaticHandle,
      instFact.createGetStatic(LEVEL, level, LevelType));
View Full Code Here

    MethodGen orig,
    InstructionList il,
    InstructionHandle firstInstructionHandle,
    ConstantPoolGen cp) {
      logger.info("Inserting Enter code.");
      InstructionHandle backup = il.insert(
        firstInstructionHandle,
        instFact.createGetStatic(
          clazz.getClassName(),
          loggerAttribute.getName(),
          loggerAttribute.getType()));
View Full Code Here

    MethodGen orig,
    InstructionList il,
    InstructionHandle returnInstructionHandle,
    ConstantPoolGen cp) {
      logger.info("Inserting Exit code.");
      InstructionHandle backup = il.insert(
      returnInstructionHandle,
        instFact.createGetStatic(
          clazz.getClassName(),
          loggerAttribute.getName(),
          loggerAttribute.getType()));
View Full Code Here

TOP

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

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.