alias analysis for object oriented programs
play

Alias Analysis for Object-Oriented Programs M. Sridharan, S. - PowerPoint PPT Presentation

Alias Analysis for Object-Oriented Programs M. Sridharan, S. Chandra, J. Dolby, S. J. Fink, and E. Yahav Paper Review Adilet Zhaxybay Nazarbayev University Adilet Zhaxybay (Nazarbayev University) Alias Analysis for Object-Oriented Programs 1


  1. Alias Analysis for Object-Oriented Programs M. Sridharan, S. Chandra, J. Dolby, S. J. Fink, and E. Yahav Paper Review Adilet Zhaxybay Nazarbayev University Adilet Zhaxybay (Nazarbayev University) Alias Analysis for Object-Oriented Programs 1 / 42

  2. Outline Introduction 1 Introduction Motivating Analyses Points-To Analysis 2 Formulation Implementation Must-Alias Analysis 3 Analyzing Modern Java Programs 4 Conclusion 5 Adilet Zhaxybay (Nazarbayev University) Alias Analysis for Object-Oriented Programs 2 / 42

  3. Outline Introduction 1 Introduction Motivating Analyses Points-To Analysis 2 Formulation Implementation Must-Alias Analysis 3 Analyzing Modern Java Programs 4 Conclusion 5 Adilet Zhaxybay (Nazarbayev University) Alias Analysis for Object-Oriented Programs 3 / 42

  4. Outline Introduction 1 Introduction Motivating Analyses Points-To Analysis 2 Formulation Implementation Must-Alias Analysis 3 Analyzing Modern Java Programs 4 Conclusion 5 Adilet Zhaxybay (Nazarbayev University) Alias Analysis for Object-Oriented Programs 4 / 42

  5. Alias Analysis Aliases Two pointers said to be aliases if they point to the same location Adilet Zhaxybay (Nazarbayev University) Alias Analysis for Object-Oriented Programs 5 / 42

  6. Alias Analysis Aliases Two pointers said to be aliases if they point to the same location Alias Analysis Analysis which determines which pointers may or must be aliases Adilet Zhaxybay (Nazarbayev University) Alias Analysis for Object-Oriented Programs 5 / 42

  7. Example of Aliases Example in C int * x, y, z; x = malloc(sizeof(int)); y = x; // x and y are aliases now z = malloc(sizeof(int)); // x and z are not aliases Adilet Zhaxybay (Nazarbayev University) Alias Analysis for Object-Oriented Programs 6 / 42

  8. Paper Structure Origin Work by Sridharan et al. gives a high-level survey of the alias-analiysis techniques that authors have found most-useful during a years-long effort developing industrial-strength analyses for Java programs. Adilet Zhaxybay (Nazarbayev University) Alias Analysis for Object-Oriented Programs 7 / 42

  9. Paper Structure Origin Work by Sridharan et al. gives a high-level survey of the alias-analiysis techniques that authors have found most-useful during a years-long effort developing industrial-strength analyses for Java programs. Published in 2013 in ‘Lecture Notes in Computer Science‘ Adilet Zhaxybay (Nazarbayev University) Alias Analysis for Object-Oriented Programs 7 / 42

  10. Paper Structure Origin Work by Sridharan et al. gives a high-level survey of the alias-analiysis techniques that authors have found most-useful during a years-long effort developing industrial-strength analyses for Java programs. Published in 2013 in ‘Lecture Notes in Computer Science‘ It is not an exhaustive survey of alias analysis. Adilet Zhaxybay (Nazarbayev University) Alias Analysis for Object-Oriented Programs 7 / 42

  11. Paper Structure Origin Work by Sridharan et al. gives a high-level survey of the alias-analiysis techniques that authors have found most-useful during a years-long effort developing industrial-strength analyses for Java programs. Published in 2013 in ‘Lecture Notes in Computer Science‘ It is not an exhaustive survey of alias analysis. Challenges Treats alias analysis as a constrant tradeoff between scalability (adaptation to large programs) and precision (accuracy of analysis). Adilet Zhaxybay (Nazarbayev University) Alias Analysis for Object-Oriented Programs 7 / 42

  12. Paper Focus Focus Paper focuses on two main techniques: Adilet Zhaxybay (Nazarbayev University) Alias Analysis for Object-Oriented Programs 8 / 42

  13. Paper Focus Focus Paper focuses on two main techniques: Points-to analysis — analysis, that can be used to determine may-alias information, i.e., whether it is possible for two pointers to be aliased during program execution. Adilet Zhaxybay (Nazarbayev University) Alias Analysis for Object-Oriented Programs 8 / 42

  14. Paper Focus Focus Paper focuses on two main techniques: Points-to analysis — analysis, that can be used to determine may-alias information, i.e., whether it is possible for two pointers to be aliased during program execution. Access-path tracking — provides must-alias information, i.e., whether two pointers must be aliased at some program point. Adilet Zhaxybay (Nazarbayev University) Alias Analysis for Object-Oriented Programs 8 / 42

  15. Paper Focus Focus Paper focuses on two main techniques: Points-to analysis — analysis, that can be used to determine may-alias information, i.e., whether it is possible for two pointers to be aliased during program execution. Access-path tracking — provides must-alias information, i.e., whether two pointers must be aliased at some program point. Java Additionally paper aims to explain particlar challenges for modern Java programs. Adilet Zhaxybay (Nazarbayev University) Alias Analysis for Object-Oriented Programs 8 / 42

  16. Outline Introduction 1 Introduction Motivating Analyses Points-To Analysis 2 Formulation Implementation Must-Alias Analysis 3 Analyzing Modern Java Programs 4 Conclusion 5 Adilet Zhaxybay (Nazarbayev University) Alias Analysis for Object-Oriented Programs 9 / 42

  17. Possible Errors Memory leak int * x = malloc(sizeof(int)); x = malloc(sizeof(int)); Adilet Zhaxybay (Nazarbayev University) Alias Analysis for Object-Oriented Programs 10 / 42

  18. Possible Errors Memory leak int * x = malloc(sizeof(int)); x = malloc(sizeof(int)); Invalid memory access int * x = malloc(sizeof(int)); int * y = x; free x; free y; Adilet Zhaxybay (Nazarbayev University) Alias Analysis for Object-Oriented Programs 10 / 42

  19. More Sophisticated Example Adilet Zhaxybay (Nazarbayev University) Alias Analysis for Object-Oriented Programs 11 / 42

  20. Two Alias Analysis Characteristics Flow-sensitivity Flow-sensitive analysis computes aliases for all flow paths in the program, while flow-insensitive analysis computes aliasing for the program as a whole. Adilet Zhaxybay (Nazarbayev University) Alias Analysis for Object-Oriented Programs 12 / 42

  21. Two Alias Analysis Characteristics Flow-sensitivity Flow-sensitive analysis computes aliases for all flow paths in the program, while flow-insensitive analysis computes aliasing for the program as a whole. Context-sensitivity Context-sensitivity is about function/procedure calls and means whether a context of a call is taken into consideration or not. Adilet Zhaxybay (Nazarbayev University) Alias Analysis for Object-Oriented Programs 12 / 42

  22. Outline Introduction 1 Introduction Motivating Analyses Points-To Analysis 2 Formulation Implementation Must-Alias Analysis 3 Analyzing Modern Java Programs 4 Conclusion 5 Adilet Zhaxybay (Nazarbayev University) Alias Analysis for Object-Oriented Programs 13 / 42

  23. Outline Introduction 1 Introduction Motivating Analyses Points-To Analysis 2 Formulation Implementation Must-Alias Analysis 3 Analyzing Modern Java Programs 4 Conclusion 5 Adilet Zhaxybay (Nazarbayev University) Alias Analysis for Object-Oriented Programs 14 / 42

  24. Point-to Analysis Paper presents several common variants of Andersen’s point-to analysis. Adilet Zhaxybay (Nazarbayev University) Alias Analysis for Object-Oriented Programs 15 / 42

  25. Point-to Analysis Paper presents several common variants of Andersen’s point-to analysis. Point-to analysis A points-to analysis computes an over-approximation of the heap locations that each program pointer may point to. Pointers include program variables and also pointers within heap-allocated objects, e.g., instance fields. Adilet Zhaxybay (Nazarbayev University) Alias Analysis for Object-Oriented Programs 15 / 42

  26. Point-to Analysis Paper presents several common variants of Andersen’s point-to analysis. Point-to analysis A points-to analysis computes an over-approximation of the heap locations that each program pointer may point to. Pointers include program variables and also pointers within heap-allocated objects, e.g., instance fields. The result of the analysis is a points-to relation pt, with pt(p) representing the points-to set of a pointer p. Adilet Zhaxybay (Nazarbayev University) Alias Analysis for Object-Oriented Programs 15 / 42

  27. Point-to Analysis Paper presents several common variants of Andersen’s point-to analysis. Point-to analysis A points-to analysis computes an over-approximation of the heap locations that each program pointer may point to. Pointers include program variables and also pointers within heap-allocated objects, e.g., instance fields. The result of the analysis is a points-to relation pt, with pt(p) representing the points-to set of a pointer p. Point-to analysis is flow insensitive: it assumes statements can execute in any order and any number of times. Adilet Zhaxybay (Nazarbayev University) Alias Analysis for Object-Oriented Programs 15 / 42

  28. Point-to Analysis Statements Adilet Zhaxybay (Nazarbayev University) Alias Analysis for Object-Oriented Programs 16 / 42

  29. Context Sensitivity Context sensitivity It is possible to extend point-to analysis to incorporate context-sensitive handling of method calls. Adilet Zhaxybay (Nazarbayev University) Alias Analysis for Object-Oriented Programs 17 / 42

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend