Compare Less, Defer More
Scaling Value-Contexts Based Whole-Program Heap Analyses Manas Thakur and V Krishna Nandivada CC 2019
PA PACE
Programming Languages, Architecture and Compilers Education Laboratory
PA PACE Programming Languages, Architecture and Compilers - - PowerPoint PPT Presentation
Compare Less, Defer More Scaling Value-Contexts Based Whole-Program Heap Analyses Manas Thakur and V Krishna Nandivada CC 2019 PA PACE Programming Languages, Architecture and Compilers Education Laboratory Heap analysis Any analysis that
Scaling Value-Contexts Based Whole-Program Heap Analyses Manas Thakur and V Krishna Nandivada CC 2019
Programming Languages, Architecture and Compilers Education Laboratory
Heap analysis
the runtime heap of a program.
point to which heap locations.
interprocedural control-flow analysis.
1/24
Context-sensitivity
Analyze a method in each different context from which it is called.
2/24
Context-sensitivity
Analyze a method in each different context from which it is called.
Compared to context-insensitive analyses:
2/24
Context-sensitivity
Analyze a method in each different context from which it is called.
Compared to context-insensitive analyses:
2/24
Call-string based context-sensitivity
2. A f1,f2; 3. void foo(){ 4. ... 5. c.bar(a); 6. d.bar(b); 7. } 8. void bar(A p){ 9. A x = new A(); 10. p.f1.f2 = x; 11. p.fb(); 12. p.fb(); 13. } 14. void fb(){...} 15.}
3/24
Call-string based context-sensitivity
2. A f1,f2; 3. void foo(){ 4. ... 5. c.bar(a); 6. d.bar(b); 7. } 8. void bar(A p){ 9. A x = new A(); 10. p.f1.f2 = x; 11. p.fb(); 12. p.fb(); 13. } 14. void fb(){...} 15.}
3/24
Call-string based context-sensitivity
2. A f1,f2; 3. void foo(){ 4. ... 5. c.bar(a); 6. d.bar(b); 7. } 8. void bar(A p){ 9. A x = new A(); 10. p.f1.f2 = x; 11. p.fb(); 12. p.fb(); 13. } 14. void fb(){...} 15.}
3/24
Call-string based context-sensitivity
2. A f1,f2; 3. void foo(){ 4. ... 5. c.bar(a); 6. d.bar(b); 7. } 8. void bar(A p){ 9. A x = new A(); 10. p.f1.f2 = x; 11. p.fb(); 12. p.fb(); 13. } 14. void fb(){...} 15.}
3/24
Value-contexts1
1Uday P. Khedker and Bageshri Karkare. Efficiency, Precision, Simplicity, and
Generality in Interprocedural Data Flow Analysis: Resurrecting the Classical Call Strings Method. CC 2008. 4/24
Value-contexts1
guaranteed.
sacrificing precision.
1Uday P. Khedker and Bageshri Karkare. Efficiency, Precision, Simplicity, and
Generality in Interprocedural Data Flow Analysis: Resurrecting the Classical Call Strings Method. CC 2008. 4/24
Value-contexts: Example
2. A f1,f2; 3. void foo(){ 4. A a,b,c,d;... 5. c.bar(a); 6. d.bar(b); 7. } 8. void bar(A p){ 9. A x = new A(); 10. p.f1.f2 = x; 11. p.fb(); 12. p.fb(); 13. } 14. void fb(){...} 15.}
Points-to graph
Oa Oi Ok Oj Oc Ol
a c f1 f1 f1 f1
Ob
b f1 d
Om...
f2 f2
(Line 5)
5/24
Value-contexts: Example
2. A f1,f2; 3. void foo(){ 4. A a,b,c,d;... 5. c.bar(a); 6. d.bar(b); 7. } 8. void bar(A p){ 9. A x = new A(); 10. p.f1.f2 = x; 11. p.fb(); 12. p.fb(); 13. } 14. void fb(){...} 15.}
Points-to graph
Oa Oi Ok Oj Oc Ol
a c f1 f1 f1 f1
Ob
b f1 d
Om...
f2 f2
(Line 5)
Oa Oi Ok Oj Oc Ol
a c f1 f1 f1 f1
Ob
b f1 d
O9
f2 f2 f2 f2
Om...
(Line 6)
5/24
Value-contexts: Example
2. A f1,f2; 3. void foo(){ 4. A a,b,c,d;... 5. c.bar(a); 6. d.bar(b); 7. } 8. void bar(A p){ 9. A x = new A(); 10. p.f1.f2 = x; 11. p.fb(); 12. p.fb(); 13. } 14. void fb(){...} 15.}
Points-to graph
Oa Oi Ok Oj Oc Ol
a c f1 f1 f1 f1
Ob
b f1 d
Om...
f2 f2
(Line 5)
Oa Oi Ok Oj Oc Ol
a c f1 f1 f1 f1
Ob
b f1 d
O9
f2 f2 f2 f2
Om...
(Line 6)
Value-context
Oa Oi Oj Oc Ol
p this f1 f1 f1 f1 Om...
(Line 5)
5/24
Value-contexts: Example
2. A f1,f2; 3. void foo(){ 4. A a,b,c,d;... 5. c.bar(a); 6. d.bar(b); 7. } 8. void bar(A p){ 9. A x = new A(); 10. p.f1.f2 = x; 11. p.fb(); 12. p.fb(); 13. } 14. void fb(){...} 15.}
Points-to graph
Oa Oi Ok Oj Oc Ol
a c f1 f1 f1 f1
Ob
b f1 d
Om...
f2 f2
(Line 5)
Oa Oi Ok Oj Oc Ol
a c f1 f1 f1 f1
Ob
b f1 d
O9
f2 f2 f2 f2
Om...
(Line 6)
Value-context
Oa Oi Oj Oc Ol
p this f1 f1 f1 f1 Om...
(Line 5)
Ok
f1
Ob
p this f2 f2
Ol
f1
Om...
(Line 6)
5/24
Value-contexts in practice: Escape analysis
escape analysis for widely used Java benchmarks.
6/24
Value-contexts in practice: Escape analysis
escape analysis for widely used Java benchmarks.
6/24
Problem 1: Too much comparison
2. A f1,f2; 3. void foo(){ 4. ... 5. c.bar(a); 6. d.bar(b); 7. } 8. void bar(A p){ 9. A x = new A(); 10. p.f1.f2 = x; 11. p.fb(); 12. p.fb(); 13. } 14. void fb(){...} 15.}
Oa Oi Oj Oc Ol
p this f1 f1 f1 f1 Om...
Ok
f1
Ob
p this f2 f2
Ol
f1
Om...
Graph isomorphism is costly (NP).
7/24
Insight 1: Relevance
2. A f1,f2; 3. void foo(){ 4. ... 5. c.bar(a); 6. d.bar(b); 7. } 8. void bar(A p){ 9. A x = new A(); 10. p.f1.f2 = x; 11. p.fb(); 12. p.fb(); 13. } 14. void fb(){ 15. /*Doesn’t access 16. caller’s heap*/ 17. } 18.}
p.f1 is relevant for bar (rest is not accessed).
8/24
Insight 1: Relevance
2. A f1,f2; 3. void foo(){ 4. ... 5. c.bar(a); 6. d.bar(b); 7. } 8. void bar(A p){ 9. A x = new A(); 10. p.f1.f2 = x; 11. p.fb(); 12. p.fb(); 13. } 14. void fb(){ 15. /*Doesn’t access 16. caller’s heap*/ 17. } 18.}
p.f1 is relevant for bar (rest is not accessed).
Identify and use relevant value-contexts.
8/24
Insight 1: Example
2. A f1,f2; 3. void foo(){ 4. ... 5. c.bar(a); 6. d.bar(b); 7. } 8. void bar(A p){ 9. A x = new A(); 10. p.f1.f2 = x; 11. p.fb(); 12. p.fb(); 13. } 14. void fb(){ 15. /*Doesn’t access 16. caller’s heap*/ 17. } 18.}
from p.f1 is relevant for bar.
Identify and use relevant value-contexts. Line 5:
Oa Oi Oj Oc Ol
p this f1 f1 f1 f1 Om...
Oa Oi Oj
p f1 f1
Value-context Relevant value-context
9/24
Insight 1: Example
2. A f1,f2; 3. void foo(){ 4. ... 5. c.bar(a); 6. d.bar(b); 7. } 8. void bar(A p){ 9. A x = new A(); 10. p.f1.f2 = x; 11. p.fb(); 12. p.fb(); 13. } 14. void fb(){ 15. /*Doesn’t access 16. caller’s heap*/ 17. } 18.}
from p.f1 is relevant for bar.
Identify and use relevant value-contexts. Line 6:
Ok
f1
Ob
p this f2 f2
Ol
f1
Om... Ob Ok Ol
p f1 f1
Value-context Relevant value-context
10/24
Insight 1: Example
2. A f1,f2; 3. void foo(){ 4. ... 5. c.bar(a); 6. d.bar(b); 7. } 8. void bar(A p){ 9. A x = new A(); 10. p.f1.f2 = x; 11. p.fb(); 12. p.fb(); 13. } 14. void fb(){ 15. /*Doesn’t access 16. caller’s heap*/ 17. } 18.}
from p.f1 is relevant for bar.
Identify and use relevant value-contexts. Line 6:
Ok
f1
Ob
p this f2 f2
Ol
f1
Om... Ob Ok Ol
p f1 f1
Value-context Relevant value-context Result: Graphs to be stored/compared significantly smaller.
10/24
Problem 2: Too many contexts
context consumes time and memory.
11/24
Problem 2: Too many contexts
context consumes time and memory.
11/24
Problem 2: Too many contexts
context consumes time and memory.
call-sites.
11/24
Insight 2a: Level-summarization
2. A f1,f2; 3. void foo(){ 4. ... 5. c.bar(a); 6. d.bar(b); 7. } 8. void bar(A p){ 9. A x = new A(); 10. p.f1.f2 = x; 11. p.fb(); 12. p.fb(); 13. } 14. void fb(){ 15. /*Doesn’t access 16. caller’s heap*/ 17. } 18.}
value-context changes, the analysis-result may not be affected.
12/24
Insight 2a: Level-summarization
2. A f1,f2; 3. void foo(){ 4. ... 5. c.bar(a); 6. d.bar(b); 7. } 8. void bar(A p){ 9. A x = new A(); 10. p.f1.f2 = x; 11. p.fb(); 12. p.fb(); 13. } 14. void fb(){ 15. /*Doesn’t access 16. caller’s heap*/ 17. } 18.}
value-context changes, the analysis-result may not be affected.
pointed-to by p or p.f1 escape.
12/24
Insight 2a: Level-summarization
2. A f1,f2; 3. void foo(){ 4. ... 5. c.bar(a); 6. d.bar(b); 7. } 8. void bar(A p){ 9. A x = new A(); 10. p.f1.f2 = x; 11. p.fb(); 12. p.fb(); 13. } 14. void fb(){ 15. /*Doesn’t access 16. caller’s heap*/ 17. } 18.}
value-context changes, the analysis-result may not be affected.
pointed-to by p or p.f1 escape.
level-summarized relevant value (LSRV-) contexts.
12/24
Insight 2a: Example
2. A f1,f2; 3. void foo(){ 4. ... 5. c.bar(a); 6. d.bar(b); 7. } 8. void bar(A p){ 9. A x = new A(); 10. p.f1.f2 = x; 11. p.fb(); 12. p.fb(); 13. } 14. void fb(){ 15. /*Doesn’t access 16. caller’s heap*/ 17. } 18.}
Proposal: Use LSRV-contexts.
13/24
Insight 2a: Example
2. A f1,f2; 3. void foo(){ 4. ... 5. c.bar(a); 6. d.bar(b); 7. } 8. void bar(A p){ 9. A x = new A(); 10. p.f1.f2 = x; 11. p.fb(); 12. p.fb(); 13. } 14. void fb(){ 15. /*Doesn’t access 16. caller’s heap*/ 17. } 18.}
Proposal: Use LSRV-contexts. Line 5:
Oa Oi Oj
p f1 f1 f1 p D (level 1) D (level 2)
Relevant value-context LSRV-context
13/24
Insight 2a: Example
2. A f1,f2; 3. void foo(){ 4. ... 5. c.bar(a); 6. d.bar(b); 7. } 8. void bar(A p){ 9. A x = new A(); 10. p.f1.f2 = x; 11. p.fb(); 12. p.fb(); 13. } 14. void fb(){ 15. /*Doesn’t access 16. caller’s heap*/ 17. } 18.}
Proposal: Use LSRV-contexts. Line 5:
Oa Oi Oj
p f1 f1 f1 p D (level 1) D (level 2)
Relevant value-context LSRV-context Line 6:
Ob Ok Ol
p f1 f1 f1 p D (level 1) D (level 2)
Relevant value-context LSRV-context
13/24
Insight 2a: Example
2. A f1,f2; 3. void foo(){ 4. ... 5. c.bar(a); 6. d.bar(b); 7. } 8. void bar(A p){ 9. A x = new A(); 10. p.f1.f2 = x; 11. p.fb(); 12. p.fb(); 13. } 14. void fb(){ 15. /*Doesn’t access 16. caller’s heap*/ 17. } 18.}
Proposal: Use LSRV-contexts. Line 5:
Oa Oi Oj
p f1 f1 f1 p D (level 1) D (level 2)
Relevant value-context LSRV-context Line 6:
Ob Ok Ol
p f1 f1 f1 p D (level 1) D (level 2)
Relevant value-context LSRV-context Result: bar analyzed only once!
13/24
Insight 2b: Caller-ignorable
2. A f1,f2; 3. void foo(){ 4. ... 5. c.bar(a); 6. d.bar(b); 7. } 8. void bar(A p){ 9. A x = new A(); 10. p.f1.f2 = x; 11. p.fb(); 12. p.fb(); 13. } 14. void fb(){ 15. /*Doesn’t access 16. caller’s heap*/ 17. } 18.}
14/24
Insight 2b: Caller-ignorable
2. A f1,f2; 3. void foo(){ 4. ... 5. c.bar(a); 6. d.bar(b); 7. } 8. void bar(A p){ 9. A x = new A(); 10. p.f1.f2 = x; 11. p.fb(); 12. p.fb(); 13. } 14. void fb(){ 15. /*Doesn’t access 16. caller’s heap*/ 17. } 18.}
Defer the analysis of caller-ignorable methods, and analyze them context-sensitively in a post-pass.
14/24
Insight 2b: Caller-ignorable
2. A f1,f2; 3. void foo(){ 4. ... 5. c.bar(a); 6. d.bar(b); 7. } 8. void bar(A p){ 9. A x = new A(); 10. p.f1.f2 = x; 11. p.fb(); 12. p.fb(); 13. } 14. void fb(){ 15. /*Doesn’t access 16. caller’s heap*/ 17. } 18.}
Defer the analysis of caller-ignorable methods, and analyze them context-sensitively in a post-pass.
Time and memory saved during the costly whole-program analysis.
14/24
Proposed approach
Pre- analysis Java program Main- analysis Post- analysis Deferred methods +Partial results Access depths Final results 15/24
Proposed approach
Pre- analysis Java program Main- analysis Post- analysis Deferred methods +Partial results Access depths Final results
15/24
Proposed approach
Pre- analysis Java program Main- analysis Post- analysis Deferred methods +Partial results Access depths Final results
15/24
Proposed approach
Pre- analysis Java program Main- analysis Post- analysis Deferred methods +Partial results Access depths Final results
15/24
Proposed approach
Pre- analysis Java program Main- analysis Post- analysis Deferred methods +Partial results Access depths Final results
Detailed algorithms in the paper.
15/24
Instantiations
16/24
Experimental setup
17/24
Versions compared
2(Value-contexts implementation of) John Whaley and Martin Rinard.
Compositional Pointer and Escape Analysis for Java Programs. OOPSLA 1999.
3Rohan Padhye and Uday P. Khedker. Interprocedural Data Flow Analysis in Soot
Using Value Contexts. SOAP 2013. 18/24
Versions compared
2(Value-contexts implementation of) John Whaley and Martin Rinard.
Compositional Pointer and Escape Analysis for Java Programs. OOPSLA 1999.
3Rohan Padhye and Uday P. Khedker. Interprocedural Data Flow Analysis in Soot
Using Value Contexts. SOAP 2013. 18/24
Versions compared
2(Value-contexts implementation of) John Whaley and Martin Rinard.
Compositional Pointer and Escape Analysis for Java Programs. OOPSLA 1999.
3Rohan Padhye and Uday P. Khedker. Interprocedural Data Flow Analysis in Soot
Using Value Contexts. SOAP 2013. 18/24
Versions compared
2(Value-contexts implementation of) John Whaley and Martin Rinard.
Compositional Pointer and Escape Analysis for Java Programs. OOPSLA 1999.
3Rohan Padhye and Uday P. Khedker. Interprocedural Data Flow Analysis in Soot
Using Value Contexts. SOAP 2013. 18/24
Analysis time: Escape analysis
603 3485 204 343 178 183 531 183 1479 267 225 1722 2275 70 87 55 57 157 54 486 192 1 10 100 1000 10000 a v r
a b a t i k e c l i p s e l u i n d e x l u s e a r c h m
d y n m
t e c a r l
m d r a y t r a c e r s u n f l
g e
e a n Time (seconds) Be OMe PMe PMPe
and Post
19/24
Analysis time: Escape analysis
603 3485 204 343 178 183 531 183 1479 267 225 1722 2275 70 87 55 57 157 54 486 192 1 10 100 1000 10000 a v r
a b a t i k e c l i p s e l u i n d e x l u s e a r c h m
d y n m
t e c a r l
m d r a y t r a c e r s u n f l
g e
e a n Time (seconds) Be OMe PMe PMPe
and Post
19/24
Analysis time: Escape analysis
603 3485 204 343 178 183 531 183 1479 267 225 1722 2275 70 87 55 57 157 54 486 192 1 10 100 1000 10000 a v r
a b a t i k e c l i p s e l u i n d e x l u s e a r c h m
d y n m
t e c a r l
m d r a y t r a c e r s u n f l
g e
e a n Time (seconds) Be OMe PMe PMPe
and Post
benchmarks (average ∼28% over PMe).
19/24
Analysis time: Control-flow analysis
71 1033 1312 60 58 55 61 130 62 692 151 55 946 988 46 57 53 53 108 53 684 131 1322 1175 1215 929 925 5769 940 1364 231 213 591 222 238 2036 211 351 1 10 100 1000 10000 a v r
a b a t i k e c l i p s e l u i n d e x l u s e a r c h m
d y n m
t e c a r l
m d r a y t r a c e r s u n f l
g e
e a n Time (seconds) Bc OMc PMc PMPc
and Post
20/24
Analysis time: Control-flow analysis
71 1033 1312 60 58 55 61 130 62 692 151 55 946 988 46 57 53 53 108 53 684 131 1322 1175 1215 929 925 5769 940 1364 231 213 591 222 238 2036 211 351 1 10 100 1000 10000 a v r
a b a t i k e c l i p s e l u i n d e x l u s e a r c h m
d y n m
t e c a r l
m d r a y t r a c e r s u n f l
g e
e a n Time (seconds) Bc OMc PMc PMPc
and Post
20/24
Analysis time: Control-flow analysis
71 1033 1312 60 58 55 61 130 62 692 151 55 946 988 46 57 53 53 108 53 684 131 1322 1175 1215 929 925 5769 940 1364 231 213 591 222 238 2036 211 351 1 10 100 1000 10000 a v r
a b a t i k e c l i p s e l u i n d e x l u s e a r c h m
d y n m
t e c a r l
m d r a y t r a c e r s u n f l
g e
e a n Time (seconds) Bc OMc PMc PMPc
and Post
20/24
Analysis time: Control-flow analysis
71 1033 1312 60 58 55 61 130 62 692 151 55 946 988 46 57 53 53 108 53 684 131 1322 1175 1215 929 925 5769 940 1364 231 213 591 222 238 2036 211 351 1 10 100 1000 10000 a v r
a b a t i k e c l i p s e l u i n d e x l u s e a r c h m
d y n m
t e c a r l
m d r a y t r a c e r s u n f l
g e
e a n Time (seconds) Bc OMc PMc PMPc
and Post
Otherwise unanalyzable benchmarks in less than 40 minutes.
20/24
Peak memory consumption
Bench- Memory (GB) mark Be PMPe Bc PMPc avrora
54 11 batik
eclipse
luindex
58 11 lusearch
54 11 pmd
13 sunflow
moldyn
29 11 montecarlo
29 9 raytracer
29 10 geomean
47 18
21/24
Peak memory consumption
Bench- Memory (GB) mark Be PMPe Bc PMPc avrora
54 11 batik
eclipse
luindex
58 11 lusearch
54 11 pmd
13 sunflow
moldyn
29 11 montecarlo
29 9 raytracer
29 10 geomean
47 18
memories (∼512GB) were not enough.
be sufficient.
21/24
Number of contexts
Bench- Average #contexts mark Be PMPe Bc PMPc avrora
9.5 1.2 batik
eclipse
luindex
1.2 lusearch
1.2 pmd
1.2 sunflow
moldyn
9.5 1.3 montecarlo
9.4 1.2 raytracer
9.4 1.2 geomean
1.2
22/24
Number of contexts
Bench- Average #contexts mark Be PMPe Bc PMPc avrora
9.5 1.2 batik
eclipse
luindex
1.2 lusearch
1.2 pmd
1.2 sunflow
moldyn
9.5 1.3 montecarlo
9.4 1.2 raytracer
9.4 1.2 geomean
1.2
1 10 100 1000 10000 #Contexts Methods
pmd-Bc
1 10 100 #Contexts Methods
pmd-PMPc
22/24
Number of contexts
Bench- Average #contexts mark Be PMPe Bc PMPc avrora
9.5 1.2 batik
eclipse
luindex
1.2 lusearch
1.2 pmd
1.2 sunflow
moldyn
9.5 1.3 montecarlo
9.4 1.2 raytracer
9.4 1.2 geomean
1.2
1 10 100 1000 10000 #Contexts Methods
pmd-Bc
1 10 100 #Contexts Methods
pmd-PMPc
Significant reduction in #contexts
22/24
Number of contexts
Bench- Average #contexts mark Be PMPe Bc PMPc avrora
9.5 1.2 batik
eclipse
luindex
1.2 lusearch
1.2 pmd
1.2 sunflow
moldyn
9.5 1.3 montecarlo
9.4 1.2 raytracer
9.4 1.2 geomean
1.2
1 10 100 1000 10000 #Contexts Methods
pmd-Bc
1 10 100 #Contexts Methods
pmd-PMPc
Significant reduction in #contexts ⇒ Significant reduction in resources spent
22/24
Number of contexts
Bench- Average #contexts mark Be PMPe Bc PMPc avrora
9.5 1.2 batik
eclipse
luindex
1.2 lusearch
1.2 pmd
1.2 sunflow
moldyn
9.5 1.3 montecarlo
9.4 1.2 raytracer
9.4 1.2 geomean
1.2
1 10 100 1000 10000 #Contexts Methods
pmd-Bc
1 10 100 #Contexts Methods
pmd-PMPc
Significant reduction in #contexts ⇒ Significant reduction in resources spent ⇒ Scalability.
22/24
Comparison with 2obj1h
23/24
Comparison with 2obj1h (lower the better)
1659 1530 1549 1505 1505 1951 1505 1594 1588 1462 1460 1487 1485 2126 1488 1572 500 1000 1500 2000 2500 avrora luindex lusearch moldyn montecarlo pmd raytracer geomean #polyCall 2obj1h PMPc 66551 62393 64427 58135 58381 74858 58297 63053 64314 59721 61006 58447 58582 77314 58509 62267 10000 20000 30000 40000 50000 60000 70000 80000 90000 avrora luindex lusearch moldyn montecarlo pmd raytracer geomean #callEdge 2obj1h PMPc
23/24
Comparison with 2obj1h (lower the better)
1659 1530 1549 1505 1505 1951 1505 1594 1588 1462 1460 1487 1485 2126 1488 1572 500 1000 1500 2000 2500 avrora luindex lusearch moldyn montecarlo pmd raytracer geomean #polyCall 2obj1h PMPc 66551 62393 64427 58135 58381 74858 58297 63053 64314 59721 61006 58447 58582 77314 58509 62267 10000 20000 30000 40000 50000 60000 70000 80000 90000 avrora luindex lusearch moldyn montecarlo pmd raytracer geomean #callEdge 2obj1h PMPc
and 59.4% lesser memory.
23/24
Conclusion and Future work
Conclusion:
losing precision.
24/24
Conclusion and Future work
Conclusion:
losing precision.
Future work:
approaches differ.
as part of LSRV-contexts.
24/24
Conclusion and Future work
Conclusion:
losing precision.
Future work:
approaches differ.
as part of LSRV-contexts.
24/24
Example: Access-depths
2. A f1,f2; 3. void foo(){ 4. ... 5. c.bar(a); 6. d.bar(b); 7. } 8. void bar(A p){ 9. A x = new A(); 10. p.f1.f2 = x; 11. p.fb(); 12. p.fb(); 13. } 14. void fb(){ 15. /*Doesn’t access 16. caller’s heap*/ 17. } 18.}
Example: Access-depths
2. A f1,f2; 3. void foo(){ 4. ... 5. c.bar(a); 6. d.bar(b); 7. } 8. void bar(A p){ 9. A x = new A(); 10. p.f1.f2 = x; 11. p.fb(); 12. p.fb(); 13. } 14. void fb(){ 15. /*Doesn’t access 16. caller’s heap*/ 17. } 18.}
⇒ Relevant points-to (sub)graph: ptsto(p), ptsto(p.f1)
Example: Access-depths
2. A f1,f2; 3. void foo(){ 4. ... 5. c.bar(a); 6. d.bar(b); 7. } 8. void bar(A p){ 9. A x = new A(); 10. p.f1.f2 = x; 11. p.fb(); 12. p.fb(); 13. } 14. void fb(){ 15. /*Doesn’t access 16. caller’s heap*/ 17. } 18.}
⇒ Relevant points-to (sub)graph: ptsto(p), ptsto(p.f1)
Example: Access-depths
2. A f1,f2; 3. void foo(){ 4. ... 5. c.bar(a); 6. d.bar(b); 7. } 8. void bar(A p){ 9. A x = new A(); 10. p.f1.f2 = x; 11. p.fb(); 12. p.fb(); 13. } 14. void fb(){ 15. /*Doesn’t access 16. caller’s heap*/ 17. } 18.}
⇒ Relevant points-to (sub)graph: ptsto(p), ptsto(p.f1)
⇒ fb is caller-ignorable
Example: Access-depths
2. A f1,f2; 3. void foo(){ 4. ... 5. c.bar(a); 6. d.bar(b); 7. } 8. void bar(A p){ 9. A x = new A(); 10. p.f1.f2 = x; 11. p.fb(); 12. p.fb(); 13. } 14. void fb(){ 15. /*Doesn’t access 16. caller’s heap*/ 17. } 18.}
⇒ Relevant points-to (sub)graph: ptsto(p), ptsto(p.f1)
⇒ fb is caller-ignorable
post analyses in the paper.
Static characteristics of benchmarks
Bench- Application #Referred mark #classes size (MB) JDK classes avrora 527 2.7 1588 batik 1038 6.0 3700 eclipse 1608 14.0 2589 luindex 199 1.3 1485 lusearch 198 1.3 1481 pmd 697 4.1 1607 sunflow 225 1.7 3509 moldyn 13 0.15 1555 montecarlo 19 0.67 1555 raytracer 19 0.21 1555
Static characteristics of benchmarks
Bench- Application #Referred mark #classes size (MB) JDK classes avrora 527 2.7 1588 batik 1038 6.0 3700 eclipse 1608 14.0 2589 luindex 199 1.3 1485 lusearch 198 1.3 1481 pmd 697 4.1 1607 sunflow 225 1.7 3509 moldyn 13 0.15 1555 montecarlo 19 0.67 1555 raytracer 19 0.21 1555
Sizes range from 150 KB (small programs) to 14 MB (large applications).
Analysis time: Pre and Post
Analysis time Bench- (seconds) mark Pre Poste Postc avrora 1.0 0.4 0.5 batik 2.2 1.8 2.4 eclipse 2.7 6.0 6.1 luindex 1.1 0.4 0.7 lusearch 1.0 0.5 0.9 pmd 1.3 0.4 0.7 sunflow 2.1 1.6 2.2 moldyn 0.9 0.4 0.6 montecarlo 0.9 0.4 0.3 raytracer 0.9 0.4 0.3 geomean 1.3 0.7 0.9
the instantiations.
Analysis time: Pre and Post
Analysis time Bench- (seconds) mark Pre Poste Postc avrora 1.0 0.4 0.5 batik 2.2 1.8 2.4 eclipse 2.7 6.0 6.1 luindex 1.1 0.4 0.7 lusearch 1.0 0.5 0.9 pmd 1.3 0.4 0.7 sunflow 2.1 1.6 2.2 moldyn 0.9 0.4 0.6 montecarlo 0.9 0.4 0.3 raytracer 0.9 0.4 0.3 geomean 1.3 0.7 0.9
the instantiations.
pre and the post analyses is negligible (∼2 seconds).