Java Alias Analysis for Online Environments Manu Sridharan 2004 OSQ Retreat Joint work with Rastislav Bodik, Denis Gopan, Jong-Deok Choi.

Slides:



Advertisements
Similar presentations
Dataflow Analysis for Datarace-Free Programs (ESOP 11) Arnab De Joint work with Deepak DSouza and Rupesh Nasre Indian Institute of Science, Bangalore.
Advertisements

R O O T S Field-Sensitive Points-to-Analysis Eda GÜNGÖR
Garbage collection David Walker CS 320. Where are we? Last time: A survey of common garbage collection techniques –Manual memory management –Reference.
Context-Sensitive Interprocedural Points-to Analysis in the Presence of Function Pointers Presentation by Patrick Kaleem Justin.
Pointer Analysis – Part I Mayur Naik Intel Research, Berkeley CS294 Lecture March 17, 2009.
Type-Based Flow Analysis: From Polymorphic Subtyping to CFL-Reachability Jakob Rehof and Manuel Fähndrich Microsoft Research.
Demand-driven Alias Analysis Implementation Based on Open64 Xiaomi An
Building a Better Backtrace: Techniques for Postmortem Program Analysis Ben Liblit & Alex Aiken.
Refinement-Based Context-Sensitive Points-To Analysis for JAVA Soonho Kong 17 January Work of Manu Sridharan and Rastislav Bodik, UC Berkeley.
A Fixpoint Calculus for Local and Global Program Flows Swarat Chaudhuri, U.Penn (with Rajeev Alur and P. Madhusudan)
Pointer Analysis Lecture 2 G. Ramalingam Microsoft Research, India.
Thin Slicing Manu Sridharan, Stephen J. Fink, Rastislav Bodík.
ABCD: Eliminating Array-Bounds Checks on Demand Rastislav Bodík Rajiv Gupta Vivek Sarkar U of Wisconsin U of Arizona IBM TJ Watson recent experiments.
1 Practical Object-sensitive Points-to Analysis for Java Ana Milanova Atanas Rountev Barbara Ryder Rutgers University.
The Ant and The Grasshopper Fast and Accurate Pointer Analysis for Millions of Lines of Code Ben Hardekopf and Calvin Lin PLDI 2007 (Best Paper & Best.
Semi-Sparse Flow-Sensitive Pointer Analysis Ben Hardekopf Calvin Lin The University of Texas at Austin POPL ’09 Simplified by Eric Villasenor.
Interprocedural analysis © Marcelo d’Amorim 2010.
Eliminating Stack Overflow by Abstract Interpretation John Regehr Alastair Reid Kirk Webb University of Utah.
Establishing Local Temporal Heap Safety Properties with Applications to Compile-Time Memory Management Ran Shaham Eran Yahav Elliot Kolodner Mooly Sagiv.
5/2/2008Prof. P. N. Hilfinger CS164 Lecture 401 Pointer Analysis Lecture 40 (adapted from notes by R. Bodik)
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts, Amherst Advanced Compilers CMPSCI 710.
Mayur Naik Alex Aiken John Whaley Stanford University Effective Static Race Detection for Java.
Speeding Up Dataflow Analysis Using Flow- Insensitive Pointer Analysis Stephen Adams, Tom Ball, Manuvir Das Sorin Lerner, Mark Seigle Westley Weimer Microsoft.
Set Constraint-Based Program Analysis Manuel Fähndrich CS590 UW Spring 2001.
Scaling CFL-Reachability-Based Points- To Analysis Using Context-Sensitive Must-Not-Alias Analysis Guoqing Xu, Atanas Rountev, Manu Sridharan Ohio State.
1 Refinement-Based Context-Sensitive Points-To Analysis for Java Manu Sridharan, Rastislav Bodík UC Berkeley PLDI 2006.
A Context-Sensitive Pointer Analysis Phase in Open64 Compiler Tianwei Sheng, Wenguang Chen, Weimin Zheng Tsinghua University.
A Type-Checked Restrict Qualifier Jeff Foster OSQ Retreat May 9-10, 2001.
Pointer Analysis for CASH Compiler Framework Deepak Garg Himanshu Jain Spring 2005.
Compile-Time Deallocation of Individual Objects Sigmund Cherem and Radu Rugina International Symposium on Memory Management June, 2006.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts, Amherst Advanced Compilers CMPSCI 710.
Reps Horwitz and Sagiv 95 (RHS) Another approach to context-sensitive interprocedural analysis Express the problem as a graph reachability query Works.
Detecting Inefficiently-Used Containers to Avoid Bloat Guoqing Xu and Atanas Rountev Department of Computer Science and Engineering Ohio State University.
PRESTO: Program Analyses and Software Tools Research Group, Ohio State University A Framework for Source-Code- Level Interprocedural Dataflow Analysis.
An Efficient Inclusion-Based Points-To Analysis for Strictly-Typed Languages John Whaley Monica S. Lam Computer Systems Laboratory Stanford University.
Overview of program analysis Mooly Sagiv html://
Impact Analysis of Database Schema Changes Andy Maule, Wolfgang Emmerich and David S. Rosenblum London Software Systems Dept. of Computer Science, University.
Reverse Engineering State Machines by Interactive Grammar Inference Neil Walkinshaw, Kirill Bogdanov, Mike Holcombe, Sarah Salahuddin.
PRESTO Research Group, Ohio State University Interprocedural Dataflow Analysis in the Presence of Large Libraries Atanas (Nasko) Rountev Scott Kagan Ohio.
PRESTO: Program Analyses and Software Tools Research Group, Ohio State University Merging Equivalent Contexts for Scalable Heap-cloning-based Points-to.
Pointer Analysis Lecture 2 G. Ramalingam Microsoft Research, India.
1 Lecture 19 Flow Analysis flow analysis in prolog; applications of flow analysis Ras Bodik Ali and Mangpo Hack Your Language! CS164: Introduction to Programming.
ABCD: Eliminating Array-Bounds Checks on Demand Rastislav Bodík Rajiv Gupta Vivek Sarkar U of Wisconsin U of Arizona IBM TJ Watson recent experiments.
Mark Marron IMDEA-Software (Madrid, Spain) 1.
Adapting Side-Effects Analysis for Modular Program Model Checking M.S. Defense Oksana Tkachuk Major Professor: Matthew Dwyer Support US National Science.
PRESTO: Program Analyses and Software Tools Research Group, Ohio State University Merging Equivalent Contexts for Scalable Heap-cloning-based Points-to.
Pointer Analysis Survey. Rupesh Nasre. Aug 24, 2007.
Pointer Analysis Lecture 2 G. Ramalingam Microsoft Research, India & K. V. Raghavan.
Points-To Analysis in Almost Linear Time Josh Bauman Jason Bartkowiak CSCI 3294 OCTOBER 9, 2001.
Data Flow Analysis for Software Prefetching Linked Data Structures in Java Brendon Cahoon Dept. of Computer Science University of Massachusetts Amherst,
Interprocedural Analysis Noam Rinetzky Mooly Sagiv.
Heap liveness and its usage in automatic memory management Ran Shaham Elliot Kolodner Mooly Sagiv ISMM’02 Unpublished TVLA.
Detecting Inefficiently-Used Containers to Avoid Bloat Guoqing Xu and Atanas Rountev Department of Computer Science and Engineering Ohio State University.
CS 343 presentation Concrete Type Inference Department of Computer Science Stanford University.
Reachability Analysis for Callbacks 北京大学 唐浩
Generating Precise and Concise Procedure Summaries Greta Yorsh Eran Yahav Satish Chandra.
1 Lecture 17 Flow Analysis flow analysis in prolog; applications of flow analysis Ras Bodik Shaon Barman Thibaud Hottelier Hack Your Language! CS164: Introduction.
Pointer Analysis. Rupesh Nasre. Advisor: Prof R Govindarajan. Apr 05, 2008.
Pointer Analysis – Part I CS Pointer Analysis Answers which pointers can point to which memory locations at run-time Central to many program optimization.
Constructing Accurate Application Call Graphs For Java To Model Library Callbacks Weilei Zhang, Barbara Ryder Department of Computer Science Rutgers University.
Sept 12ICSM'041 Precise Identification of Side-Effect-Free Methods in Java Atanas (Nasko) Rountev Ohio State University.
Inter-procedural analysis
C11, Implications of Inheritance
Harry Xu University of California, Irvine & Microsoft Research
Pointer Analysis Lecture 2
Inlining and Devirtualization Hal Perkins Autumn 2011
Inlining and Devirtualization Hal Perkins Autumn 2009
Demand-Driven Context-Sensitive Alias Analysis for Java
Pointer analysis John Rollinson & Kaiyuan Li
Context Sensitive Points-to Analysis
Presentation transcript:

Java Alias Analysis for Online Environments Manu Sridharan 2004 OSQ Retreat Joint work with Rastislav Bodik, Denis Gopan, Jong-Deok Choi

2 Motivation: Online Environments No suitable alias analysis for “online environments” JIT: compilation and optimization of modern languages ›Currently use type system for coarse alias info ›Whole-program Andersen too slow (~45s) IDE: program understanding, powerful refactorings ›Andersen too inaccurate (need context-sensitivity) ›Up to 20 minutes for full context-sensitive analysis Desired analysis properties similar! ›Interactive response time demand analysis, approximate wisely within time budget ›Additional context-sensitivity when necessary depth 3 for distinguishing ArrayList objects

3 Alias Analysis as CFL-Reachability (Melski, Reps) x := new Obj(); // o 1 y := new Obj(); // o 2 z := new Obj(); // o 3 x.f = y; y.f = z; w = y; v = w.f; x o2o2 o1o1 o3o3 y z new pf[f] w v assign gf[f] pointsTo :- new | contains pointsTo contains :- assign | gf[f] share pf[f] share :- pointsTo pointsTo_bar

4 Java Alias Analysis is Balanced Parens Match getfields with putfields to track flow through heap ›Does not hold for C (address-of operator) Match edges summarize flow through fields, make traversal regular Makes efficient dynamic programming algorithm for Dyck languages applicable x o2o2 o1o1 o3o3 y z new pf[f] w v assign gf[f] pointsTo :- new | contains pointsTo contains :- assign | gf[f] share pf[f] match

5 Match-based algorithms MATCH all : add only valid match edges bottom-up ›Adaptation of Reps et. al. POPL95 algorithm ›Alternative to constraint-based propagation algorithms may be faster with finer-grained abstract locations MATCH k : validate match edges selectively ›Experimentally, most match edges valid ›Focus effort on those likely to be invalid (arrays) MATCH 0 : add matches exhaustively, simple traversal ›Can restrict amount of traversal based on budget / payoff ›Restricted MATCH 0 fast without sacrificing accuracy less than 2 ms / query resolves 90% of virtual calls resolved with field-sensitivity ›Suitable for JIT compiler

6 Refactoring and context-sensitivity class Car { int horsePower; Engine engine; Car(int hp) { horsePower = hp; } int getHP() { return horsePower; } void setEngine(Engine e) { engine = e; } Engine getEngine() { return engine; } } class Engine {} class Car { Engine engine; Car() {} Engine getEngine() { return engine; } void setEngine(Engine e) { engine = e; } } class Engine { int horsePower; Engine(int hp) { horsePower = hp; } int getHP() { return horsePower; } } Precondition: engine is dynamically one-to-one ›statically one-to-one + simple flow-sensitivity Context-sensitive alias analysis necessary ›Distinguish calls to setEngine() ›Track Car objects if placed in container

7 Summaries through CFL paths class ListElem { int val; ListElem next; ListElem(int v, ListElem n) { val = v; next = n; } ListElem add(int v) { ListElem m = this; while (m != null) { if (m.val == v) return this; m = m.next; } return new ListElem(v, this); // o 1 } } this m o1o1 ret assign new assign gf[next] our summary Previous summary approach includes entire graph for add ›based on heap reachability (Whaley/Rinard OOPSLA99) Our approach only retains CFL paths from entry to exit ›In above example, exclude m and its edges

8 Java Alias Analysis is Balanced Parens: So What? Motivation: online environments ›JIT: performance improvement ›IDE: program understanding, powerful refactorings Desired analysis properties ›“Interactive” response time for small number of queries ›Added sensitivity (field, context) when necessary Progress ›Studied CFL reachability formulation Insight: unlike C, Java alias analysis is “balanced parens” ›JIT: simple, fast, and accurate algorithm less than 2 ms / query, 90% of field-sensitive accuracy ›IDE: context-sensitivity through small summaries Idea: retain only CFL paths