removed redundant ownerInterface argument
authoradam <adam@megacz.com>
Mon, 27 Jun 2005 08:33:10 +0000 (08:33 +0000)
committeradam <adam@megacz.com>
Mon, 27 Jun 2005 08:33:10 +0000 (08:33 +0000)
darcs-hash:20050627083310-5007d-321c6c51fa5c7422c6b945e9e0b53156fbc48eed.gz

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

index f70ed48..9d1b2b0 100644 (file)
@@ -86,7 +86,7 @@ public class ClassFile implements CGConst {
         @see CGConst
     */
     public final MethodGen addMethod(String name, Type ret, Type[] args, int flags) {
         @see CGConst
     */
     public final MethodGen addMethod(String name, Type ret, Type[] args, int flags) {
-        MethodGen mg = new MethodGen(this.getType(), name, ret, args, flags, (this.flags & INTERFACE) != 0);
+        MethodGen mg = new MethodGen(method(name, ret, args), flags);
         methods.addElement(mg);
         return mg;
     }
         methods.addElement(mg);
         return mg;
     }
@@ -215,7 +215,7 @@ public class ClassFile implements CGConst {
         int numFields = i.readShort();
         for(int j=0; j<numFields; j++) fields.addElement(new FieldGen(i, cp));
         int numMethods = i.readShort();
         int numFields = i.readShort();
         for(int j=0; j<numFields; j++) fields.addElement(new FieldGen(i, cp));
         int numMethods = i.readShort();
-        for(int j=0; j<numMethods; j++) methods.addElement(new MethodGen(this.getType(), i, cp, (this.flags & INTERFACE) != 0));
+        for(int j=0; j<numMethods; j++) methods.addElement(new MethodGen(this.getType(), i, cp);
         attributes = new AttrGen(i, cp);
         
         // FEATURE: Support these
         attributes = new AttrGen(i, cp);
         
         // FEATURE: Support these
index 3e8571d..96193da 100644 (file)
@@ -104,7 +104,7 @@ public class MethodGen implements CGConst {
         }
     }
 
         }
     }
 
-    MethodGen(Type.Class c, DataInput in, ConstantPool cp, boolean ownerInterface) throws IOException {
+    MethodGen(Type.Class c, DataInput in, ConstantPool cp) throws IOException {
         this.flags = in.readShort();
         if ((flags & ~VALID_METHOD_FLAGS) != 0) throw new ClassFile.ClassReadExn("invalid flags");
         String name = cp.getUtf8KeyByIndex(in.readShort());
         this.flags = in.readShort();
         if ((flags & ~VALID_METHOD_FLAGS) != 0) throw new ClassFile.ClassReadExn("invalid flags");
         String name = cp.getUtf8KeyByIndex(in.readShort());
@@ -294,15 +294,15 @@ public class MethodGen implements CGConst {
         return map;
     }
 
         return map;
     }
 
-    MethodGen(Type.Class c, String name, Type ret, Type[] args, int flags, boolean ownerInterface) {
+    MethodGen(Type.Class.Method method, int flags) {
         if ((flags & ~VALID_METHOD_FLAGS) != 0) throw new IllegalArgumentException("invalid flags");
         if ((flags & ~VALID_METHOD_FLAGS) != 0) throw new IllegalArgumentException("invalid flags");
-        this.method = c.method(name, ret, args);
+        this.method = method;
         this.flags = flags;
         
         attrs = new ClassFile.AttrGen();
         codeAttrs = new ClassFile.AttrGen();
         
         this.flags = flags;
         
         attrs = new ClassFile.AttrGen();
         codeAttrs = new ClassFile.AttrGen();
         
-        if(ownerInterface || (flags & (ABSTRACT|NATIVE)) != 0) size = capacity = -1;
+        if (((flags & INTERFACE) != 0) || (flags & (ABSTRACT|NATIVE)) != 0) size = capacity = -1;
         
         maxLocals = Math.max(args.length + (flags&STATIC)==0 ? 1 : 0, 4);
     }
         
         maxLocals = Math.max(args.length + (flags&STATIC)==0 ? 1 : 0, 4);
     }