Package com.sun.org.apache.bcel.internal.generic

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


  il.append(DUP);
  il.append(new ASTORE(name.getIndex()));
  final BranchHandle ifBlock1 = il.append(new IFNULL(null));

  // Get the length of the node name and save for later
  il.append(new ALOAD(name.getIndex()));
  final int lengthMethod = cpg.addMethodref(STRING_CLASS,"length","()I");
  il.append(new INVOKEVIRTUAL(lengthMethod));
  il.append(new ISTORE(length.getIndex()));

  // Copy in attribute sets if specified
  if (_useSets != null) {
      // If the parent of this element will result in an element being
      // output then we know that it is safe to copy out the attributes
      final SyntaxTreeNode parent = getParent();
      if ((parent instanceof LiteralElement) ||
    (parent instanceof LiteralElement)) {
    _useSets.translate(classGen, methodGen);
      }
      // If not we have to check to see if the copy will result in an
      // element being output.
      else {
    // check if element; if not skip to translate body
    il.append(new ILOAD(length.getIndex()));
    final BranchHandle ifBlock2 = il.append(new IFEQ(null));
    // length != 0 -> element -> do attribute sets
    _useSets.translate(classGen, methodGen);
    // not an element; root
    ifBlock2.setTarget(il.append(NOP));
      }
  }

  // Instantiate body of xsl:copy
  translateContents(classGen, methodGen);

  // Call the output handler's endElement() if we copied an element
  // (The DOM.shallowCopy() method calls startElement().)
  il.append(new ILOAD(length.getIndex()));
  final BranchHandle ifBlock3 = il.append(new IFEQ(null));
  il.append(methodGen.loadHandler());
  il.append(new ALOAD(name.getIndex()));
  il.append(methodGen.endElement());
 
  final InstructionHandle end = il.append(NOP);
  ifBlock1.setTarget(end);
  ifBlock3.setTarget(end);
View Full Code Here


            il.append(new ASTORE(pathTemp.getIndex()));

      // Create new Dup Filter Iterator
      il.append(new NEW(cpg.addClass(DUP_FILTERED_ITERATOR)));
      il.append(DUP);
            il.append(new ALOAD(pathTemp.getIndex()));

      // Initialize Dup Filter Iterator with iterator from the stack
      il.append(new INVOKESPECIAL(initDFI));
  }
  else {
View Full Code Here

        il.append(new ASTORE(stepIteratorTemp.getIndex()));

  il.append(new NEW(cpg.addClass(MATCHING_ITERATOR)));
  il.append(DUP);
  il.append(new ILOAD(match.getIndex()));
        il.append(new ALOAD(stepIteratorTemp.getIndex()));
  il.append(new INVOKESPECIAL(index));

  // Get the parent of the matching node
  il.append(methodGen.loadDOM());
  il.append(new ILOAD(match.getIndex()));
View Full Code Here

  _step.translate(classGen, methodGen);
  il.append(new ASTORE(iter.getIndex()));

  // If in the main class update the field too
  if (!classGen.isExternal()) {
      il.append(new ALOAD(iter.getIndex()));
      il.append(new PUTFIELD(iteratorIndex));
      ifBlock.setTarget(il.append(NOP));
  }

  // Get the parent of the node on the stack
  il.append(methodGen.loadDOM());
  il.append(new ILOAD(node.getIndex()));
  int index = cpg.addInterfaceMethodref(DOM_INTF,
                GET_PARENT, GET_PARENT_SIG);
  il.append(new INVOKEINTERFACE(index, 2));

  // Initialize the iterator with the parent
  il.append(new ALOAD(iter.getIndex()));
  il.append(SWAP);
  il.append(methodGen.setStartNode());

  /*
   * Inline loop:
   *
   * int node2;
   * while ((node2 = iter.next()) != NodeIterator.END
   *      && node2 < node);
   * return node2 == node;
   */
  BranchHandle skipNext;
  InstructionHandle begin, next;
  node2 = methodGen.addLocalVariable("step_pattern_tmp3",
             Util.getJCRefType(NODE_SIG),
             il.getEnd(), null);

  skipNext = il.append(new GOTO(null));
  next = il.append(new ALOAD(iter.getIndex()));
  begin = il.append(methodGen.nextNode());
  il.append(DUP);
  il.append(new ISTORE(node2.getIndex()));
  _falseList.add(il.append(new IFLT(null)))// NodeIterator.END

View Full Code Here

  return(STRING_CLASS);
    }


    public Instruction LOAD(int slot) {
  return new ALOAD(slot);
    }
View Full Code Here

           InstructionList il, ConstantPoolGen cp) {
  super(access_flags, return_type, arg_types, arg_names, method_name,
        class_name, il, cp);
 
  _astoreHandler = new ASTORE(HANDLER_INDEX);
  _aloadHandler  = new ALOAD(HANDLER_INDEX);
    }
View Full Code Here

  }
  return super.getLocalIndex(name);
    }

    public Instruction loadParameter(int index) {
        return new ALOAD(index + PARAM_START_INDEX);
    }
View Full Code Here

  }
  return super.getLocalIndex(name);
    }

    public Instruction loadParameter(int index) {
        return new ALOAD(index + PARAM_START_INDEX);
    }
View Full Code Here

    /**
     * Set the index of the register where "this" (the pointer to
     * the translet) is stored.
     */
    public void setTransletIndex(int index) {
  _aloadTranslet = new ALOAD(index);
    }
View Full Code Here

                    il.getEnd());
                   
            // store the name into a variable first so _name.translate only needs to be called once 
            _name.translate(classGen, methodGen);
            il.append(new ASTORE(nameValue.getIndex()));
            il.append(new ALOAD(nameValue.getIndex()));
           
            // call checkQName if the name is an AVT
            final int check = cpg.addMethodref(BASIS_LIBRARY_CLASS, "checkQName",
                            "("
                            +STRING_SIG
                            +")V");                
            il.append(new INVOKESTATIC(check));
           
            // Push handler for call to endElement()
            il.append(methodGen.loadHandler());        
           
            // load name value again   
            il.append(new ALOAD(nameValue.getIndex()))
                   
      if (_namespace != null) {
    _namespace.translate(classGen, methodGen);
      }
      else {
View Full Code Here

TOP

Related Classes of com.sun.org.apache.bcel.internal.generic.ALOAD

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.