summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2011-11-12 16:06:24 +0000
committerchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2011-11-12 16:06:24 +0000
commit6aba69051063a892780bd2ce11f03e0917c670af (patch)
tree93d2299966f6092ca477f278fb9693ccdd8a76e3 /src
parent97ab034c5d9dba29f1de495cef9c5a5be8b9ad8f (diff)
downloadjavassist-6aba69051063a892780bd2ce11f03e0917c670af.tar.gz
javassist-6aba69051063a892780bd2ce11f03e0917c670af.zip
added javassist.bytecode.analysis.ControlFlow
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@601 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
Diffstat (limited to 'src')
-rw-r--r--src/main/javassist/bytecode/analysis/ControlFlow.java7
-rw-r--r--src/test/test/javassist/bytecode/analysis/DomTreePrinter.java26
2 files changed, 33 insertions, 0 deletions
diff --git a/src/main/javassist/bytecode/analysis/ControlFlow.java b/src/main/javassist/bytecode/analysis/ControlFlow.java
index 5b3027aa..3f50182a 100644
--- a/src/main/javassist/bytecode/analysis/ControlFlow.java
+++ b/src/main/javassist/bytecode/analysis/ControlFlow.java
@@ -175,6 +175,13 @@ public class ControlFlow {
* we deal with <code>JSR</code> as a non-branch instruction.
*/
public static class Block extends BasicBlock {
+ /**
+ * A field that can be freely used for storing extra data.
+ * A client program of this control-flow analyzer can append
+ * an additional attribute to a <code>Block</code> object.
+ */
+ public Object clientData = null;
+
int index;
MethodInfo method;
Block[] entrances;
diff --git a/src/test/test/javassist/bytecode/analysis/DomTreePrinter.java b/src/test/test/javassist/bytecode/analysis/DomTreePrinter.java
index f5418c50..7c2c8bdd 100644
--- a/src/test/test/javassist/bytecode/analysis/DomTreePrinter.java
+++ b/src/test/test/javassist/bytecode/analysis/DomTreePrinter.java
@@ -24,4 +24,30 @@ public class DomTreePrinter {
}
return array[0];
}
+
+ public int dummy2(int n, int[] array) {
+ int i = 0;
+ while (i < n) {
+ if (array[i] > 0)
+ break;
+ if (array[i++] > -1)
+ continue;
+ array[0]++;
+ array[1]++;
+ }
+ return array[0];
+ }
+
+ public int dummy3(int n, int[] array) {
+ int i = 0;
+ do {
+ if (array[i] > 0)
+ break;
+ if (array[i++] > -1)
+ continue;
+ array[0]++;
+ array[1]++;
+ } while (i < n);
+ return array[0];
+ }
}