[Soot-list] LOC in Dacapo-2006 benchmark

Zhoulai zell08v at orange.fr
Wed Jan 30 02:51:59 EST 2013


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
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20130130/58afe1ca/attachment.html 


More information about the Soot-list mailing list