Scalable Demand-Driven Call Graph Generation for Python

05/10/2023
by   Yixuan Yan, et al.
0

Call graph generation is the foundation of inter-procedural static analysis. PyCG is the state-of-the-art approach for generating call graphs for Python programs. Unfortunately, PyCG does not scale to large programs when adapted to whole-program analysis where dependent libraries are also analyzed. Further, PyCG does not support demand-driven analysis where only the reachable functions from given entry functions are analyzed. Moreover, PyCG is flow-insensitive and does not fully support Python's features, hindering its accuracy. To overcome these drawbacks, we propose a scalable demand-driven approach for generating call graphs for Python programs, and implement it as a prototype tool Jarvis. Jarvis maintains an assignment graph (i.e., points-to relations between program identifiers) for each function in a program to allow reuse and improve scalability. Given a set of entry functions as the demands, Jarvis generates the call graph on-the-fly, where flow-sensitive intra-procedural analysis and inter-procedural analysis are conducted in turn. Our evaluation on a micro-benchmark of 135 small Python programs and a macro-benchmark of 6 real-world Python applications has demonstrated that Jarvis can significantly improve PyCG by at least 67 least 10

READ FULL TEXT

page 1

page 2

page 3

page 4

research
02/28/2021

PyCG: Practical Call Graph Generation in Python

Call graphs play an important role in different contexts, such as profil...
research
03/28/2021

Scalable Call Graph Constructor for Maven

As a rich source of data, Call Graphs are used for various applications ...
research
08/15/2022

A Library for Representing Python Programs as Graphs for Machine Learning

Graph representations of programs are commonly a central element of mach...
research
09/16/2021

Efficient Path-Sensitive Data-Dependence Analysis

This paper presents a scalable path- and context-sensitive data-dependen...
research
02/24/2022

Scalpel: The Python Static Analysis Framework

Despite being the most popular programming language, Python has not yet ...
research
02/03/2018

Demand-driven Alias Analysis : Formalizing Bidirectional Analyses for Soundness and Precision

A demand-driven approach to program analysis have been viewed as efficie...
research
01/29/2020

Optimal and Perfectly Parallel Algorithms for On-demand Data-flow Analysis

Interprocedural data-flow analyses form an expressive and useful paradig...

Please sign up or login with your details

Forgot password? Click here to reset