[Soot-list] context sensitive allocation site for specjbb

Eric Bodden eric.bodden at ec-spride.de
Wed Oct 3 08:05:34 EDT 2012


Hi Tony.


> I have a follow-up question: how does TamiFlex handle reflections in
> factory methods?
>
> Here's an example:
>
> Object create(Class c) {
>    return c.newInstance();
> }
>
> A a = (A) create(A.class);
> B b = (B) create(B.class);
>
> What exactly would happen if I use TamiFlex for this sample code? Is
> create() specialized and inlined?

No. On this case you would get two log entries, stating that the
newInstance call within create once instantiates an A object and once
a B object. During its points-to analysis, Soot will then create the
appropriate two allocation nodes for this newInstance-call. In other
words, there is no context-sensitivity involved there if that's what
you are after. If you want any better then your only chance is to
inline such calls before running TamiFlex.

Eric


More information about the Soot-list mailing list