Package org.apache.bcel.generic

Examples of org.apache.bcel.generic.ANEWARRAY


  il.append(new PUSH(cpg, sortRecordClass));
  il.append(classGen.loadTranslet());

  // Compile code that initializes the static _sortOrder
  il.append(new PUSH(cpg, nsorts));
  il.append(new ANEWARRAY(cpg.addClass(STRING)));
  for (int level = 0; level < nsorts; level++) {
      final Sort sort = (Sort)sortObjects.elementAt(level);
      il.append(DUP);
      il.append(new PUSH(cpg, level));
      sort.translateSortOrder(classGen, methodGen);
      il.append(AASTORE);
  }

  il.append(new PUSH(cpg, nsorts));
  il.append(new ANEWARRAY(cpg.addClass(STRING)));
  for (int level = 0; level < nsorts; level++) {
      final Sort sort = (Sort)sortObjects.elementAt(level);
      il.append(DUP);
      il.append(new PUSH(cpg, level));
      sort.translateSortType(classGen, methodGen);
      il.append(AASTORE);
  }
 
  il.append(new PUSH(cpg, nsorts));
  il.append(new ANEWARRAY(cpg.addClass(STRING)));
  for (int level = 0; level < nsorts; level++) {
        final Sort sort = (Sort)sortObjects.elementAt(level);
        il.append(DUP);
        il.append(new PUSH(cpg, level));
        sort.translateLang(classGen, methodGen);
        il.append(AASTORE);
   }
   il.append(new PUSH(cpg, nsorts));
   il.append(new ANEWARRAY(cpg.addClass(STRING)));
   for (int level = 0; level < nsorts; level++) {
        final Sort sort = (Sort)sortObjects.elementAt(level);
        il.append(DUP);
        il.append(new PUSH(cpg, level));
        sort.translateCaseOrder(classGen, methodGen);
View Full Code Here


        LocalVariableGen sortOrderTemp
                 = methodGen.addLocalVariable("sort_order_tmp",
                                      Util.getJCRefType("[" + STRING_SIG),
                                      il.getEnd(), null);
  il.append(new PUSH(cpg, nsorts));
  il.append(new ANEWARRAY(cpg.addClass(STRING)));
  for (int level = 0; level < nsorts; level++) {
      final Sort sort = (Sort)sortObjects.elementAt(level);
      il.append(DUP);
      il.append(new PUSH(cpg, level));
      sort.translateSortOrder(classGen, methodGen);
      il.append(AASTORE);
  }
        il.append(new ASTORE(sortOrderTemp.getIndex()));

        LocalVariableGen sortTypeTemp
                 = methodGen.addLocalVariable("sort_type_tmp",
                                      Util.getJCRefType("[" + STRING_SIG),
                                      il.getEnd(), null);
  il.append(new PUSH(cpg, nsorts));
  il.append(new ANEWARRAY(cpg.addClass(STRING)));
  for (int level = 0; level < nsorts; level++) {
      final Sort sort = (Sort)sortObjects.elementAt(level);
      il.append(DUP);
      il.append(new PUSH(cpg, level));
      sort.translateSortType(classGen, methodGen);
      il.append(AASTORE);
  }
        il.append(new ASTORE(sortTypeTemp.getIndex()));

        LocalVariableGen sortLangTemp
                 = methodGen.addLocalVariable("sort_lang_tmp",
                                      Util.getJCRefType("[" + STRING_SIG),
                                      il.getEnd(), null);
        il.append(new PUSH(cpg, nsorts));
        il.append(new ANEWARRAY(cpg.addClass(STRING)));
        for (int level = 0; level < nsorts; level++) {
              final Sort sort = (Sort)sortObjects.elementAt(level);
              il.append(DUP);
              il.append(new PUSH(cpg, level));
              sort.translateLang(classGen, methodGen);
              il.append(AASTORE);
        }
        il.append(new ASTORE(sortLangTemp.getIndex()));

        LocalVariableGen sortCaseOrderTemp
                 = methodGen.addLocalVariable("sort_case_order_tmp",
                                      Util.getJCRefType("[" + STRING_SIG),
                                      il.getEnd(), null);
        il.append(new PUSH(cpg, nsorts));
        il.append(new ANEWARRAY(cpg.addClass(STRING)));
        for (int level = 0; level < nsorts; level++) {
            final Sort sort = (Sort)sortObjects.elementAt(level);
            il.append(DUP);
            il.append(new PUSH(cpg, level));
            sort.translateCaseOrder(classGen, methodGen);
View Full Code Here

  @SuppressWarnings("unused")
  // Called using reflection
  private Instruction createInstructionAnewarray(Element inst)
  {
    String classType= inst.getAttributeValue("elementType");
    return new ANEWARRAY(constantPoolGen.addClass(classType));
  }
View Full Code Here

    append(factory.createInvoke(STR_LUAVALUE, "testfor_b", Type.BOOLEAN, ARG_TYPES_LUAVALUE_LUAVALUE, Constants.INVOKEVIRTUAL));
  }

  public void loadArrayArgs(int pc, int firstslot, int nargs) {
    append(new PUSH(cp, nargs));
    append(new ANEWARRAY(cp.addClass(STR_LUAVALUE)));
    for ( int i=0; i<nargs; i++ ) {
      append(InstructionConstants.DUP);
      append(new PUSH(cp, i));
      loadLocal(pc, firstslot++);
      append(new AASTORE());
View Full Code Here

TOP

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

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.