[Soot-list] How to deal with "Return" using wjop.si from SOOT?

Zhoulai zell08v at orange.fr
Wed May 22 10:19:05 EDT 2013


Hi, Patrick,

Thank you. I will look at his implementation. But the source of the
problem, as I found just now, should be due to the optimization of SOOT
that removes my call statement 'x = foo()' because this statement is never
used again.

If we add a statement that uses 'x', the value 0 from foo() will be
inlined.

In conclusion, SOOT inlines 'return', but if the invoke statement is
removed during the optimsation phase,  of course we cannot see the the
inlined code.

Zhoulai



On Wed, May 22, 2013 at 3:56 PM, Patrick Lam <plam at sable.mcgill.ca> wrote:

> Have you looked at the implementation of StaticInliner to see what it does?
>
> pat
>
> On 05/22/13 09:49, Zhoulai wrote:
> > I guess it might help to put the code after inlining here. It can be
> > seen that the statement 'return 0' from foo() is abandonned by the
> > analysis; I was using this command line:
> > java -Xmx4096m soot.Main -f J -cp target/classes/ -pp -w -W -f J -p
> > wjop.si <http://wjop.si> on  tester.Test12 -d sootOutput_inline
> >
> > public class tester.Test12 extends java.lang.Object
> > {
> >
> >      public void <init>()
> >      {
> >          tester.Test12 r0;
> >
> >          r0 := @this: tester.Test12;
> >          specialinvoke r0.<java.lang.Object: void <init>()>();
> >          return;
> >      }
> >
> >      public static void main(java.lang.String[])
> >      {
> >          java.lang.String[] r0;
> >
> >          r0 := @parameter0: java.lang.String[];
> >          return;
> >      }
> >
> >      public static int foo()
> >      {
> >          return 0;
> >      }
> > }
> >
> > On Wed, May 22, 2013 at 11:39 AM, Zhoulai <zell08v at orange.fr
> > <mailto:zell08v at orange.fr>> wrote:
> >
> >     Hi, all,
> >
> >     I have a naive question on how to deal with "RETURN" with the the
> >     wjop.si <http://wjop.si> optimisation from Soot. Typically, I want
> >     to verify the value of 'x' is zero after we call x = foo(); with '
> >     foo' being a method that returns 0.
> >
> >       Below is a running example. I think it is possible to do this with
> >     a simple intra-procedural value analysis (say, interval analysis)
> >     plus an inlining. However, I find out the "inlining" from wjop phase
> >     ignores 'return' (Probably this is not related with SOOT itself).
> >
> >     My question is :
> >
> >       whether SOOT already has some code transformation phase so that,
> >     for example, 'return a' will modify an artificial instance variable
> >     _a, which can then be captured by SOOT's inlining?
> >
> >     Thank you. Below is the example code.
> >
> >     Zhoulai
> >
> >     public class Test12 {
> >           public static void main(String[] args) {
> >               int x;
> >               x = foo();;
> >           }
> >
> >     public  static int foo() {
> >          return 0;
> >
> >          }
> >     }
> >
> >
> >
> >
> >
> >
> >
> > _______________________________________________
> > Soot-list mailing list
> > Soot-list at sable.mcgill.ca
> > http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20130522/1e6a5606/attachment-0001.html 


More information about the Soot-list mailing list