[Soot-list] Shimple -> Continuation Passing Style

J Malcolm malcolm at ece.gatech.edu
Mon Jan 29 22:54:01 EST 2007


Patrick Lam <plam at cs.mcgill.ca> writes:

> You'll need to modify Soot in general to support first-class
> functions.  While one could use anonymous objects as first-class
> functions, that encoding would be quite painful to use.  So you need
> to hack the innards of Soot and add the type, lambda, and application
> in the IR.  Then you need to write a printer, but that's not the hard
> part.

The hope was to not become entangled with the Soot source.  There's not
a way to have it as a separate extending class collection?  I cannot
create my own Lambda body type and then create a transformer from
Shimple to Lambda--all apart from the Soot source tree?

Could you also be more specific what you mean by my having to "add the
type, lambda, and application in the IR"?

>> To keep high fidelity to the original Java program, we hope to have CPS
>> primitives for things such as malloc, pointer dereferencing, etc.
>
> Java doesn't contain pointer dereferencing as such; it has field
> accesses instead.  It also doesn't quite contain malloc.

Not sure how I'll tackle that.  Could you please give me an short
example (Java source and Shimple output) of what you mean so I can be
clear?

> You should consult Raja Vallee-Rai's thesis on Soot in general as well
> as Navindra Umanee's thesis on Shimple.  They are both available at:
>
> http://www.sable.mcgill.ca/publications/thesis/

Excellent.  At first glance through them, they look like great
resources.  As of yet, I had only read the conference papers.

> Take a look at the soot.shimple package in the Soot code.  That gives
> you an idea of what you'd have to do to implement your IR.  Then the
> ShimpleTransformer converts methods from Jimple to Shimple; you'd want
> to do something similar.

Will do.  You pointing out a starting point like that is a big help.
The code base is huge and the javadoc info is limited--as is always the
case in research projects.

Thanks again for the quick response.  I'd like to get a prototype in the
next two weeks.

-jm


More information about the Soot-list mailing list