The Virtual Processing Unit is a fast, high-level code generation utility that performs most of the complex tasks related to code generation, including register allocation, and which produces good-quality C ABI-compliant native code. In the simplest cases, adding VPU-based runtime code generation to an application requires just a few lines of additional code—and for a typical virtual machine, VPU-based just-in-time compilation requires only a few lines of code per virtual instruction. Applications or virtual machines wanting to benefit from runtime code generation are therefore forced to implement much of the compilation chain for themselves even when they make use of the available tools. The Virtual Processing Unit fills the gap between trivial “virtual assembly languages” and full-blown dynamic compilers intimately tied to their source language and its semantics. It is a complete “plug-and-play” dynamic code generator that can be integrated into any application in a matter of minutes, or used as the backend for a dynamically-compiled language or “just-in-time” compiler.
The paper describes the feature set and execution model of the VPU from the client’s point of view, the implementation of the VPU, from the API through to the generation of native code (and most of the important algorithms in between). Further, it presents a few performance measurements, and finally offers conclusions and perspectives.
Download Seminar Report
0 comments