[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Limiting whole-program analysis



Venkatesh Prasad Ranganath wrote:

Any idea about the number of methods in the call graph after the above mentioned optimization?

Few, for my simple example (attached) it includes A.main, X.<init>, java.lang.Object<init> and java.lang.Object.finalize.


BTW: it's not really an optimization, it's a hack. But since it reduces the edit/compile/debug/test cycle-time with 99%, it's a GOOD hack :)

Also, what are the methods being included in the call graph?

Most of the SDK I'd guess.


Can you mail me a dump of hte call graph if you have generated one?

I can mail you a list of the visited methods, if you want? But it's easy to make the output yourself. I have simply added to ReachableMethods.addMethod:


    private void addMethod( MethodOrMethodContext m ) {
        if( set.add( m ) ) {
        	final SootMethod _m = m.method();
        	final SootClass _sc = _m.getDeclaringClass();
        	final String _m_name = _m.getName();
        	final String _sc_name = _sc.getName();
		G.v().out.println("addMethod: " + _sc_name + "." + _m_name);
           	reachables.add( m );
        }
    }

And that gives me a list of the visited methods. (i piped output from running soot into "wc -l", that gave 14560. Knowing that the normal output is <500 lines..., I conclude that at least 14000 methods are visited :).

The reason I ask is to compare it with the call graph that I generate based on my points-to analysis.

What are the properties of your points-to analysis? how does it differ form the spark or bdd one?


waiting for reply,

There you are ;)


--
Helge
class X {
	X x;
	public X(X x) { 
		this.x = x;
	}
}
public class A extends Object {
	public static void main(String[] args) {
		X x1 = new X(null);
		X x2 = new X(x1);
		X x = x2.x;
	}
}