[Soot-list] Getting grimp aggregation from jimple

Ondrej Lhotak olhotak at sable.mcgill.ca
Mon Nov 22 11:24:27 EST 2004


On Sat, Nov 20, 2004 at 08:25:42PM -0600, Archie Cobbs wrote:
> Hi,
> 
> I'm looking at the idea of using Grimp aggregated code for JC
> (http://jcvm.sourceforge.net) code generation instead of Jimple
> code. This appears easy to do by simply invoking Grimp.v().newBody()
> after all the other analysis steps.
> 
> However, when I do this, all the annotation tags from the prior
> "jap" phase (e.g., array bounds checks and cast elimination) are
> lost. So now I'm considering the best way to preserve this
> information.
> 
> The first approach I've come up with is simply to copy over the
> tags when creating Grimp Expr's and Stmt's from their Jimple versions.
> However, the array bounds check tags and cast check tags are
> associated with Stmt objects rather than Value objects, so this
> doesn't quite work when you aggregate multiple Jimple statements
> into a single Grimp statement.
> 
> This brings up the first question: wouldn't it be more correct to
> associate "ArrayCheckTag" and "CastCheckTag" tags with Value objects
> (ArrayRef and CastExpr objects, respectively) rather than the
> enclosing Stmt objects?

Yes, it would. The reason this is not so is that the array analyses were
implemented long before tags on values were. I suspect attaching the
tags to values rather than statements would have also simplified the
aggregation stuff which decides which bytecode instruction should get
the tag.

BTW Currently, tags can be attached to ValueBoxes (which I think is what
you want), rather than Values.

> And the second question: suppose I did this, then would carrying
> these tags over into the Grimp equivalents affect their correctness
> in any way? (It doesn't seem like it should)

AFAIK, this shouldn't cause any problems.

> Finally, would such a patch be acceptable to back-port into Soot?

Fine with me.

Ondrej

> 
> Thanks for any advice,
> -Archie
> 
> __________________________________________________________________________
> Archie Cobbs      *        CTO, Awarix        *      http://www.awarix.com
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://www.sable.mcgill.ca/mailman/listinfo/soot-list
> 


More information about the Soot-list mailing list