Examples of InstructionHandle


Examples of com.sun.org.apache.bcel.internal.generic.InstructionHandle

    }

    public static void compileStripSpace(BranchHandle strip[],
           int sCount,
           InstructionList il) {
  final InstructionHandle target = il.append(ICONST_1);
  il.append(IRETURN);
  for (int i = 0; i < sCount; i++) {
      strip[i].setTarget(target);
  }
    }
View Full Code Here

Examples of com.sun.org.apache.bcel.internal.generic.InstructionHandle

    }

    public static void compilePreserveSpace(BranchHandle preserve[],
              int pCount,
              InstructionList il) {
  final InstructionHandle target = il.append(ICONST_0);
  il.append(IRETURN);
  for (int i = 0; i < pCount; i++) {
      preserve[i].setTarget(target);
  }
    }
View Full Code Here

Examples of com.sun.org.apache.bcel.internal.generic.InstructionHandle

         "extractValueFromDOM", className, il, cpg);

  // Values needed for the switch statement
  final int levels = sortObjects.size();
  final int match[] = new int[levels];
  final InstructionHandle target[] = new InstructionHandle[levels];
  InstructionHandle tblswitch = null;

  // Compile switch statement only if the key has multiple levels
  if (levels > 1) {
      // Put the parameter to the swtich statement on the stack
      il.append(new ILOAD(extractMethod.getLocalIndex("level")));
      // Append the switch statement here later on
      tblswitch = il.append(new NOP());
  }

  // Append all the cases for the switch statment
  for (int level = 0; level < levels; level++) {
      match[level] = level;
      final Sort sort = (Sort)sortObjects.elementAt(level);
      target[level] = il.append(NOP);
      sort.translateSelect(sortRecord, extractMethod);
      il.append(ARETURN);
  }
 
  // Compile def. target for switch statement if key has multiple levels
  if (levels > 1) {
      // Append the default target - it will _NEVER_ be reached
      InstructionHandle defaultTarget =
    il.append(new PUSH(cpg, EMPTYSTRING));
      il.insert(tblswitch,new TABLESWITCH(match, target, defaultTarget));
      il.append(ARETURN);
  }
View Full Code Here

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

Examples of org.apache.bcel.generic.InstructionHandle

     * @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

Examples of org.apache.bcel.generic.InstructionHandle

     * @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

Examples of org.apache.bcel.generic.InstructionHandle

     * 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

Examples of org.apache.bcel.generic.InstructionHandle

        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

Examples of org.apache.bcel.generic.InstructionHandle

       
        // 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

Examples of org.apache.bcel.generic.InstructionHandle

       
        // 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
TOP
Copyright © 2018 www.massapi.com. 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.