Compiler-Guaranteed Safety in Code-Copying Virtual Machines

  • Gregory B. Prokopski
  • Clark Verbrugge
Conference paper

DOI: 10.1007/978-3-540-78791-4_11

Part of the Lecture Notes in Computer Science book series (LNCS, volume 4959)
Cite this paper as:
Prokopski G.B., Verbrugge C. (2008) Compiler-Guaranteed Safety in Code-Copying Virtual Machines. In: Hendren L. (eds) Compiler Construction. CC 2008. Lecture Notes in Computer Science, vol 4959. Springer, Berlin, Heidelberg


Virtual Machine authors face a difficult choice between low performance, cheap interpreters, or specialized and costly compilers. A method able to bridge this wide gap is the existing code-copying technique that reuses chunks of the VM’s binary code to create a simple JIT. This technique is not reliable without a compiler guaranteeing that copied chunks are still functionally equivalent despite aggressive optimizations. We present a proof-of-concept, minimal-impact modification of a highly optimizing compiler, GCC. A VM programmer marks chunks of VM source code as copyable. The chunks of native code resulting from compilation of the marked source become addressable and self-contained. Chunks can be safely copied at VM runtime, concatenated and executed together. This allows code-copying VMs to safely achieve speedup up to 3 times, 1.67 on average, over the direct interpretation. This maintainable enhancement makes the code-copying technique reliable and thus practically usable.

Download to read the full conference paper text

Copyright information

© Springer-Verlag Berlin Heidelberg 2008

Authors and Affiliations

  • Gregory B. Prokopski
    • 1
  • Clark Verbrugge
    • 1
  1. 1.Sable Research Group School of Computer ScienceMcGill UniversityMontrealCanada

Personalised recommendations