The past decade has witnessed the widespread adoption of programming languages designed to execute on virtual machines, such as the Java and C# programming language. However, such languages face significant performance challenges beyond those confronted by traditional languages. First, portable program representations and dynamic language features, force the deferral of most optimizations until runtime, inducing runtime optimization overhead. Second, modular program representations preclude many forms of whole-program interprocedural optimization. Third, virtual machines incur additional costs for runtime services such as security guarantees and automatic memory management. To address these challenges, mainstream virtual machine implementations include substantial infrastructure for online profiling, dynamic compilation, and feedback-directed optimization. As a result, adaptive optimization has begun to mature as a widespread production-level technology.
This tutorial will survey the state-of-the-art in the areas of dynamic compilation and adaptive optimization in virtual machines. Dynamic compilation is the process of dynamically optimizing a portable representation, such as Java bytecodes, into native code. Adaptive optimization is the online decision process that determines the overall strategy for profiling and employing dynamic compilation. In addition to surveying the state-of-the-art, this tutorial will also debunk several misconceptions about these two topics, such as
The ideal compiler infrastructure should support not only a variety of target machines but also a variety of programming languages. Past infrastructures have focused only on what happens at compile time. But to support such language features as garbage collection, exception dispatch, and concurrency, run-time support is needed. I have proposed providing such support not by upcalls but through a run-time interface, which reveals to the run-time system the important decisions made in the compiler's back end. This new organization should make compiler infrastructure significantly easier to reuse with multiple languages. The distinctive feature of this infrastructure is that it is intended not so much for experiments in optimization but rather for the person who has a programming language and a target machine in mind and wants to get a reasonable implementation quickly. The focus of the tutorial will be on how to use the infrastructure and we will probably spend much of the time showing example clients: a simple front end, a simple garbage collector, that sort of thing.