1 19 20 25 26 27 28 29 30 31 32 package soot.coffi; 33 35 import java.io.*; 36 37 class Info { 38 39 public ClassFile cf; 40 public long flength; 42 public int cp; public int fields; public int methods; public int pfields; public int pmethods; 48 public int attribsave; public int attribcpsave; public int psave; 52 public Info(ClassFile newcf) { cf = newcf; } 53 54 public void verboseReport(PrintStream ps) { 55 int total; 56 57 ps.println("<INFO> -- Debigulation Report on " + cf.fn + " --"); 58 ps.println("<INFO> Length: " + flength); 59 ps.println("<INFO> CP: " + cp + " reduced to " + cf.constant_pool_count); 60 ps.println("<INFO> Fields: " + fields + " (" + pfields + " private)" + 61 " reduced to " + cf.fields_count); 62 ps.println("<INFO> Methods: " + methods + " (" + pmethods + " private)" + 63 " reduced to " + cf.methods_count); 64 total = attribsave+attribcpsave+psave; 65 if (total>0) { 66 ps.println("<INFO> -- Savings through debigulation --"); 67 if (attribsave > 0) 68 ps.println("<INFO> Attributes: " + attribsave); 69 if (attribcpsave > 0) 70 ps.println("<INFO> CP Compression: " + attribcpsave); 71 if (psave > 0) 72 ps.println("<INFO> Private renaming: " + psave); 73 ps.println("<INFO> Total savings: " + total); 74 double d = (((double)total)*100000.0)/((double)flength); 75 int x = (int)d; 76 d = ((double)x)/1000.0; 77 ps.println("<INFO> ratio: " + d + "%"); 78 } 79 } 80 } 81 | Popular Tags |