Top Description Interfaces Classes
[default module]

Package org.objectweb.asm.tree.analysis


Provides a framework for static code analysis based on the asm.tree package.

Basic usage:

ClassReader classReader = new ClassReader(bytecode);
ClassNode classNode = new ClassNode();
classReader.accept(classNode, ClassReader.SKIP_DEBUG);

for (MethodNode method : classNode.methods) {
  if (method.instructions.size() > 0) {
    Analyzer analyzer = new Analyzer(new BasicInterpreter());
    analyzer.analyze(classNode.name, method);
    Frame[] frames = analyzer.getFrames();
    // Elements of the frames array now contains info for each instruction
    // from the analyzed method. BasicInterpreter creates BasicValue, that
    // is using simplified type system that distinguishes the UNINITIALZED,
    // INT, FLOAT, LONG, DOUBLE, REFERENCE and RETURNADDRESS types.
    ...
  }
}

Since
ASM 1.4.3

Interface Summary

Modifier and TypeInterface and Description
public interface
Value

An immutable symbolic value for the semantic interpretation of bytecode.

Class Summary

Modifier and TypeClass and Description
public class
Analyzer<
type of the Value used for the analysis.
V extends Value
>

A semantic bytecode analyzer.

public class
AnalyzerException

An exception thrown if a problem occurs during the analysis of a method.

public class
public class
BasicValue

A Value that is represented with its type in a seven types type system.

public class
BasicVerifier

An extended BasicInterpreter that checks that bytecode instructions are correctly used.

public class
Frame<
type of the Value used for the analysis.
V extends Value
>

A symbolic execution stack frame.

public abstract class
Interpreter<
type of the Value used for the analysis.
V extends Value
>

A semantic bytecode interpreter.

public class
SimpleVerifier

An extended BasicVerifier that performs more precise verifications.

pack-priv class
SmallSet<T>

An immutable set of at most two elements, optimized for speed compared to a generic set implementation.

public class
public class
SourceValue

A Value which keeps track of the bytecode instructions that can produce it.

pack-priv class
Subroutine

A method subroutine (corresponds to a JSR instruction).