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

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


                          String method_name, String class_name,
                          InstructionList il, ConstantPoolGen cp) {
        super(access_flags, return_type, arg_types, arg_names, method_name,
              class_name, il, cp);

        _iloadCurrent = new ILOAD(CURRENT_INDEX);
        _istoreCurrent = new ISTORE(CURRENT_INDEX);
    }
View Full Code Here


                                                     BOOLEAN_VALUE,
                                                     BOOLEAN_VALUE_SIG)));
    }

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

    public Instruction NEG() {
        return InstructionConstants.INEG;
    }

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

                            String method_name, String class_name,
                            InstructionList il, ConstantPoolGen cp) {
        super(access_flags, return_type, arg_types, arg_names, method_name,
              class_name, il, cp);

        _iloadCurrent = new ILOAD(CURRENT_INDEX);
        _istoreCurrent = new ISTORE(CURRENT_INDEX);
        _aloadDom = new ALOAD(DOM_INDEX);
        _iloadLast = new ILOAD(LAST_INDEX);

        LocalVariableGen iterator =
            addLocalVariable("iterator",
                             Util.getJCRefType(Constants.NODE_ITERATOR_SIG),
                             null, null);
View Full Code Here

    public String getClassName() {
        return(RUNTIME_NODE_CLASS);
    }

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

                                           null, null);
        match.setStart(il.append(new ISTORE(match.getIndex())));

        // If pattern not reduced then check kernel
        if (!_isEpsilon) {
            il.append(new ILOAD(match.getIndex()));
            translateKernel(classGen, methodGen);
        }

        // Push current iterator and current node on the stack
        il.append(methodGen.loadCurrentNode());
        il.append(methodGen.loadIterator());

        // Create a new matching iterator using the matching node
        index = cpg.addMethodref(MATCHING_ITERATOR, "<init>",
                                 "(I" + NODE_ITERATOR_SIG + ")V");

        // Backwards branches are prohibited if an uninitialized object is
        // on the stack by section 4.9.4 of the JVM Specification, 2nd Ed.
        // We don't know whether this code might contain backwards branches,
        // so we mustn't create the new object until after we've created
        // the suspect arguments to its constructor.  Instead we calculate
        // the values of the arguments to the constructor first, store them
        // in temporary variables, create the object and reload the
        // arguments from the temporaries to avoid the problem.

        _step.translate(classGen, methodGen);
        LocalVariableGen stepIteratorTemp =
                methodGen.addLocalVariable("step_pattern_tmp2",
                                           Util.getJCRefType(NODE_ITERATOR_SIG),
                                           null, null);
        stepIteratorTemp.setStart(
                il.append(new ASTORE(stepIteratorTemp.getIndex())));

        il.append(new NEW(cpg.addClass(MATCHING_ITERATOR)));
        il.append(DUP);
        il.append(new ILOAD(match.getIndex()));
        stepIteratorTemp.setEnd(
                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()));
        index = cpg.addInterfaceMethodref(DOM_INTF, GET_PARENT, GET_PARENT_SIG);
        il.append(new INVOKEINTERFACE(index, 2));

        // Start the iterator with the parent
        il.append(methodGen.setStartNode());

        // Overwrite current iterator and current node
        il.append(methodGen.storeIterator());
        match.setEnd(il.append(new ILOAD(match.getIndex())));
        il.append(methodGen.storeCurrentNode());

        // Translate the expression of the predicate
        Predicate pred = (Predicate) _predicates.elementAt(0);
        Expression exp = pred.getExpr();
View Full Code Here

            iter.setStart(iterStore);
        }

        // 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),
                                           null, null);

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

        il.append(new ILOAD(node2.getIndex()));
        il.append(new ILOAD(node.getIndex()));
        iter.setEnd(il.append(new IF_ICMPLT(next)));

        node2.setEnd(il.append(new ILOAD(node2.getIndex())));
        node.setEnd(il.append(new ILOAD(node.getIndex())));
        _falseList.add(il.append(new IF_ICMPNE(null)));

        skipNext.setTarget(begin);
    }
View Full Code Here

    case VOID:   return ;
    case BOOLEAN:
    case CHAR:
    case BYTE:
    case SHORT:
    case INT:    ilc.add(new ILOAD(index)); return ;
    case FLOAT:  ilc.add(new FLOAD(index)); return ;
    case DOUBLE: ilc.add(new DLOAD(index)); return ;
    case LONG:   ilc.add(new LLOAD(index)); return ;
    case ARRAY:
    case OBJECT: ilc.add(new ALOAD(index)); return ;
View Full Code Here

                                                il.getEnd());
                il.append(DUP);
                il.append(new ISTORE(local.getIndex()));
                _left.translate(classGen, methodGen);
                il.append(methodGen.loadDOM());
                local.setEnd(il.append(new ILOAD(local.getIndex())));
                methodGen.removeLocalVariable(local);
            }
            else {
                _left.translate(classGen, methodGen);
            }
View Full Code Here

      }
      // 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
        ifBlock4.setTarget(il.append(NOP));
  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());
 
View Full Code Here

TOP

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

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.