Java Reference
In-Depth Information
Live
Stop
A
Live
Live
B
Not Live
Live
C
D
Not Live
Not Live
E
F
v = 1
v = 2
Live
Live
Live
G
Live
H
Live
J
call f(v)
Live
K
Live
Not Live
Live
Live
L
x = v
Not Live
Not Live
M
Start
v = 3
Figure 14.44: Solution for liveness of v .
The solution for liveness of v is shown in Figure 14.44. Note that the control
flow edges are reversed to show how the computation is performed. Based
on the definition of this problem, common points of control flow cause v to be
live if any future behavior shows v to be live. For example, disparate solutions
are combined with v live on input to (the bottom of) node B in Figure 14.44.
It would be advantageous for an optimizing compiler to show that a vari-
able is dead. Any resources associated with a dead variable can be reclaimed
by the compiler, including the variable's register or local JVM slot. Another
use of live variables analysis is to find potentially uninitialized variables .
Such variables are live at the Entry of a procedure.
An optimizing compiler may seek liveness information for one variable or
for a set of variables. Exercise 36 considers the computation for a set.
 
 
Search WWH ::




Custom Search