正在加载图片...
ot∈N0root→o:∈Eoi∽or (oroot0t,[]if o:=ot then heapCtrSelector([],0:)=[] [HCTX-INIT] c:(rep,c)05→o,∈Eo:o40≠o4 HCTx-DIv] rep'=true,c'=c ifep∧0j<o4① oi:(rep',c) rep'=0j3o,c'=c+oj if rep A Yoi ② rep'rep,c'=c otherwise if oi o then heapCtxSelector(c++oj,oi)=c' 0:(rep,c〉0→o:∈Eo:wo40j=oa -[HcTx-Cyc] (rep,c) ∫ep'=true,c=ct+oj,if repA Yo:③ rep'=true,d=c. otherwise if oi ot then heapCtzSelector(c++oj,0i)=c heapCtzSelector(_,0i)=c c'=c++oi [McTx] mtdCtxSelector(c,oi)=c Fig.8:Rules for context selection in an OAG,G=(N,E).is a concatenation operator. Figure 8 gives the rules for computing two context selectors,heapCtrSelector and mtdCtrSelector,used in refining an object-sensitive pointer analysis in Fig.11 In heapCtrSelector(c,oi)=c,c denotes an (abstract calling)context of the method that made the allocation of object o;and c'is the heap context selected for o;when oi is allocated in the method with context c.In mtdCirSelector(c,oi)- c',c denotes a heap context of object oi,and c'is the method context selected for the method whose receiver object is o;under its heap context c. For k-obj [24,29],both context selectors are simple.In the case of full- object-sensitivity,we have heapCirSelector([o1,...,on-1],on)=[o1,...,on-1]and mtdCtrSelector([o1,...,on-1],on)=[01,...,on]for every path from oroot to a node on in the OAG,Oroot→o1→.→on-1→on.For ak-object-.sensitive analy- sis with a (k-1)-context-sensitive heap,heapCtrSelector([on-k,...on-1],on)= [on-k+1;...,on-1]and mtdCtrSelector([on-k+1,...,on-1],on)=[on-k+1;...,on]. Essentially,a suffix of length of k is selected from oroot01 ...-on-1-on,resulting in potentially many redundant Oroot context elements to be used blindly. Let us first use an OAG in Fig.9 to explain how we avoid redundant context elements selected by k-obj.The set of con- texts for a given node,denoted ot,can be seen as the set of paths reaching ot from oroot.Instead of using all the nodes on a path to distinguish it from the other four,we use only the five representative nodes,labeled by 1-5,and identify the five paths uniquely as①→③,①→④,②→③,②→④,and 5.The other six nodes are redundant with respect to ot.The rules in Fig.8 are used to identify such representative nodes Fig.9:An OAGot ∈ N oroot → oi ∈ E oi ot o t i : horoot ≺ot, [ ]i if oi = ot then heapCtxSelector([ ], oi) = [ ] [Hctx-Init] o t j :hrep, ci oj → oi ∈ E oi ot oj 6= ot o t i :hrep0 , c0 i    rep0 = true, c0 = c if ¬rep ∧ oj ≺ot 1 rep0 = oj ≺ot, c0 = c ++ oj if rep ∧ goi 2 rep0 = rep, c0 = c otherwise if oi = ot then heapCtxSelector(c ++ oj , oi) = c 0 [Hctx-Div] o t j :hrep, ci oj → oi ∈ E oi ot oj = ot o t i :hrep0 , c0 i  rep0 = true, c0 = c ++ oj , if rep ∧ goi 3 rep0 = true, c0 = c, otherwise if oi = ot then heapCtxSelector(c ++ oj , oi) = c 0 [Hctx-Cyc] heapCtxSelector( , oi) = c c0 = c ++ oi mtdCtxSelector(c, oi) = c 0 [Mctx] Fig. 8: Rules for context selection in an OAG, G=(N, E). ++ is a concatenation operator. Figure 8 gives the rules for computing two context selectors, heapCtxSelector and mtdCtxSelector, used in refining an object-sensitive pointer analysis in Fig. 11. In heapCtxSelector(c, oi) = c 0 , c denotes an (abstract calling) context of the method that made the allocation of object oi and c 0 is the heap context selected for oi when oi is allocated in the method with context c. In mtdCtxSelector(c, oi) = c 0 , c denotes a heap context of object oi , and c 0 is the method context selected for the method whose receiver object is oi under its heap context c. For k-obj [24, 29], both context selectors are simple. In the case of full￾object-sensitivity, we have heapCtxSelector([o1, ..., on−1], on) = [o1, ..., on−1] and mtdCtxSelector([o1, ..., on−1], on) = [o1, ..., on] for every path from oroot to a node on in the OAG, oroot → o1 → ... → on−1 → on. For a k-object-sensitive analy￾sis with a (k − 1)-context-sensitive heap, heapCtxSelector([on−k, ..., on−1], on) = [on−k+1, ..., on−1] and mtdCtxSelector([on−k+1, ..., on−1], on) = [on−k+1, ..., on]. 1 2 3 4 5 Ot Oroot Fig. 9: An OAG. Essentially, a suffix of length of k is selected from oroot → o1 → ... → on−1 → on, resulting in potentially many redundant context elements to be used blindly. Let us first use an OAG in Fig. 9 to explain how we avoid redundant context elements selected by k-obj. The set of con￾texts for a given node, denoted ot, can be seen as the set of paths reaching ot from oroot. Instead of using all the nodes on a path to distinguish it from the other four, we use only the five representative nodes, labeled by 1 – 5, and identify the five paths uniquely as 1 → 3 , 1 → 4 , 2 → 3 , 2 → 4 , and 5 . The other six nodes are redundant with respect to ot. The rules in Fig. 8 are used to identify such representative nodes
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有