Package org.objectweb.asm.tree.analysis

Examples of org.objectweb.asm.tree.analysis.Analyzer.analyze()


                    throw new RuntimeException(e.toString()+" " +cl, e);
                }
            }
        });
        try {
            a.analyze(owner, meth);
        } catch (AnalyzerException e) {
            error = e.getMessage();
            if (error.startsWith("Error at instruction ")) {
                error = error.substring("Error at instruction ".length());
                errorInsn = Integer.parseInt(error.substring(0, error
View Full Code Here


      protected void newControlFlowEdge(int src, int dst) {
        Node s = (Node) getFrames()[src];
        s.successors.add((Node) getFrames()[dst]);
      }
    };
    a.analyze(owner, mn);
    Frame[] frames = a.getFrames();
    int edges = 0;
    int nodes = 0;
    for (int i = 0; i < frames.length; ++i) {
      if (frames[i] != null) {
View Full Code Here

  public void visitEnd() {
    MethodNode mn = (MethodNode) mv;
    Analyzer a = new Analyzer(new BasicInterpreter());
    try {
      a.analyze(owner, mn);
      Frame[] frames = a.getFrames();
      AbstractInsnNode[] insns = mn.instructions.toArray();
      for (int i = 0; i < frames.length; ++i) {
        if (frames[i] == null && !(insns[i] instanceof LabelNode)) {
          mn.instructions.remove(insns[i]);
View Full Code Here

  public List<AbstractInsnNode> findNullDereferences(String owner,
      MethodNode mn) throws AnalyzerException {
    List<AbstractInsnNode> result = new ArrayList<AbstractInsnNode>();
    Analyzer a = new Analyzer(new IsNullInterpreter());
    a.analyze(owner, mn);
    Frame[] frames = a.getFrames();
    AbstractInsnNode[] insns = mn.instructions.toArray();
    for (int i = 0; i < insns.length; ++i) {
      AbstractInsnNode insn = insns[i];
      if (frames[i] != null) {
View Full Code Here

  }

  public void transform(MethodNode mn) {
    Analyzer a = new Analyzer(new SimpleVerifier());
    try {
      a.analyze(owner, mn);
      Frame[] frames = a.getFrames();
      AbstractInsnNode[] insns = mn.instructions.toArray();
      for (int i = 0; i < insns.length; ++i) {
        AbstractInsnNode insn = insns[i];
        if (insn.getOpcode() == CHECKCAST) {
View Full Code Here

  public void visitEnd() {
    MethodNode mn = (MethodNode) mv;
    Analyzer a = new Analyzer(new BasicVerifier());
    try {
      a.analyze(owner, mn);
    } catch (AnalyzerException e) {
      throw new RuntimeException(e.getMessage());
    }
    mn.accept(next);
  }
View Full Code Here

        for (int k = 0; k < methods.size(); ++k) {
          MethodNode method = (MethodNode) methods.get(k);
          if (method.instructions.size() > 0) {
            Analyzer a = new Analyzer(new BasicInterpreter());
            try {
              a.analyze(cn.name, method);
            } catch (Throwable th) {
              ++errors;
            }
          }
        }
View Full Code Here

        for (int k = 0; k < methods.size(); ++k) {
          MethodNode method = (MethodNode) methods.get(k);
          if (method.instructions.size() > 0) {
            Analyzer a = new Analyzer(new SimpleVerifier());
            try {
              a.analyze(cn.name, method);
            } catch (Throwable th) {
              ++errors;
            }
          }
        }
View Full Code Here

      MethodNode method = (MethodNode)methods.get(i);
      if (method.instructions.size() > 0) {
        if (!analyze(ca.classNode, method)) {
          Analyzer a = new Analyzer(new BasicVerifier());
          try {
            a.analyze(ca.classNode, method);
          } catch (Exception ignored) {
          }
          final Frame[] frames = a.getFrames();
         
          TraceCodeVisitor cv = new TraceCodeVisitor(null) {
View Full Code Here

   * (in the control flow graph).
   */
 
  public static boolean analyze (ClassNode c, MethodNode m) throws Exception {
    Analyzer a = new Analyzer(new DataflowInterpreter());
    Frame[] frames = a.analyze(c, m);

    // for each xLOAD instruction, we find the xSTORE instructions that can
    // produce the value loaded by this instruction, and we put them in 'stores'
    Set stores = new HashSet();
    for (int i = 0; i < m.instructions.size(); ++i) {
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.