[Soot-list] Getting grimp aggregation from jimple

Patrick LAM plam at sable.mcgill.ca
Sun Nov 21 11:30:19 EST 2004


On Sat, 20 Nov 2004, Archie Cobbs wrote:

> 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.

That's right.

> 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?

For Jimple, these two approaches are equivalent, since there's at most one
interesting Value object per Jimple statement.  Putting tags on statements
might simplify some of the analyses.  For Grimp, you clearly need to
associate the Tags with the Value objects themselves.  So maybe when
you're transferring the tags, move them from the Stmt to the Value...

> 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)

It seems like it should be sound to have a pass which moves tags from
Values to Stmts, and then to preserve tags on values when converting to
Grimp.

Grimp also does some peephole optimizations when generting bytecode (to
handle the ++ construct), so that what you see isn't quite what you get.
Just be aware of that.

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

It sounds acceptable to me, as long as you don't make the Tags always be
associated with Values rather than Stmts.

pat




More information about the Soot-list mailing list