Hostname: page-component-848d4c4894-8bljj Total loading time: 0 Render date: 2024-06-20T00:56:08.105Z Has data issue: false hasContentIssue false

Inlining as staged computation

Published online by Cambridge University Press:  13 May 2003

STEFAN MONNIER
Affiliation:
Department of Computer Science, Yale University, New Haven, CT 06520-8285, USA (e-mail: monnier@cs.yale.edu)
ZHONG SHAO
Affiliation:
Department of Computer Science, Yale University, New Haven, CT 06520-8285, USA (e-mail: shao@cs.yale.edu)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

Inlining and specialization appear in various forms throughout the implementation of modern programming languages. From mere compiler optimizations to sophisticated techniques in partial evaluation, they are omnipresent, yet each application is treated differently. This paper is an attempt at uncovering the relations between inlining (as done in production compilers) and staged computation (as done in partial evaluators) in the hope of bringing together the research advances in both fields. Using a two-level lambda calculus as the intermediate language, we show how to model inlining as a staged computation while avoiding unnecessary code duplication. The new framework allows us to define inlining annotations formally and to reason about their interactions with module code. In fact, we present a cross-module inlining algorithm that inlines all functions marked inlinable, even in the presence of ML-style parameterized modules.

Type
Research Article
Copyright
© 2003 Cambridge University Press
Submit a response

Discussions

No Discussions have been published for this article.