Mixed mode execution with context threading

Mathew Zaleski, Marc Berndl, Angela Demke Brown

Proceedings of the 2005 conference of the Centre for Advanced Studies on Collaborative research (CASCON), Toronto, ON, October 2005

 

Abstract

Interpreters are widely used to implement portable language runtime environments. Programs written in these languages may benefit from performance beyond that obtainable by optimizing interpretation alone. A modern high-performance mixed-mode virtualmachine (VM) includes amethod-based Just In Time (JIT) compiler. A method-based JIT, however, requires the up-front development of a complex compilation infrastructure before any performance benefits are realized.</p> <p>&nbsp;</p> <p>Ideally, the architecture for a mixed-mode VM could detect and execute a variety of shapes of hot regions of a virtual program. Our VM architecture is based on context threading. It supports powerful, efficient instrumentation and a simple framework for dynamic code generation. It has the potential to directly support a full spectrum of mixed-mode execution: from interpreted bytecode bodies, to specialized bytecode generated at runtime, to traces, to compiled methods. Further, it provides the necessary tools to detect these regions at runtime.</p> <p>&nbsp;</p> <p>We extended two VMs, SableVM and the OCaml interpreter with our infrastructure on both the P4 and PPC. To demonstrate the power and flexibility of our infrastructure we compare the selection and dispatch effectiveness for three common region shapes: whole methods, partial methods, and SPECL traces. We report results for a preliminary version of our code generator which compiles a region into a sequence of direct calls to bytecode bodies.</p>

 

Manuscript

Pdf

 

Bibtex

Bib