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

Zhoulai zell08v at orange.fr
Fri Jan 11 03:59:35 EST 2013


Hello, Eric.

I was inlining a static method. So it should be Ok to be inlined, right?

Zhoulai


On Fri, Jan 11, 2013 at 9:45 AM, Eric Bodden <eric.bodden at ec-spride.de>wrote:
>
>> Hello.
>>
>> Are you sure that all the inlining criteria are met?
>>
>> Eric
>>
>> On 11 January 2013 09:13, Zhoulai <zell08v at orange.fr> wrote:
>> > 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:
>> >
>> > finds call sites which are monomorphic;
>> > checks whether the call sites can be safely inlined. The inlining
>> criteria
>> > are listed in Vijay Sundaresan's Master's thesis;
>> > 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
>> >
>> >
>> >
>> > _______________________________________________
>> > Soot-list mailing list
>> > Soot-list at sable.mcgill.ca
>> > http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>> >
>>
>>
>>
>> --
>> Eric Bodden, Ph.D., http://sse.ec-spride.de/ http://bodden.de/
>> Head of Secure Software Engineering Group at EC SPRIDE
>> Tel: +49 6151 16-75422    Fax: +49 6151 16-72051
>> Room 3.2.14, Mornewegstr. 30, 64293 Darmstadt
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20130111/5ebf56dc/attachment.html 


More information about the Soot-list mailing list