Information Technology Reference
In-Depth Information
Tabl e 3. The results of analysis time ( in seconds )
Property + Program The 1st optimization The 2nd optimization
NSA Opt Total NSA Opt Total
FailSafeEnum + fop 0.98 0.1 251.14 1.21 0.39 276.87
FailSafeEnum + jython 8.06 0.2 243.55 8.23 1.87 269.35
FailSafeEnumHT + jython 10.30 0.69 240.91 10.41 8.19 271.05
FailSafeIter + bloat 298.05 133.94 806.02 288.50 516.82 1214.12
FailSafeIter + chart 25.35 1.64 305.92 24.15 66.08 393.04
FailSafeIter + jython 16.9 0.74 270.23 17.69 14.87 303.80
FailSafeIter + luindex 2.21 0.07 99.1 2.53 0.47 110.64
FailSafeIter + pmd 46.01 2.51 352.67 46.97 112.01 490.54
FailSafeIterMap + bloat 58.78 30.17 433.4 65.92 85.19 521.37
FailSafeIterMap + jython 49.67 17.61 276.74 58.38 56 337.73
FailSafeIterMap + pmd 77.67 4.25 420.05 77.72 96.84 541.66
Writer + antlr 12.95 0.83 223.76 13.7 9.06 253.48
Writer + bloat 1.56 0.24 128.66 1.68 0.34 140.08
NSA : The analysis time that original NSA consumes. Opt : The analysis time of
the optimized NSA after the original NSA. Total : the total compilation time of the
case.
the optimized NSA with the combination of two optimizations, the analysis time
introduced by optimization is under 2 minutes in the majority of cases. Overall,
our optimization methods do not cause a significant overhead on the weaving
process in experiments. Considering the total compilation time, the overhead
incurred by our optimizations is acceptable.
5.3 Discussions
According to the experimental results, the first optimization only has effects in
17.4% cases, which is not very impressive. The reason is that the optimization
works well on the methods containing several interleaved relevant method invo-
cations on different objects. For example, for the program in Figure 5(a), which
is slightly different from that in Figure 2 (the method calls on c 1 and c 2 are
not interleaved), the original NSA can identify the shadow at line 9 as a “nop
shadow”. Hence, the capability of the optimized NSA is the same as that of the
original one in this case.
The optimization based on local objects also has limitations. For example,
it has no effect on the local objects created within loop statements. In Figure
5(b), we show a method m that extends the method in Figure 3 by adding a
loop. Obviously, the method satisfies the typestate property in Figure 1, but the
optimized NSA by using local object information cannot remove the shadows at
lines 5 and 6. The reason is the forward analysis will propagate the configurations
at the end of a “ for ” statement to the entry of the “ for ” statement, and the
backward analysis will propagate configurations in the inverse direction too.
Search WWH ::




Custom Search