Information Technology Reference
In-Depth Information
Algorithm 2. isLocalObject( m , O )
1: Set staticObject newObjects ;
2: for all stmt ∈ m do
3: if stmt is a new statement then
4: create a new static object O i ;
5: newObjects := newObjects ∪{O i } ;
6: end if
7: end for
8: for all O j ∈ newObjects do
9: if O j must-alias O then
10: return true ;
11: end if
12: end for
13: return false ;
Besides identifying local objects , for a configuration, we also need to know
whether it is gotten by statically modeling the multiple consecutive invocations
of the analyzed method in forward or backward analysis. Same as the first op-
timization, we also extend the original configuration tuple to a triple ( Q,b,R ),
where R is true if the current configuration is indeed gotten by statically mod-
eling the multiple consecutive invocations of the analyzed method.
For a given method m , the intra-procedural control-flows cannot lead to the
multiple consecutive invocations of m . Hence, the shadows in methods cannot
change the value of R . Figure 4 visualizes four types of possible inter-procedural
control-flows ( solid arrows) of m [7]. Solid arrows (1) and (2) are used to model
the transitively recursive method calls to m . We cannot determine that a method
call must be transitively recursive at compile-time. Hence, both of the arrows
(3a) and (3b) are used to model the non-recursive method calls within m . Addi-
tionally, method m can re-executes again after its returning. Arrows (4) is used to
model this case. Obviously, there are only three types of inter-procedural control
flows ( solid arrows (1), (2) and (4)) in Figure 4, which can lead to the multiple
consecutive invocations of the method m . Therefore, in forward analysis, for all
the configurations that reach the entry statements of m or the recursive call
sites within m along these inter-procedural control flows, we should assign true
to R in these configurations. Based on the same argument, in backward analysis,
the value of R in configurations, which reach the exit statements of m or the
recursive call sites within m along these reverse inter-procedural control flows,
should be assigned true . Furthermore, for each initial configuration, the value of
R is set to false in both forward and backward analysis.
Based on Algorithm 2 and the extended configuration, we can filter interferen-
tial configurations as follows: for a given shadow s , which is usually a method call
statement, inside a method, if there exists a variable v in the variable bindings of
s pointing to a local object , a configuration ( Q,b,R )in source ( s )or futures ( s )
can be safely eliminated if R is true . The reason is: even if the shadow s and the
configuration have a same static variable binding with respect to the variable
 
Search WWH ::




Custom Search