get maxStack/maxLocals from MethodGen
authorbrian <brian@brianweb.net>
Sun, 3 Jul 2005 20:34:57 +0000 (20:34 +0000)
committerbrian <brian@brianweb.net>
Sun, 3 Jul 2005 20:34:57 +0000 (20:34 +0000)
darcs-hash:20050703203457-24bed-09ea083daf393328ed05066f6107a810f3c57d7b.gz

src/org/ibex/classgen/JSSA.java
src/org/ibex/classgen/MethodGen.java

index 55c6793..b8e57ca 100644 (file)
@@ -13,6 +13,8 @@ public class JSSA extends MethodGen implements CGConst {
     
     public JSSA(Type.Class c, DataInput in, ConstantPool cp) throws IOException {
         super(c, in, cp);
     
     public JSSA(Type.Class c, DataInput in, ConstantPool cp) throws IOException {
         super(c, in, cp);
+        local = new Expr[maxLocals];
+        stack = new Expr[maxStack];
         for(int i=0; i<this.method.getNumArgs(); i++)
             local[i] = new Argument("arg"+i, this.method.getArgType(i));
         for(int i=0; i<size(); i++) {
         for(int i=0; i<this.method.getNumArgs(); i++)
             local[i] = new Argument("arg"+i, this.method.getArgType(i));
         for(int i=0; i<size(); i++) {
@@ -63,10 +65,10 @@ public class JSSA extends MethodGen implements CGConst {
     // Instance Data; used ONLY during constructor; then thrown away /////////////////////////////////////////////////
 
     /** this models the JVM locals; it is only used for unwinding stack-ops into an SSA-tree, then thrown away */
     // Instance Data; used ONLY during constructor; then thrown away /////////////////////////////////////////////////
 
     /** this models the JVM locals; it is only used for unwinding stack-ops into an SSA-tree, then thrown away */
-    private Expr[] local = new Expr[6];
+    private final Expr[] local;
     
     /** this models the JVM stack; it is only used for unwinding stack-ops into an SSA-tree, then thrown away */
     
     /** this models the JVM stack; it is only used for unwinding stack-ops into an SSA-tree, then thrown away */
-    private Expr[] stack = new Expr[65535];
+    private final Expr[] stack;
 
     /** JVM stack pointer */
     private int sp = 0;
 
     /** JVM stack pointer */
     private int sp = 0;
index 5b0ba85..0b0835e 100644 (file)
@@ -15,8 +15,8 @@ public class MethodGen extends Type.Class.Method.Body {
     private final Vector exnTable = new Vector();
     private final Hashtable thrownExceptions = new Hashtable();
     
     private final Vector exnTable = new Vector();
     private final Hashtable thrownExceptions = new Hashtable();
     
-    private int maxStack = 16;
-    private int maxLocals;
+    int maxStack = 16;
+    int maxLocals;
     
     private int size;
     private int capacity;
     
     private int size;
     private int capacity;