Venkatesh Prasad Ranganath <vranganath@cox.net> wrote:
Is there a canonical form of Jimple? Say, can one be ensured that
if a class is represented as Jimple in two different runs in which
the same options were used (no analysis or transformations will be
applied) then the Jimple representation will be "alike"? Given a
Stmt object can one be assured that the order of the children will
be same in two different runs? The Stmt object will be at a
distance of n statements from the start of method in the method
bodies in both the runs.
Personally I wouldn't say there is a "canonical" form per se, in that
we don't have rigid guarantees on what the final Jimple will look like
although the structure is largely determined by the bytecode. (I'm
sure someone else can confirm/deny/elaborate.)
However, the original authors of Soot went to great pains to ensure
that the output is *deterministic*. So you can be reasonably
confident that you should get the same Jimple output, all else being
equal.
Perhaps it would help if you can give a concrete example of what you
are trying to do...