[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Soot typing failure
On Sun, Nov 23, 2003 at 12:32:14AM -0500, Etienne Gagnon wrote:
> PackManager.v().getTransform( "jb.a" ).apply( b );
> PackManager.v().getTransform( "jb.ule" ).apply( b );
>
> is applied BEFORE typing in soot-2.0.1/soot/src/soot/JimpleBodyPack.java
>
> This is a bug of Soot. Putting this code AFTER typing is the right approach
It has been this way for over three years, since revision 397, (prcs
1.0.0.dev.45), a change done by Feng on Sep 18, 2000. Back in April or
May, 2003, we had a long meeting about these phases, since they were
being done twice, which appeared redundant. Unfortunately, this was an
in-person rather than in-e-mail meeting, so I don't have a record of it.
Perhaps Feng, John, and Laurie remember more of it. Navin and Jennifer
may also have been present, I believe. Anyway, we decided that there
was no need to do the phases twice, and that it should be the ones AFTER
that should be removed. I believe the reason for this was that the
typing algorithm would become unbearably slow if instead we removed the
ones BEFORE the typing algorithm; John and Feng should correct me if I'm
wrong on this. The result of this was revision 891, which removed the
aggregation after the typing algorithm, leaving only the aggregation
before.
> of soot-2.0.1/soot/src/soot/JimpleBodyPack.java, verification of typing
> failure is done EVEN WHEN typing is disabled! (e.g. -p jb.tr enabled:false )
>
> This is obviously a bug.
Agreed. I'll fix this one.
> NOTE
> ====
>
> I guess some people reordered soot phases without knowing the implications on
> typing. Also, not being able to get untyped jimple is a problem for debugging
> the type-inference engine. Please make sure it remains possible to get the
> plain jimple sent to the type inference engine in a textual .jimple format.
Evidently this has been happening for over three years. In the spring,
while working on Soot 2.0, Feng, John, Laurie, Pat, and I spent a lot of time
trying to understand the reasons behind all the different Soot phases in
the jb pack, because they seemed unnecessarily complicated, and none of
us understood why they were all there, some in multiple instances. There
were several things we would have liked to simplify, but left as they
were because we didn't feel we understood the implications of changing
them sufficiently. For ongoing work, such as Navin's SSA stuff and
Jennifer's Java-to-Jimple stuff, people need an understanding of the
stuff that's in there, why it's in there, and how it fits together.
Perhaps now would be a good time to carefully document it so that there
is at least some way for people to find out the implications of those
phases on each other.
> REQUEST
> =======
>
> Please let me know how I can get the jimple produced by
>
> PackManager.v().getTransform( "jb.ls" ).apply( b );
>
> just before calling the typing algorithm.
You'd have to turn off all the phases in the jb pack after jb.ls.
So, it would be
-p jb.a off
-p jb.ule off
-p jb.tr off
-p jb.ulp off
-p jb.lns off
-p jb.cp off
-p jb.dae off
-p jb.cp-ule off
-p jb.lp off
-p jb.ne off
-p jb.uce off
You'd also have to remove the bug mentioned above which checks whether
typing succeeded even when typing is turned off.
Ondrej
>
> Thanks.
>
> Etienne
>
>
>
>
> Etienne Gagnon wrote:
> > Ondrej, what are the soot options to get the following:
> >
> > I would like to get a .jimple dump of the code as handed to the typing
> > algorithm.
> > (no optimization applied, just splitting according to used-def chains.)
> >
> > The following does not work...
> >
> > java soot.Main --app --soot-class-path /usr/lib/sablevm/classes-1.0.9:.
> > -f jimple -p jb.tr enabled:false Test1
> >
> > Etienne
> >
>
>
> --
> Etienne M. Gagnon, Ph.D. http://www.info.uqam.ca/~egagnon/
> SableVM: http://www.sablevm.org/
> SableCC: http://www.sablecc.org/
>