From: adam Date: Mon, 23 Feb 2004 02:11:58 +0000 (+0000) Subject: working again even better X-Git-Tag: RC3~27 X-Git-Url: http://git.megacz.com/?p=org.ibex.core.git;a=commitdiff_plain;h=2b0def7f037c092c02bce1104dc758cae3da9809 working again even better darcs-hash:20040223021158-5007d-aa62b244edae8c4d560f7798c634c8ebbb9dd190.gz --- diff --git a/Makefile b/Makefile index e8781fe..f64d42f 100644 --- a/Makefile +++ b/Makefile @@ -240,7 +240,7 @@ build/$(platform)/$(target_bin): .compile build/$(platform)/builtin.o build/$(pl java -cp lib/bcel-5.1.jar:build/class org.ibex.util.BytecodePruner \ build/$(platform)/ibex.jar:upstream/install/share/java/libgcj-3.3.jar \ -o build/pruned \ - `cat .natcalls` + `cat .natcalls | grep -v ^gcj` org.ibex.plat.Linux.main # rm -rf build/pruned/org/ibex/js/*; cp build/java/org/ibex/js/* build/pruned/org/ibex/js/ diff --git a/src/org/ibex/util/BytecodePruner.java b/src/org/ibex/util/BytecodePruner.java index 4514cb4..9dbae75 100644 --- a/src/org/ibex/util/BytecodePruner.java +++ b/src/org/ibex/util/BytecodePruner.java @@ -7,6 +7,13 @@ 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 @@ -28,12 +35,8 @@ 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 { @@ -41,106 +44,39 @@ 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; @@ -304,7 +235,8 @@ public class BytecodePruner { dest.add(method); level += 2; for(int i=0; i