- Text
- Exception,
- Analysis,
- Program,
- Expression,
- Handler,
- Versioning,
- Exceptions,
- Programming,
- Locations,
- Continuation,
- Dynamic,
- Restoration,
- Using,
- Purdue,
- University,
- Www.cs.purdue.edu

Dynamic State Restoration Using Versioning ... - Purdue University

18 (1) [if xthen[e1] l1 else[e2] l2 ] l − M(l1)∪M(l2) ⊆ M(l) (2) [try(x,[e1] l1 )] l − M(l1) ⊆ M(l). (3) [restore(x,y)] l − ∀Excpn〈l1〉 ∈ F(x), s.t. [vExn(z)] l1 ∈ P, ∀[λw.[eb] l3 ] l2 ∈ F(z), M(l3) ∈ M(l) (4) [let x = s in[e] l1 ] l if s ≡ c or s ≡ Pr(x1,. ..,xn) or s ≡ λy.e ′ or s ≡ vExn(y) − M(l1) ⊆ M(l). (5) [x1 := x2] l − {x1} ∈ M(l). − if typeOf(x2)=Ptr τ . {x1 +1 } ⊆ A(x2) . {x2 −1 } ⊆ A(x1) (6) [let x1 = !x2 in[e] l1 ] l − M(l1) ⊆ M(l). − if typeOf(x1)=Ptr τ . {x2 +1 } ⊆ A(x1) . {x1 −1 } ⊆ A(x2) (7) [let x1=ref x2 in [e] l1 ] l − M(l1) ⊆ M(l). − if typeOf(x2)=Ptr τ . {x2 −1 } ⊆ A(x1) . {x1 +1 } ⊆ A(x2) (8) [let x1=x0(x3) in [e] l1 ] l − M(l1) ⊆ M(l). − ∀[λx.[e1] l2 ] l3 ∈ F(x0) . M(l2) ⊆ M(l). . if typeOf(x) = Ptr τ Unify(A(x), A(x3)) (a) if x2 ∈ last(e1) and typeOf(x2)=Ptr τ Unify(A(x1), A(x2)) (b) if !x2 ∈ last(e1) and typeOf(x1)=Ptr τ {x2 +1 } ⊆ A(x1) {x1 −1 } ⊆ A(x2). (c) if ref x2 ∈ last(e1) and typeOf(x2)=Ptr τ {x2 −1 } ⊆ A(x1) {x1 +1 } ⊆ A(x2). Figure 10. Constraints for Abstract Def Map and Points-to map. Hence we unify their points-to maps. The procedure Unify(a,b) generates two constraints: a ⊆ b and b ⊆ a. The unification of points-to information between the argument and the formal parameter is essential. Within the function body, these variables effectively serve as aliases for the same location; thus, updates to one must be propagated to the other. Different constraints are generated depending on the members of last(e). For example, if x2 = last(e) is bound to a location, we unify the points-to map for x2 and the map for the result; this allows effects to be propagated bi-directionally between caller and callee. As before, final.tex; 26/05/2005; 13:59; p.18

F(s) = {Excpn〈0〉} F(1) = {Int } F(x1) = {RefExp〈1〉} F(10) = {Int } F(x ′ 1 ) = {RefExp〈1〉} M(14) = {x′ 1 ,p1} F(x2) = {RefExp〈3〉} M(6) = {x ′ 1 } F(x3) = {LamExp〈5〉} U(16) = {x1} F(f) = {LamExp〈12〉} A(x1) = {x2 +1 } F(g) = {LamExp〈5〉} A(x2) = {x1 −1 ,x ′ 1 −1 } F(p1) = {RefExp〈10〉} A(x ′ 1 ) = {x2 +1 } F(p) = {Int } K(15) = {!x1} F(p2) = {Int } F(z) = {Int } Figure 11. Abstract maps for the program shown in Fig. 7. note that we cannot simply establish uni-directional constraints because there is a chance that both x1 and x2 maybe live simultaneously after the alias is created. The constraints generated for the other cases are analogous to the ones for the previous let expressions(6,7). Example revisited In Fig. 11 we show the effect of applying these constraints to the example shown in Fig. 7. We first compute the maps F, U, M and K. We then build the points-to-map A. Consider the map A. A(x1) is {x2 +1 }. This suggests that x1 is pointed-by x2 and hence modifications done to the contents of the location bound to x1 can affect the evaluation of the binding expression for x2. As another example, A(x2) is {x1 −1 ,x ′ 1 −1 }. This suggests that x2 points-to x1 and x ′ 1 through an access of x2 may affect the value of x1 and x ′ 1 . 19 , and hence modifications to the store performed We can interpret the points-to map pictorially as a directed graph can be as shown in Fig. 12. For example, it shows that, x1 and x ′ 1 modified by dereferencing x2 (due to the −1 edges) and modifying x1 or x ′ 1 can affect a variable that is obtained by dereferencing x2 (due to the +1 edges). The graph also gives alias information: From node x1 we can reach node x ′ 1 at cost (−1 + 1 = 0). Hence x1 and x ′ 1 are potential aliases. final.tex; 26/05/2005; 13:59; p.19

- Page 1 and 2: Dynamic State Restoration Using Ver
- Page 3 and 4: in which aborts occur due to the co
- Page 5 and 6: comparison operation fails. For man
- Page 7 and 8: complications to the definition and
- Page 9 and 10: in e1 handle E x => e2 end Unlike o
- Page 11 and 12: 〈x,ρ,k,σ,Σ〉 −→ 〈k,ρ(x
- Page 13 and 14: [let s = vExn(λz.z) in [let x1 = [
- Page 15 and 16: If e ∈ InitF and e is − let x =
- Page 17: For all e l 0 ∈ InitF, if e0 is
- Page 21 and 22: any location v of the store, that n
- Page 23 and 24: let s = vExn(λ z.z) in let f = λ
- Page 25 and 26: ) The alias is created by the prese
- Page 27 and 28: non-revocable actions such as I/O r
- Page 29 and 30: examination of the source text. Ver
- Page 31 and 32: 18. Tim Harris and Keir Fraser Lang