[Soot-list] Adding new output format to soot?

Ulrik Pagh Schultz ups at mip.sdu.dk
Mon Nov 14 06:04:28 EST 2005


   hi,

I'm starting a project with a student on a Java to C compiler for  
embedded systems, and we are considering using soot as part of this  
project.  We need optimizations like dead-code elimination and  
devirtualization, and would also like to use 3-address code (jimple  
seems fine) rather than the standard stack-based representation.

We've played a bit with soot from the command line, but we're still  
not convinced if it's the right tool for the job.  So if someone has  
an opinion on whether the following seems feasible and maybe even has  
a few pointers on how to get started with adding a new output format  
to soot, we would very much appreciate it.

We imagine starting with jimple, and want to make use of annotations  
indicating e.g. unused methods to avoid including them in the output  
program.  We would also want type information to eliminate virtual  
dispatches (we would rather avoid inlining and method duplication in  
general, since we are interested in saving space, and hence want to  
avoid code duplication) etc.  To generate C code, we basically need  
to traverse the annotated jimple AST collecting information and  
generating code.  (This project is for an MS, so the more time we can  
save by not having to create a whole compiler infrastructure, the  
better.)

An alternative to integrating directly with soot would be to use the  
XML output format and then build our own framework independently of  
soot, but this would probably be a larger effort and more importantly  
it's hard to tell whether all annotations can be included in the XML  
output?

So: any opinions on the amount of work required and any hints as to  
where to start in the framework?

  thanks,
   Ulrik & Martin

--
Ulrik Pagh Schultz, associate professor, University of Southern Denmark
ups at mip.sdu.dk - http://www.mip.sdu.dk/people/Staff/ups.html





More information about the Soot-list mailing list