[Soot-list] JimpleBody vs BafBody

Fernando Calheiros xfernando at gmail.com
Mon Apr 5 21:09:24 EDT 2010


Hi there, I'm developing a few soot transformations that require
method inlining, so I'm extending the class BodyTransformer to perform
the transformation. I'm using InlineSafetyManager.ensureInlinability()
to check if it's safe to inline a method at its invocation site, and
SiteInliner.inlineSite() to perform the actual inlining.

I'm having some problems because some methods active bodies are being
BafBody and not JimpleBody (SiteInliner only works with JimpleBody).
I'm adding my transformations to the jtp pack, so I assumed that
everything would be represented as Jimple, but some methods are being
represented as BafBody, is there any explanation for this behavior?

Or at least a way to convert from one to another?

Some information: soot is recieving classfiles as input, with the
following options: -allow-phantom-refs -app.

I'm adding my optimizations like this:

		PackManager.v().getPack("jtp").add(
				new Transform("jtp.fii", FieldinitInliner.v()), "jtp.uaor");
		PackManager.v().getPack("jtp").insertAfter(
				new Transform("jtp.ii", InitInliner.v()), "jtp.fii");

I read that the jtp pack is empty by default, so only my
transformations should be there. Any ideas on why I'm getting BafBody
instead of JimpleBody for some methods? Oh, and another thing, the
methods that have BafBody are usually very small, normally containing
only one return statement.

Thanks in advance,
Fernando Calheiros


More information about the Soot-list mailing list