[Soot-list] Problem with the rerun-jb phase option in Static Inliner?

Xing Fang xfang at ecn.purdue.edu
Mon Sep 28 02:19:14 EDT 2009


Hello All,

I seemed to have found a problem with the rerun-jb phase option in the 
static inliner phase, and I wonder if it's a legitimage concern...

In StaticInliner.java, method internalTransform(), the inlining phase
goes over each inlining site and decides if inlining should happen or not.
If it chooses to inline and if the rerun-jb option is turned on, the 
Jimple Body pack is run again after inlining happens.

There seems to be a chance of an inlining site being not valid any more 
after the JB pack is run again. This happens when two (or more) sites 
exist in the same method. An inlining site consists of a target method T, 
an invokeStmt S and a container method C; The invokeStmt S should be 
included in the patchingChain of the body (inlining insertions would 
happen around S). But once inlining has happened at the first site and JB 
is called again, the body of the container changes and it does not include 
S any more. The array sitesToInline is not updated after it's generated, 
so it will still try to inline at this site, which will cause exceptions 
in the HashChain (Insertion point not found in chain / 
NoSuchElementException).

I got such exceptions when I turned inlining on and it seemed like this 
was the most probable cause -- is this a legitimate concern?

Thanks,
Xing


More information about the Soot-list mailing list