Package org.apache.bcel.generic

Examples of org.apache.bcel.generic.PUSH


                        cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
                                                  "comment",
                                                  "([CII)V");
                il.append(new INVOKEINTERFACE(comment, 4));
            } else {
                il.append(new PUSH(cpg, rawText.getText()));
                final int comment =
                        cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
                                                  "comment",
                                                  "(" + STRING_SIG + ")V");
                il.append(new INVOKEINTERFACE(comment, 2));
View Full Code Here


  if (isSecureProcessing) {
      int index = cpg.addMethodref(BASIS_LIBRARY_CLASS,
                 "unallowed_extension_elementF",
                 "(Ljava/lang/String;)V");
      il.append(new PUSH(cpg, "redirect"));
      il.append(new INVOKESTATIC(index));
      return;  
  }

  // Save the current output handler on the stack
  il.append(methodGen.loadHandler());
 
  final int open =  cpg.addMethodref(TRANSLET_CLASS,
             "openOutputHandler",
                                           "(" + STRING_SIG + "Z)" +
             TRANSLET_OUTPUT_SIG);

  final int close =  cpg.addMethodref(TRANSLET_CLASS,
              "closeOutputHandler",
              "("+TRANSLET_OUTPUT_SIG+")V");

  // Create the new output handler (leave it on stack)
  il.append(classGen.loadTranslet());
  _filename.translate(classGen, methodGen);
        il.append(new PUSH(cpg, _append));
  il.append(new INVOKEVIRTUAL(open));

  // Overwrite current handler
  il.append(methodGen.storeHandler());
 
View Full Code Here

  // run-time error message for unsupported external functions
  else if (unresolvedExternal) {
      index = cpg.addMethodref(BASIS_LIBRARY_CLASS,
             "unresolved_externalF",
             "(Ljava/lang/String;)V");
      il.append(new PUSH(cpg, _fname.toString()));
      il.append(new INVOKESTATIC(index));
  }
  else if (_isExtConstructor) {
      if (isSecureProcessing)
          translateUnallowedExtension(cpg, il);
View Full Code Here

    private void translateUnallowedExtension(ConstantPoolGen cpg,
                                             InstructionList il) {
  int index = cpg.addMethodref(BASIS_LIBRARY_CLASS,
             "unallowed_extension_functionF",
             "(Ljava/lang/String;)V");
  il.append(new PUSH(cpg, _fname.toString()));
  il.append(new INVOKESTATIC(index));  
    }   
View Full Code Here

    }

    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
  ConstantPoolGen cpg = classGen.getConstantPool();
  InstructionList il = methodGen.getInstructionList();
  il.append(new PUSH(cpg, _value));
    }
View Full Code Here

      _left.translate(classGen, methodGen);
      _left.startIterator(classGen, methodGen);
      _right.translate(classGen, methodGen);
      _right.startIterator(classGen, methodGen);

      il.append(new PUSH(cpg, _op));
      il.append(methodGen.loadDOM());

      int index = cpg.addMethodref(BASIS_LIBRARY_CLASS, "compare",
           "("
           + _left.getType().toSignature()
View Full Code Here

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

      // Create new instance of DOM class (with RTF_INITIAL_SIZE nodes)
      il.append(methodGen.loadDOM());
      int index = cpg.addInterfaceMethodref(DOM_INTF,
         "getResultTreeFrag",
         "(IZ)" + DOM_INTF_SIG);
      il.append(new PUSH(cpg, RTF_INITIAL_SIZE));
      il.append(new PUSH(cpg, false));
      il.append(new INVOKEINTERFACE(index,3));
      il.append(DUP);
     
      // Store new DOM into a local variable
      newDom = methodGen.addLocalVariable("rt_to_reference_dom",
View Full Code Here

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

  // If no current, conversion is a top-level
  if (current < 0) {
      il.append(new PUSH(cpg, DTM.ROOT_NODE))// push root node
  }
  else {
      il.append(new ILOAD(current));
  }
  il.append(methodGen.loadDOM());
View Full Code Here

                ifBlock.setTarget(il.append(NOP));
                return;
            }
           
      il.append(classGen.loadTranslet());
      il.append(new PUSH(cpg, name));
      translateValue(classGen, methodGen);
      il.append(new PUSH(cpg, true));

      // Call addParameter() from this class
      il.append(new INVOKEVIRTUAL(cpg.addMethodref(TRANSLET_CLASS,
               ADD_PARAMETER,
               ADD_PARAMETER_SIG)));
      if (className != EMPTYSTRING) {
    il.append(new CHECKCAST(cpg.addClass(className)));
      }

      _type.translateUnBox(classGen, methodGen);

      if (_refs.isEmpty()) { // nobody uses the value
    il.append(_type.POP());
    _local = null;
      }
      else {    // normal case
    _local = methodGen.addLocalVariable2(name,
                 _type.toJCType(),
                 null);
    // Cache the result of addParameter() in a local variable
    _local.setStart(il.append(_type.STORE(_local.getIndex())));
      }
  }
  else {
      if (classGen.containsField(name) == null) {
    classGen.addField(new Field(ACC_PUBLIC, cpg.addUtf8(name),
              cpg.addUtf8(signature),
              null, cpg.getConstantPool()));
    il.append(classGen.loadTranslet());
    il.append(DUP);
    il.append(new PUSH(cpg, name));
    translateValue(classGen, methodGen);
    il.append(new PUSH(cpg, true));

    // Call addParameter() from this class
    il.append(new INVOKEVIRTUAL(cpg.addMethodref(TRANSLET_CLASS,
                 ADD_PARAMETER,
                 ADD_PARAMETER_SIG)));
View Full Code Here

TOP

Related Classes of org.apache.bcel.generic.PUSH

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.