Daniele Cono D'Elia edited case-study.tex  over 8 years ago

Commit id: 742969a756f9c9ca0a91876d037bc746e5e334f1

deletions | additions      

       

\subsection{Generating optimized code}  The core of the optimization pipeline is the callback optimizer component, that is responsible for generating optimized code for the current function $f$ using profiling (i.e., the object containing the first argument for \feval\) and contextual information passed from the open-OSR stub. As a first step, the optimizer will process the profiling object to resolve the target of the call, which we call $g$.   %TODO dire del code caching  A new function $f_{OSR}$ $f_{opt}$  is then generated by cloning the IIR representation $f^{IIR}$ of $f$ into $f^{IIR}_{OSR}$ $f^{IIR}_{opt}$  and replacing all the \feval\ calls in the same group of the instrumented one with direct calls to $g$. As a next step, the optimizer asks the IIR compiler to generate IR code for $f^{IIR}_{OSR}$, $f^{IIR}_{opt}$,  also saving a copy of the variable map when compiling the direct call corresponding to the \feval\ instruction that triggered the OSR transition. This variable map is compared against the variable map stored during the lowering phase for $f$