[Soot-list] how to optimize with soot

Patrick LAM plam at sable.mcgill.ca
Thu Oct 20 15:38:02 EDT 2005


Eric Bodden wrote:

>>>I was searching the internet for some java bytecode optimizer
>>>program, when I found soot. I tried it with the attached (compiled)
>>>class file using the following command line:
>>>
>>>$ java -classpath
>>>jasminclasses-2.2.2.jar:sootclasses-2.2.2.jar:polyglotclasses-1.3.2.jar
>>>soot.Main -d out -process-dir in -cp
>>>in:/usr/java/j2sdk1.4.2/jre/lib/rt.jar -O
>

> Inlining is usually something which is not done on the bytecode level but
> ratehr by the just in time compiler, because this can decide far better at
> runtime what would be efficient to inline. So I am not sure, if there is a
> builtin transformation that would allow you to inline the code as you
> suggested. Actually I don't think so, because when doing so you may change
> the program semantics (some third party may rely on setField(..) getting
> called and for instance subclass A to add functionality etc.).

If you give the -W option, then Soot assumes that you give it the whole
program, and it will then inline, I think.  You might need to specify a
phase option as well, check the phase options documentation.

pat





More information about the Soot-list mailing list