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

Re: Whole-Jimple Post-Transformation pack



> We are using Soot to translate Java to the language of our static analysis
> tool
> TVLA.
> Our problem is that we need a whole scene transformer that operates _after_
> all
> other transformations have finished.
> (Unfortunately, the current situation lets us add our transformation to
> either
> one of the Whole-Jimple packs, which apply before other optimization packs
> [jtp, jop, jap], or to a body transformation, which is not adequate for our
> needs.)

When Soot first started, it was an intra-procedural framework only, with
the main loop something like this:

for each class c
    for each transformation t
        perform t on c

At that point, the nesting of the loops could have been interchanged,
but the nesting above was more efficient when working on many classes,
since all the intermediate results from transformations could be thrown
away in between classes.

Over time, whole-program analyses and transformations have crept in, for
which the above loop nesting doesn't work (you need to have the
transformations as the outer loop, since the whole-program
trasformations do not function on specific classes but on all classes at
once). As a result, the order in which things run became quite messy.

When working on Soot 2.0 a year ago, there was a proposal to switch the
nesting of the two loops, making things much simpler, but making Soot
wasteful of memory when run in intra-procedural mode on a large number
of classes. At the time, we were unable to reach agreement about this
tradeoff, so we kept the old loop nesting, and only cleaned things up
superficially.

Since then, some new code, such as the interprocedural tags added for
Eclipse, has required more whole-program phase-like things to be added,
and various Soot users have expressed the need to add whole-program
phases. Perhaps now is a good time to revisit that proposal to switch
the nesting of those loops, and clean this all up once and for all.

Ondrej