|
[14 Oct]
Side-effect analysis and our must-alias analysis are related. In other words, must analysis also finds side-effects. I am wondering if the way I have currently implemented must analysis give more precise information than the normal side-effect analysis. In our dataflow, there are sets of variables, representing must alias sets at that point, and edges labeled with field names that connect these sets. If there is a field edge labeled f from set containing local variable a to the set containing b, it is read as: at that program point, a's f value "must" point-to b. With that interpretation, if a statement (it can be either x.f =.. or a method call) "may write-to" a.f, then if there is an edge from the set containing a to another before the statement, the link must be broken after it. So our analysis can answer questions like "can this stmt write to a.f?". This is also answered by side-effect analysis. In fact, I can use the side-effect analysis to modify our dataflow set across stmts. Although I use it while processing stmts like x.f = .., for method calls I follow a different approach. I analyze the methods in pseudo-topological order (ie first callee then caller). For each method, I calculate the summary information that captures the effect of method execution on dataflow that hold at the entry of the method using dummies. So inside the caller, when I process the call statement, I use the summary info of callee to update the dataflow facts that hold before the statement. I think the above way of handling method calls give more precise result. Because it is flow-sensitive (this may not help), calling-context sensitive and is also probably object-sensitive. Last modified 13 October 2004 at 11:45 pm by Saswat Anand |