[Soot-list] LOC in Dacapo-2006 benchmark

Richard Xiao richardxx at cse.ust.hk
Wed Jan 30 03:02:17 EST 2013


Hi,

Your code "SootClass c: Scene.v().getApplicationClasses()", that only
counts the methods manually provided in your soot command line.

Please obtain the reachable methods from CallGraph.ReachableMethods()
function:
http://www.sable.mcgill.ca/soot/doc/soot/jimple/toolkits/callgraph/ReachableMethods.html


Regards,
Xiao


On Wed, Jan 30, 2013 at 3:51 PM, Zhoulai <zell08v at orange.fr> wrote:

> Thank  you for your quick reply.
>
> The codes for LOC counting is mixed in the project. But basically,  it is
> computed iteratively (accumulated in TotalLoc below) the LOC of all the
> reachable methods from Main.
> //*** The computation of LOC is here//
>        TotalLOC = 0;
>         for (SootClass sc: class2profiles.keySet()){
>
>             for (Profile pf: class2profiles.get(sc)){
>                 totalLOC+=pf.getBody().getUnits().size();
>               }
>        }
>
> //*** my analysis is basically here, which collects reachable method from
> Main,
>     public MySceneTransformer(Map<SootClass, ArrayList<Profile>>
> class2profiles) {
>         this.class2profiles=class2profiles;
>
>         @Override
>         protected void internalTransform(String phaseName, Map options) {
>          public Map<SootClass, ArrayList<Profile>> class2profiles;
>           for (SootClass  c: Scene.v().getApplicationClasses()){
>               ArrayList<Profile> profiles = new ArrayList<Profile>();
>               for (SootMethod sm:  c.getMethods()){
>               ...
>                    if (!sm.isConcrete() || sm.getName().equals("<init>"))
>                     continue;
>             ...
>             profiles.add(sm);
>           }
>          class2profiles.put(c,profiles)
> }
>
> Any idea?
> Zell.
>
>
>
> On Wed, Jan 30, 2013 at 8:25 AM, Tony Yan <yan at cse.ohio-state.edu> wrote:
>
>> Hi,
>>
>> Can you show the code to count LOC?
>>
>> Thanks,
>> Tony
>>
>> On Wed, Jan 30, 2013 at 2:19 AM, Zhoulai <zell08v at orange.fr> wrote:
>> > Hello,
>> >
>> > Recently, I analyzed Dacapo-2006 using soot. I find the LOC that I got
>> for
>> > the benchmark is much less than the one in your 2006's oopsla paper.
>> >
>> > In particular, I find xalan has only 4786 LOC, hsqldb has 5634 LOC, fop
>> has
>> > 182109 LO . I am aware of issues related to whether to count LOC of
>> library
>> > class. But I am using the options that maximal LOC could have been
>> collected
>> > started from main class.
>> >
>> > The options I used include: -pp, -w, -app, and the following
>> >
>> >            sootArgs.add("-include");
>> >             sootArgs.add("org.apache.");
>> >             sootArgs.add("-include");
>> >             sootArgs.add("org.w3c.");
>> >             sootArgs.add("-p");
>> >             sootArgs.add("cg.spark");
>> >             sootArgs.add("enabled:true");
>> >             sootArgs.add("-p");
>> >             sootArgs.add("cg.spark");
>> >             sootArgs.add("on-fly-cg:true");
>> >
>> > Do you think it is normal to have 4786 LOC for xalan?
>> >
>> > Zell.
>> >
>> > _______________________________________________
>> > Soot-list mailing list
>> > Soot-list at sable.mcgill.ca
>> > http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>> >
>>
>
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
>


-- 
Richard Xiao Xiao
PhD Student @ CSE @ Hong Kong University of Science and Technology
www.cse.ust.hk/~richardxx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20130130/81ed5c34/attachment-0001.html 


More information about the Soot-list mailing list