[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Side-effects
On Fri, Jun 18, 2004 at 10:03:11AM +0200, Helge Jensen wrote:
> For my BTA, I will need a side-effects analysis for methods.
>
> The requirements for the analysis is that it should output a set of
> locations read and written foreach method, preferably as a function of
> the points-to sets of it's arguments and staticly read "globals", but
> less precision is also acceptable.
>
> The analysis in SideEffectAnalysis.java seems to be (after some
> code-reading and experimentation) unsuitable.
>
> It does not return points-to sets as it's output, but rather RWSets,
> which are basically Sets of SootFields, which I cannot (possibly because
> of my limited knowledge of the points-to analysis and soot) relate to
> points-to-sets.
RWSets are not just sets of SootFields. They are sets of pairs
(SootField, PointsToSet), indicating that the given SootField of all
objects in PointsToSet may be read/written.
> It also seems to be monovariant in the call-site functions arguments,
> "lub'ing" the side-effects of all invocations of the function.
Yes, this is true, and I understand that it may make the analysis
unsuitable for your application.
> For example, assigning it assigns the same RWSets to the readSet and
> writeSet of the lines:
>
> Object x1 = rwarg_rec(sft1);
> Object x2 = rwarg_rec(sft2);
>
> In the attached test-program.
>
> Any input on what direction to go in is welcome. Ultimatly, I guess I
> would have to implement a side-effect analysis myself, but this problem
> must have happened to others?
In the past, most people have used Soot only for intraprocedural
analysis. The interprocedural stuff is more recent, and hasn't been used
as much. I'm not aware of any other side-effect analyses that have been
written fro Soot.
Ondrej
> If the SideEffectAnalysis does provide the information I'm requesting,
> how would I get that information?
>
> For example, from the information that calling warg(sft), an SFT.o field
> is writted to, how would i go about extracting the information on
> whether it was sft.o? would my only option be to regard all SFT.o fields
> as one location?
>
>
> --
> Helge