Daniele Cono D'Elia edited intro.tex  over 8 years ago

Commit id: fb1905013e6bd9480726ecd684d6f61aacb0d296

deletions | additions      

       

Currently VM builders using MCJIT are required to have a deep knowledge of the internals of LLVM in order to mimic a transitioning mechanism. In particular, they can rely on two experimental intrinsics, {\em Stackmap} and {\em Patchpoint}, to inspect the details of the compiled code generated by the back-end and to patch it manually with a sequence of assembly instructions. In particular, a Stackmap records the location of live values at a particular instruction address and during the compilation it is emitted into the object code within a designated section; a Patchpoint instead allows to reserve space at an instruction address for run-time patching and can be used to implement an inline caching mechanism~\cite{deutsch1984inlinecaching}.    In a 2013 paper Lameed and Hendren propose McOSR~\cite{lameed2013modular}, a technique for OSR that essentially stores the live values in a global buffer, recompiles the current function and then loads in it the saved state when the execution is resumed. Their approach shows a few limitations that we discuss later on in this paper, and because of some relevant design choices it can work only with the legacy JIT which that  has been dropped from recent LLVM releases. since LLVM's release 3.6.  \paragraph{Contributions.}  In this paper we present our novel, platform-independent framework for LLVM to enable switching between different versions of a function at run-time. Specific goals of our approach include: