Cfa2: pushdown flow analysis for higher-order languages

  • Authors:
  • Olin Shivers;Dimitrios Vardoulakis

  • Affiliations:
  • Northeastern University;Northeastern University

  • Venue:
  • Cfa2: pushdown flow analysis for higher-order languages
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

In a higher-order language, the dominant control-flow mechanism is function call and return. Most higher-order flow analyses do not handle call and return well: they remember only a bounded number of pending calls because they approximate programs as finite-state machines. Call/return mismatch introduces precision-degrading spurious execution paths and increases the analysis time. We present flow analyses that provide unbounded call/return matching in a general setting: our analyses apply to typed and untyped languages, with first-class functions, side effects, tail calls and first-class control. This is made possible by several individual techniques. We generalize Sharir and Pnueli's summarization technique to handle expressive control constructs, such as tail calls and first-class continuations. We propose a syntactic classification of variable references that allows precise lookups for non-escaping references and falls back to a conservative approximation for references captured in closures. We show how to structure a flow analysis like a traditional interpreter based on big-step semantics. With this formulation, expressions use the analysis results of their subexpressions directly, which minimizes caching and makes the analysis faster. We present experimental results from two implementations for Scheme and JavaScript, which show that our analyses are precise and fast in practice.