From 97ab034c5d9dba29f1de495cef9c5a5be8b9ad8f Mon Sep 17 00:00:00 2001 From: chiba Date: Fri, 11 Nov 2011 17:16:34 +0000 Subject: [PATCH] added javassist.bytecode.analysis.ControlFlow git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@600 30ef5769-5b8d-40dd-aea6-55b5d6557bb3 --- .../javassist/bytecode/analysis/ControlFlow.java | 14 ++++++++++++++ src/main/javassist/bytecode/analysis/package.html | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/main/javassist/bytecode/analysis/ControlFlow.java b/src/main/javassist/bytecode/analysis/ControlFlow.java index 424884ba..5b3027aa 100644 --- a/src/main/javassist/bytecode/analysis/ControlFlow.java +++ b/src/main/javassist/bytecode/analysis/ControlFlow.java @@ -26,6 +26,20 @@ import javassist.bytecode.stackmap.BasicBlock; /** * Represents the control flow graph of a given method. * + *

To obtain the control flow graph, do the following:

+ * + *
CtMethod m = ...
+ * ControlFlow cf = new ControlFlow(m);
+ * Block[] blocks = cf.basicBlocks();
+ * 
+ * + *

blocks is an array of basic blocks in + * that method body.

+ * + * @see javassist.CtMethod + * @see Block + * @see Frame + * @see Analyzer * @author Shigeru Chiba */ public class ControlFlow { diff --git a/src/main/javassist/bytecode/analysis/package.html b/src/main/javassist/bytecode/analysis/package.html index 0cc1e340..ec39a473 100644 --- a/src/main/javassist/bytecode/analysis/package.html +++ b/src/main/javassist/bytecode/analysis/package.html @@ -6,7 +6,7 @@ Bytecode Analysis API. This allows the user to determine the type state of the stack and local variable table at the start of every instruction. In addition this API can be used to validate bytecode, find dead bytecode, and identify unnecessary checkcasts. -Look at Analyzer class first for details. +Look at ControlFlow class first for details.

The users of this package must know the specifications of class file and Java bytecode. For more details, read this book: -- 2.39.5