X-Git-Url: http://git.megacz.com/?p=org.ibex.core.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Futil%2FBytecodePruner.java;h=4514cb401422153c3d02cf0f0a1124ee700281ac;hp=9dbae7591df5f0e866a29abfc754728fc32f38f8;hb=12b10e48ae86a8fe82840247428254aea62e370b;hpb=2b0def7f037c092c02bce1104dc758cae3da9809 diff --git a/src/org/ibex/util/BytecodePruner.java b/src/org/ibex/util/BytecodePruner.java index 9dbae75..4514cb4 100644 --- a/src/org/ibex/util/BytecodePruner.java +++ b/src/org/ibex/util/BytecodePruner.java @@ -7,13 +7,6 @@ import org.apache.bcel.generic.*; import org.apache.bcel.classfile.*; import org.apache.bcel.util.*; - // SecurityManager hacks to avoid java.security? - // URL and all descendents? Probably impossible. - // ObjectInput/ObjectOutput? Serialization? - - // superprune: URLClassLoader, convert.In/Output other than needed, unneeded locales - // reflective metadata is killing us... - // Reachability rules: // - a constructor is reachable iff it is called @@ -35,8 +28,12 @@ import org.apache.bcel.util.*; public class BytecodePruner { public static final boolean deleteMethods = false; + + // FIXME public static SyntheticRepository repo = null; + public static HashSet dest = new HashSet(); + public static String outdir = "."; public void loadAllMethods(String classname) throws Exception { @@ -44,39 +41,106 @@ public class BytecodePruner { Method[] meths = getMethods(repo.loadClass(classname)); for(int i=0; i= 3 && s[1].equals("-o")) { outdir = s[2]; start += 2; } repo = SyntheticRepository.getInstance(new ClassPath(s[0])); - for(int i=start; i")) good = true; @@ -235,8 +304,7 @@ public class BytecodePruner { dest.add(method); level += 2; for(int i=0; i