[Soot-list] Problem with inline expansion using wjop etc

Zhoulai zell08v at orange.fr
Fri Jan 11 03:13:58 EST 2013


Hello,

I have a naive question about inline expansion using wjop

I learned from this page
http://www.sable.mcgill.ca/soot/tutorial/devirt/index.html

that

StaticInliner (phase wjop.si) does the following:

   1. finds call sites which are monomorphic;
   2. checks whether the call sites can be safely inlined. The inlining
   criteria are listed in Vijay Sundaresan's Master's
thesis<http://www.sable.mcgill.ca/publications/#vijayMastersThesis>;

   3. if the call site is safe to inline, inlines the body of the target
   into that of the caller.


So, I am trying the inlining functionality for a toy program

package trySomething;

public class TryInliner {

    public static void main(String[] args) {
        foo();
    }
    static void foo(){
        int x=0;
        x =4;
    }
}

I suppose the inlining would copy the static method 'foo' into 'main'.

But proabably due to my wrong manipulations, the inlining does not work as
I expected. Actually, in the 'main' method of  the transformed jimple
file,  the body of the static  'foo' is not inlined.

Could you pls tell me where am I wrong? Thank you . I am using this command
from Shell

java -Xmx4096m soot.Main -pp -cp $CLASSPAth::src/test/java/ -w -f  J -p
wjop.si enabled:true -p wjop.smb enabled:true trySomething.TryInliner

Here is my transformed jimple file.
------------------------------------------
public class trySomething.TryInliner extends java.lang.Object
{

    public static void main(java.lang.String[])
    {
        java.lang.String[] args;

        args := @parameter0: java.lang.String[];
        staticinvoke <trySomething.TryInliner: void foo()>();
        return;
    }

    static void foo()
    {
        int x, temp$0;

        x = 0;
        temp$0 = 4;
        x = temp$0;
        return;
    }

    public void <init>()
    {
        trySomething.TryInliner this;

        this := @this: trySomething.TryInliner;
        specialinvoke this.<java.lang.Object: void <init>()>();
        return;
    }
}
----------------------------------------------


Otherwise,the link to Vijay's thesis is not reachable. Do you have a valid
link for the paper? Thanks.

Zhoulai
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20130111/dc1ca890/attachment-0001.html 


More information about the Soot-list mailing list