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

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


      final int equals = cpg.addMethodref(STRING_CLASS,
            "equals",
            "(" + OBJECT_SIG +")Z");
      _left.translate(classGen, methodGen);
      _right.translate(classGen, methodGen);
      il.append(new INVOKEVIRTUAL(equals));

        if (_op == Operators.NE) {
    il.append(ICONST_1);
    il.append(IXOR);      // not x <-> x xor 1
      }
      return;
  }

  BranchHandle truec, falsec;
 
  if (tleft instanceof ResultTreeType) {
      if (tright instanceof BooleanType) {
    _right.translate(classGen, methodGen);
        if (_op == Operators.NE) {
        il.append(ICONST_1);
        il.append(IXOR); // not x <-> x xor 1
    }
    return;
      }

      if (tright instanceof RealType) {
    _left.translate(classGen, methodGen);
    tleft.translateTo(classGen, methodGen, Type.Real);
    _right.translate(classGen, methodGen);

    il.append(DCMPG);
        falsec = il.append(_op == Operators.EQ ?
           (BranchInstruction) new IFNE(null) :
           (BranchInstruction) new IFEQ(null));
    il.append(ICONST_1);
    truec = il.append(new GOTO(null));
    falsec.setTarget(il.append(ICONST_0));
    truec.setTarget(il.append(NOP));
    return;
      }

      // Next, result-tree/string and result-tree/result-tree comparisons

      _left.translate(classGen, methodGen);
      tleft.translateTo(classGen, methodGen, Type.String);
      _right.translate(classGen, methodGen);

      if (tright instanceof ResultTreeType) {
    tright.translateTo(classGen, methodGen, Type.String);
      }

      final int equals = cpg.addMethodref(STRING_CLASS,
            "equals",
            "(" +OBJECT_SIG+ ")Z");
      il.append(new INVOKEVIRTUAL(equals));

        if (_op == Operators.NE) {
    il.append(ICONST_1);
    il.append(IXOR);      // not x <-> x xor 1
      }
View Full Code Here


      il.append(classGen.loadTranslet());
      il.append(methodGen.loadDOM());
      il.append(methodGen.loadIterator());
      il.append(methodGen.loadHandler());
      il.append(methodGen.loadCurrentNode());
      il.append(new INVOKEVIRTUAL(cpg.addMethodref(className,
               methodName,
               "("
               + DOM_INTF_SIG
               + NODE_ITERATOR_SIG
               + TRANSLET_OUTPUT_SIG
View Full Code Here

    public void translateUnBox(ClassGenerator classGen,
             MethodGenerator methodGen) {
  final ConstantPoolGen cpg = classGen.getConstantPool();
  final InstructionList il = methodGen.getInstructionList();
  il.append(new CHECKCAST(cpg.addClass(DOUBLE_CLASS)));
  il.append(new INVOKEVIRTUAL(cpg.addMethodref(DOUBLE_CLASS,
                 DOUBLE_VALUE,
                 DOUBLE_VALUE_SIG)));
    }
View Full Code Here

                                                    CHARACTERSW_SIG);

            il.append(classGen.loadTranslet());
            _select.translate(classGen, methodGen);
            il.append(methodGen.loadHandler());
            il.append(new INVOKEVIRTUAL(characters));
        } else {
            final int characters = cpg.addInterfaceMethodref(DOM_INTF,
                                                             CHARACTERS,
                                                             CHARACTERS_SIG);
View Full Code Here

  final ConstantPoolGen cpg = classGen.getConstantPool();
  final InstructionList il = methodGen.getInstructionList();

  il.append(DUP);
  final BranchHandle ifNull = il.append(new IFNULL(null));
  il.append(new INVOKEVIRTUAL(cpg.addMethodref(_javaClassName,
                "toString",
                "()" + STRING_SIG)));
  final BranchHandle gotobh = il.append(new GOTO(null));
  ifNull.setTarget(il.append(POP));
  il.append(new PUSH(cpg, ""));
View Full Code Here

  if (stylesheet.hasLocalParams() || hasContents()) {
      il.append(classGen.loadTranslet());
      final int pushFrame = cpg.addMethodref(TRANSLET_CLASS,
               PUSH_PARAM_FRAME,
               PUSH_PARAM_FRAME_SIG);
      il.append(new INVOKEVIRTUAL(pushFrame));
      // translate with-params
      translateContents(classGen, methodGen);
  }


  il.append(classGen.loadTranslet());

  // The 'select' expression is a result-tree
  if ((_type != null) && (_type instanceof ResultTreeType)) {
      // <xsl:sort> cannot be applied to a result tree - issue warning
      if (sortObjects.size() > 0) {
    ErrorMsg err = new ErrorMsg(ErrorMsg.RESULT_TREE_SORT_ERR,this);
    getParser().reportError(WARNING, err);
      }
      // Put the result tree (a DOM adapter) on the stack
      _select.translate(classGen, methodGen)
      // Get back the DOM and iterator (not just iterator!!!)
      _type.translateTo(classGen, methodGen, Type.NodeSet);
  }
  else {
      il.append(methodGen.loadDOM());

      // compute node iterator for applyTemplates
      if (sortObjects.size() > 0) {
    Sort.translateSortIterator(classGen, methodGen,
             _select, sortObjects);
    int setStartNode = cpg.addInterfaceMethodref(NODE_ITERATOR,
                   SET_START_NODE,
                   "(I)"+
                   NODE_ITERATOR_SIG);
    il.append(methodGen.loadCurrentNode());
    il.append(new INVOKEINTERFACE(setStartNode,2));
    setStartNodeCalled = true
      }
      else {
    if (_select == null)
        Mode.compileGetChildren(classGen, methodGen, current);
    else
        _select.translate(classGen, methodGen);
      }
  }

  if (_select != null && !setStartNodeCalled) {
      _select.startIterator(classGen, methodGen);
  }

  //!!! need to instantiate all needed modes
  final String className = classGen.getStylesheet().getClassName();
  il.append(methodGen.loadHandler());
  final String applyTemplatesSig = classGen.getApplyTemplatesSig();
  final int applyTemplates = cpg.addMethodref(className,
                _functionName,
                applyTemplatesSig);
  il.append(new INVOKEVIRTUAL(applyTemplates));
 
  // Pop parameter frame
  if (stylesheet.hasLocalParams() || hasContents()) {
      il.append(classGen.loadTranslet());
      final int popFrame = cpg.addMethodref(TRANSLET_CLASS,
              POP_PARAM_FRAME,
              POP_PARAM_FRAME_SIG);
      il.append(new INVOKEVIRTUAL(popFrame));
  }
    }
View Full Code Here

    public void translateUnBox(ClassGenerator classGen,
             MethodGenerator methodGen) {
  final ConstantPoolGen cpg = classGen.getConstantPool();
  final InstructionList il = methodGen.getInstructionList();
  il.append(new CHECKCAST(cpg.addClass(BOOLEAN_CLASS)));
  il.append(new INVOKEVIRTUAL(cpg.addMethodref(BOOLEAN_CLASS,
                 BOOLEAN_VALUE,
                 BOOLEAN_VALUE_SIG)));
    }
View Full Code Here

  final InstructionList il = methodGen.getInstructionList();
  il.append(new CHECKCAST(cpg.addClass(INTEGER_CLASS)));
  final int index = cpg.addMethodref(INTEGER_CLASS,
             INT_VALUE,
             INT_VALUE_SIG);
  il.append(new INVOKEVIRTUAL(index));
    }
View Full Code Here

      StringTokenizer tokens = new StringTokenizer(_cdata);
      while (tokens.hasMoreTokens()) {
    il.append(DUP);
    il.append(new PUSH(cpg, tokens.nextToken()));
    il.append(new INVOKEVIRTUAL(index));
      }
  }
  il.append(POP); // Cleanup - pop last translet reference off stack
    }
View Full Code Here

  // This is a special case for the //* path with or without predicates
        if (_hasDescendantAxis) {
      final int incl = cpg.addMethodref(NODE_ITERATOR_BASE,
                "includeSelf",
                "()" + NODE_ITERATOR_SIG);
      il.append(new INVOKEVIRTUAL(incl));
  }

  if (!(getParent() instanceof RelativeLocationPath) &&
      !(getParent() instanceof FilterParentPath)) {
      final int order = cpg.addInterfaceMethodref(DOM_INTF,
View Full Code Here

TOP

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

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.