Building SSA in a Compiler for PHP

Constructing SSA form for static languages such as C/C++ and Java is a well-understood task. Dynamic scripting languages, such as PHP, Python, and JavaScript, present a much greater challenge. The information required to build SSA form is not available directly from the program source and cannot be...

Full description

Saved in:
Bibliographic Details
Published inSSA-based Compiler Design pp. 347 - 357
Main Authors Biggar, Paul, Gregg, David
Format Book Chapter
LanguageEnglish
Published Cham Springer International Publishing 2022
Subjects
Online AccessGet full text
ISBN303080514X
9783030805142
DOI10.1007/978-3-030-80515-9_24

Cover

More Information
Summary:Constructing SSA form for static languages such as C/C++ and Java is a well-understood task. Dynamic scripting languages, such as PHP, Python, and JavaScript, present a much greater challenge. The information required to build SSA form is not available directly from the program source and cannot be derived from a simple analysis. Instead, we find a litany of features whose presence makes analysis difficult such as runtime generation of source code and variable-variables. Ruling out the presence of these features requires precise, inter-procedural, whole-program analysis. We discuss the futility of the pessimistic solution, the analyses required to provide a precise SSA form, and how the presence of variables of unknown types affects the precision of SSA. We identify the features of PHP that make building SSA difficult, outline the solutions we found to some of these challenges, and draw some lessons about the use of SSA in analysis frameworks for PHP.
ISBN:303080514X
9783030805142
DOI:10.1007/978-3-030-80515-9_24