[jboss-cvs] javassist SVN: r601 - in trunk/src: test/test/javassist/bytecode/analysis and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sat Nov 12 11:06:24 EST 2011


Author: chiba
Date: 2011-11-12 11:06:24 -0500 (Sat, 12 Nov 2011)
New Revision: 601

Modified:
   trunk/src/main/javassist/bytecode/analysis/ControlFlow.java
   trunk/src/test/test/javassist/bytecode/analysis/DomTreePrinter.java
Log:
added javassist.bytecode.analysis.ControlFlow

Modified: trunk/src/main/javassist/bytecode/analysis/ControlFlow.java
===================================================================
--- trunk/src/main/javassist/bytecode/analysis/ControlFlow.java	2011-11-11 17:16:34 UTC (rev 600)
+++ trunk/src/main/javassist/bytecode/analysis/ControlFlow.java	2011-11-12 16:06:24 UTC (rev 601)
@@ -175,6 +175,13 @@
      * 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;

Modified: trunk/src/test/test/javassist/bytecode/analysis/DomTreePrinter.java
===================================================================
--- trunk/src/test/test/javassist/bytecode/analysis/DomTreePrinter.java	2011-11-11 17:16:34 UTC (rev 600)
+++ trunk/src/test/test/javassist/bytecode/analysis/DomTreePrinter.java	2011-11-12 16:06:24 UTC (rev 601)
@@ -24,4 +24,30 @@
         }
         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];
+    }
 }



More information about the jboss-cvs-commits mailing list