Camil Demetrescu edited intro.tex  over 8 years ago

Commit id: 4e2c43c634853c227712195750b2f5e50df51455

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{webkit14}.%~\cite{deutsch1984inlinecaching, webkit14}.  %In a 2013 paper  Lameed and Hendren propose McOSR~\cite{lameed2013modular}, a technique for OSR that 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 in \mysection\ref{se:osr-llvm}, and due to some relevant design choices, it works with McOSR was designed for  the legacy JIT that is no longer included in LLVM since release 3.6. 3.6 and has some limitations that we discuss in \mysection\ref{se:osr-llvm}.  \paragraph{Contributions.}  In this paper we investigate general-purpose, target-independent implementations of on-stack replacement. Specific goals of our approach include: