Scopes and frames improve meta-interpreter specialization

Conference Paper (2019)
Author(s)

V.A. Vergu (TU Delft - Programming Languages)

Andrew Tolmach (Portland State University)

Eelco Visser (TU Delft - Programming Languages)

Research Group
Programming Languages
Copyright
© 2019 V.A. Vergu, Andrew Tolmach, Eelco Visser
DOI related publication
https://doi.org/10.4230/LIPIcs.ECOOP.2019.4
More Info
expand_more
Publication Year
2019
Language
English
Copyright
© 2019 V.A. Vergu, Andrew Tolmach, Eelco Visser
Research Group
Programming Languages
Volume number
134
Pages (from-to)
4:1-4:30
ISBN (electronic)
9783959771115
Reuse Rights

Other than for strictly personal use, it is not permitted to download, forward or distribute the text or part of it, without the consent of the author(s) and/or copyright holder(s), unless the work is under an open content license such as Creative Commons.

Abstract

DynSem is a domain-specific language for concise specification of the dynamic semantics of programming languages, aimed at rapid experimentation and evolution of language designs. To maintain a short definition-to-execution cycle, DynSem specifications are meta-interpreted. Meta-interpretation introduces runtime overhead that is difficult to remove by using interpreter optimization frameworks such as the Truffle/Graal Java tools; previous work has shown order-of-magnitude improvements from applying Truffle/Graal to a meta-interpreter, but this is still far slower than what can be achieved with a language-specific interpreter. In this paper, we show how specifying the meta-interpreter using scope graphs, which encapsulate static name binding and resolution information, produces much better optimization results from Truffle/Graal. Furthermore, we identify that JIT compilation is hindered by large numbers of calls between small polymorphic rules and we introduce rule cloning to derive larger monomorphic rules at run time as a countermeasure. Our contributions improve the performance of DynSem-derived interpreters to within an order of magnitude of a handwritten language-specific interpreter.