程序包 org.beetl.ow2.asm.tree.analysis
package org.beetl.ow2.asm.tree.analysis
Provides a framework for static code analysis based on the asm.tree package.
Basic usage:
ClassReader cr = new ClassReader(bytecode);
ClassNode cn = new ClassNode();
cr.accept(cn, ClassReader.SKIP_DEBUG);
List methods = cn.methods;
for (int i = 0; i < methods.size(); ++i) {
MethodNode method = (MethodNode) methods.get(i);
if (method.instructions.size() > 0) {
Analyzer a = new Analyzer(new BasicInterpreter());
a.analyze(cn.name, method);
Frame[] frames = a.getFrames();
// Elements of the frames arrray 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.
...
}
}
- 从以下版本开始:
- ASM 1.4.3
-
类说明A semantic bytecode analyzer.Thrown if a problem occurs during the analysis of a method.An
InterpreterforBasicValuevalues.AValuethat is represented by its type in a seven types type system.An extendedBasicInterpreterthat checks that bytecode instructions are correctly used.A symbolic execution stack frame.Interpreter<V extends Value>A semantic bytecode interpreter.An extendedBasicVerifierthat performs more precise verifications.AnInterpreterforSourceValuevalues.AValuethat is represented by its type in a two types type system.An immutable symbolic value for semantic interpretation of bytecode.