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

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


        final ConstantPoolGen cpg = classGen.getConstantPool();
        final InstructionList il = methodGen.getInstructionList();
        il.append(new NEW(cpg.addClass(INTEGER_CLASS)));
        il.append(DUP_X1);
        il.append(SWAP);
        il.append(new INVOKESPECIAL(cpg.addMethodref(INTEGER_CLASS,
                                                     "<init>", "(I)V")));
    }
View Full Code Here


        compileFilter(classGen, methodGen);

        // Create new instance of filter
        il.append(new NEW(cpg.addClass(_className)));
        il.append(DUP);
        il.append(new INVOKESPECIAL(cpg.addMethodref(_className,
                                                     "<init>", "()V")));

        // Initialize closure variables
        final int length = (_closureVars == null) ? 0 : _closureVars.size();
View Full Code Here

        il.append(DUP);
        filterTemp.setEnd(il.append(new ALOAD(filterTemp.getIndex())));
        pathTemp.setEnd(il.append(new ALOAD(pathTemp.getIndex())));

        // Initialize StepIterator with iterators from the stack
        il.append(new INVOKESPECIAL(initSI));

        // This is a special case for the //* path with or without predicates
        if (_hasDescendantAxis) {
            final int incl = cpg.addMethodref(NODE_ITERATOR_BASE,
                                              "includeSelf",
View Full Code Here

        final ConstantPoolGen cpg = classGen.getConstantPool();
        final InstructionList il = methodGen.getInstructionList();
        il.append(new NEW(cpg.addClass(BOOLEAN_CLASS)));
        il.append(DUP_X1);
        il.append(SWAP);
        il.append(new INVOKESPECIAL(cpg.addMethodref(BOOLEAN_CLASS,
                                                     "<init>",
                                                     "(Z)V")));
    }
View Full Code Here

            // Create a new instance of a StringValueHandler
            int index = cpg.addMethodref(STRING_VALUE_HANDLER, "<init>", "()V");
            il.append(new NEW(cpg.addClass(STRING_VALUE_HANDLER)));
            il.append(DUP);
            il.append(DUP);
            il.append(new INVOKESPECIAL(index));

            // Store new Handler into a local variable
            final LocalVariableGen handler =
                methodGen.addLocalVariable("rt_to_string_handler",
                                           Util.getJCRefType(STRING_VALUE_HANDLER_SIG),
View Full Code Here

                "<init>",
                "("+NODE_SIG+")V");
      il.append(new NEW(cpg.addClass(SINGLETON_ITERATOR)));
      il.append(DUP);
      il.append(methodGen.loadContextNode());
      il.append(new INVOKESPECIAL(init));
        } else {
      // DOM.getAxisIterator(int axis);
      int git = cpg.addInterfaceMethodref(DOM_INTF,
            "getAxisIterator",
            "(I)"+NODE_ITERATOR_SIG);
View Full Code Here

    il.append(new NEW(cpg.addClass(NTH_ITERATOR_CLASS)));
    il.append(DUP);
                il.append(new ALOAD(iteratorTemp.getIndex()));
                il.append(new ILOAD(predicateValueTemp.getIndex()));
    il.append(new INVOKESPECIAL(idx));
      }
      else {
    idx = cpg.addMethodref(CURRENT_NODE_LIST_ITERATOR,
               "<init>",
               "("
               + NODE_ITERATOR_SIG
               + CURRENT_NODE_LIST_FILTER_SIG
               + NODE_SIG
               + TRANSLET_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.
    translatePredicates(classGen, methodGen); // recursive call
                LocalVariableGen iteratorTemp
                        = methodGen.addLocalVariable("step_tmp1",
                                         Util.getJCRefType(NODE_ITERATOR_SIG),
                                         il.getEnd(), null);
                il.append(new ASTORE(iteratorTemp.getIndex()));

    predicate.translateFilter(classGen, methodGen);
                LocalVariableGen filterTemp
                        = methodGen.addLocalVariable("step_tmp2",
                              Util.getJCRefType(CURRENT_NODE_LIST_FILTER_SIG),
                              il.getEnd(), null);
                il.append(new ASTORE(filterTemp.getIndex()));

    // create new CurrentNodeListIterator
    il.append(new NEW(cpg.addClass(CURRENT_NODE_LIST_ITERATOR)));
    il.append(DUP);

                il.append(new ALOAD(iteratorTemp.getIndex()));
                il.append(new ALOAD(filterTemp.getIndex()));
   
    il.append(methodGen.loadCurrentNode());
    il.append(classGen.loadTranslet());
    if (classGen.isExternal()) {
        final String className = classGen.getClassName();
        il.append(new CHECKCAST(cpg.addClass(className)));
    }
    il.append(new INVOKESPECIAL(idx));
      }
  }
    }
View Full Code Here

            il.append(methodGen.loadIterator());
            il.append(methodGen.loadHandler());
            il.append(methodGen.loadCurrentNode());
            final int method = cpg.addMethodref(classGen.getClassName(),
                                                methodName, ATTR_SET_SIG);
            il.append(new INVOKESPECIAL(method));
        }

  // Translate other used attribute sets first, as local attributes
  // take precedence (last attributes overrides first)
  if (_useSets != null) _useSets.translate(classGen, methodGen);
View Full Code Here

    il.append(DUP);
    il.append(DUP);
    il.append(new ICONST(0));
    il.append(new NEWARRAY(BasicType.INT));
    il.append(SWAP);
    il.append(new INVOKESPECIAL(index));
      }
      else {
    // Push name arrays on the stack
    il.append(ALOAD_0);
    il.append(new GETFIELD(cpg.addFieldref(TRANSLET_CLASS,
             NAMES_INDEX,
             NAMES_INDEX_SIG)));
    il.append(ALOAD_0);
    il.append(new GETFIELD(cpg.addFieldref(TRANSLET_CLASS,
             URIS_INDEX,
             URIS_INDEX_SIG)));
    il.append(ALOAD_0);
    il.append(new GETFIELD(cpg.addFieldref(TRANSLET_CLASS,
             TYPES_INDEX,
             TYPES_INDEX_SIG)));
    il.append(ALOAD_0);
    il.append(new GETFIELD(cpg.addFieldref(TRANSLET_CLASS,
             NAMESPACE_INDEX,
             NAMESPACE_INDEX_SIG)));

    // Initialized DOM adapter
    il.append(new INVOKESPECIAL(index));

    // Add DOM adapter to MultiDOM class by calling addDOMAdapter()
    il.append(DUP);
    il.append(methodGen.loadDOM());
    il.append(new CHECKCAST(cpg.addClass(classGen.getDOMClass())));
View Full Code Here

      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 {
      final int git = cpg.addInterfaceMethodref(DOM_INTF,
                  "getIterator",
                  "()"+NODE_ITERATOR_SIG);
View Full Code Here

TOP

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

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.