Proceedings paper

Title:
Optimizing Transformations of Dynamic Languages Compiled to Intermediate Representations
Authors:
R. Husák, F. Zavoral, J. Kofroň
Publication:
2020 International Symposium on Theoretical Aspects of Software Engineering
Year:
2020
ISBN:
978-1-72814-086-5
Link:

Abstract:
Compiling dynamic languages to stack-based intermediate representations used in platforms such as .NET and Java proved to be useful, mainly due to the enhanced interoperability and security. To produce the best intermediate code possible, current approaches perform a detailed flow-sensitive type analysis of the original code and utilize its results to choose the most efficient operations of the target platform. As known from the traditional compilers, the standard way to further increase program performance is using a set of transformations, which increase its efficiency while preserving its semantics. However, these transformations are not directly usable in the compilers of dynamic languages, because these operate on a higher level of abstraction; moreover, dynamic languages pose specific challenges, such as those stemming from weak typing. In this paper we propose a set of transformations which fit into the architecture of a dynamic language compiler, fitting well together with the type analysis. For evaluation purposes, we implemented them to Peachpie, a compiler of PHP to .NET. Applying the transformations during compilation of WordPress resulted in improvement of 0.6% in the generated assembly size, 1.8% in CPU time and 0.8% in memory consumption.

BibTeX:
@inproceedings{husak_optimizing_2020,
    title = {{Optimizing Transformations of Dynamic Languages Compiled to Intermediate Representations}},
    author = {Husá k, Robert and Zavoral, Filip and Kofroň, Jan},
    year = {2020},
    booktitle = {{2020 International Symposium on Theoretical Aspects of Software Engineering}},
    publisher = {The Institute of Electrical and Electronics Engineers, Inc.},
    isbn = {978-1-72814-086-5},
    pages = {145--152},
    url = {https://conferences.computer.org/tasepub/pdfs/TASE2020-5dIM65sOjiD1UBvCxlbFGt/408600a145/408600a145.pdf},
}