Package org.apache.bcel.generic

Examples of org.apache.bcel.generic.InstructionList.dispose()


                mg.removeLocalVariables();
            }
            m = mg.getMethod();
        } finally {

            il.dispose();
        }
        return m;
    }
    /**
     * This method transforms a not optimized JavaClass into a new Log-optimised
View Full Code Here


        il.append(InstructionConstants.ARETURN);

        mg.setMaxStack();
        classGen.addMethod(mg.getMethod());
        il.dispose();
    }

    private static void closeSafely(ByteArrayOutputStream out)
    {
        if (out != null)
View Full Code Here

    method.setMaxStack(4);
    class_gen.addMethod(method.getMethod());

    /* public <init> -- constructor
     */
    il.dispose(); // Dispose instruction handles for better memory utilization

    il = new InstructionList();
    il.append(new ALOAD(0)); // Push `this'
    il.append(new INVOKESPECIAL(cp.addMethodref("java.lang.Object",
            "<init>", "()V")));
View Full Code Here

    method.setMaxStack(1);
    class_gen.addMethod(method.getMethod());

    /* class initializer
     */
    il.dispose(); // Dispose instruction handles for better memory utilization
    il = new InstructionList();
    il.append(new NEW(cp.addClass("java.io.BufferedReader")));
    il.append(InstructionConstants.DUP);
    il.append(new NEW(cp.addClass("java.io.InputStreamReader")));
    il.append(InstructionConstants.DUP);
View Full Code Here

    il.append(InstructionConstants.RETURN);

    mg.setMaxStack(5); // Needed stack size
    cg.addMethod(mg.getMethod());

    il.dispose(); // Reuse instruction handles

    /* Add public <init> method, i.e. empty constructor
     */
    cg.addEmptyConstructor(Constants.ACC_PUBLIC);

View Full Code Here

      System.out.println("Removed " + count + " NOP instructions from method " +
       mg.getName());
      m = mg.getMethod();
    }

    il.dispose(); // Reuse instruction handles
    return m;
  }
}
View Full Code Here

        mg.setMaxStack(2);
    }

    m = mg.getMethod();

    il.dispose(); // Reuse instruction handles
   
    return m;
  }
}
View Full Code Here

      optimizeIFs(il);     // Second optimization pass, application-specific
      method.setMaxStack(max_size);
      class_gen.addMethod(method.getMethod());
    }

    il.dispose(); // Dispose instruction handles for better memory utilization

    reset();
  }

  private static final InstructionFinder.CodeConstraint my_constraint =
View Full Code Here

      mthd.setMaxStack();

      org.apache.bcel.classfile.Method method = mthd.getMethod();

      // Reuse instruction handles
      implementation.dispose();

      return method;
   }

   private static List generateDirectInvokeBranch(ClassGen classGen, MethodGen methodGen, InstructionList implementation, InstructionFactory factory, String management, Method method, List tests)
View Full Code Here

       iList.append( InstructionFactory.createReturn( Type.OBJECT ) );

       mGen.setMaxStack();
       mGen.setMaxLocals();
       cGen.addMethod( mGen.getMethod() );
       iList.dispose();
      
       return fieldNameBuffer.toString();
   }
  
   /**
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.