[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Which Transformation Pack Should I choose?
Hi,
I've been using the "jtp" pack for transformation on a JimpleBody until
now, but the problem is that when I want to insert something like:
z.value = Math.sin(x.value);
at the Jimple level ("jtp" pack; x.value is a double), I am forced to
use something like this:
$d0 = x.<DerivType: double value>;
$d0 = staticinvoke <java.lang.Math: double sin(double)>($d0);
z.<DerivType: double value> = $d0;
The thing is, I don't want to insert all those temporary double
variables and use 3 statements for just one assignment. I've solved that
by inserting a Grimp statement into the Jimple BodyTransformer that
implements a "jtp.mypahse" phase:
z.<DerivType: double value> = staticinvoke <java.lang.Math: double
sin(double)>(x.<DerivType: double value>);
All good and well, but shouldn't I do this in a "gtp" pack? Because
after all, this is more or less a Grimp transformation. And here is my
problem: there is no "gtp" pack, or at least not yet ;-) What should I
do? Continue like this, with a mix of Grimp and Jimple statements in a
JimpleBody transformer, and then use the -via-grimp flag (like I do
now)? Or should I implement another pack and add it to Soot? Or should I
use the "gop" pack?
I am writing this because I don't know if what I have created for my
transformations is some kind of hybrid representation that will prove to
be incompatible with further releases of Soot, or if this is something
normal (the mix of Grimp and Jimple statements), and I shouldn't think
about it anymore and continue on with my work. Is this an issue that was
encountered before in the Soot project?
Cheers,
Emil