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

Commit id: 74ae34e1444f924d04e8e73ed8d6c907cef7bd33

deletions | additions      

       

% TODO only if we have space: HotpathVM  \paragraph{LLVM.} \paragraph{Prospect.}  Prospect~\cite{susskraut2010prospect} is a an LLVM-based  framework for the parallelization parallelizing  of a sequential application that runs a fast variant and a slow variant of the code. application.  The IR is instrumentedstatically  through two LLVM passes to enable switching at run-time  between a slow and a fast variant of  the two variants at run-time; helper code, which are both compiled statically. Helper  methods are used to save and eventually restore registers, while stack-local variables are put on a separate {\tt alloca} stack rather than on the stack frame so that the two variants result into similar and thus interchangeable stack layouts. Speculative variables~\cite{susskraut2009speculation} are introduced when the slow variant needs to track state (e.g., information for out-of-bound checks) that is missing in the fast variant. Switching operations are performed by Prospect at user-specified checkpoints in the original code. \paragraph{McOSR.}  McOSR~\cite{lameed2013modular} is a library for the LLVM legacy JIT compiler to insert OSR points at loop headers. When an OSR transition is fired, the live state is saved into a set of global variables (one per live variable) and a helper method is invoked to modify the IR of the function using a code transformer provided by the front-end and a copy of the original code saved as control version. The library generates a new entrypoint for the function to check a global condition and discriminate whether the function is being invoked through an OSR transition or a regular call: in the first case, values for live variables are read from the associated global variables, and the execution jumps to the block to resume the execution at. The SSAUpdater component of LLVM is then used to restore the SSA form after the update. When the helper method returns, the updated function is invoked and the OSR is thus performed in a new stack frame. When the updated function returns, a second helper method is called to recompile the updated function to remove the new entrypoint inserted for the OSR transition, as it can disrupt LLVM optimizations and lead to poorer performance on subsequent invocations of the function. \paragraph{Other Related Work.}  Dynamic Software Updating (DSU) is a methodology for permitting programs to be updated while they run and is thus useful for systems that cannot afford to halt service. DSU techniques (e.g. ~\cite{neamtiu2006dsu,makris2009dsu}) are required to update all functions active on the call stack at the same time, so their code should be instrumented and data types wrapped to support future extensions.