Camil Demetrescu edited approach.tex  over 8 years ago

Commit id: 76ec7a693c99a75c6785f0db8905d21bd22f72fa

deletions | additions      

       

In the resolved OSR scenario (see \ifauthorea{Figure~}{}\ref{fi:overview-osr-final}), instrumentation consists of adding a check of the OSR condition and, if it is satisfied, a tail call that fires the OSR. The called function is an instrumented version of \fvariant, which we call \fosrto. The assumption is that \fosrto\ produces the same side-effects and return value that one would obtain by \fbase\ if no OSR was performed. Differently from \fvariant, \fosrto\ takes as input all live variables of \fbase\ at \osrpoint, executes an optional compensation code to fix the computation state ({\tt comp\_code}), and then jumps to a point \textsf{L'} from which execution can continue. The OSR practice often makes the conservative assumption that execution can always continue with the very same program state as the base function. However, this assumption may reduce the number of points where sound OSR transitions can be fired. Supporting compensation code in our framework adds flexibility, allowing OSR transitions to happen at arbitrary places in the base function.  The open OSR scenario is the same, with one exception: exception (see \ifauthorea{Figure~}{}\ref{fi:overview-osr-open}):  instead of calling \fosrto\ directly, \fosrfrom\ calls a stub function \fstub, which first creates \fosrto\ and then calls it. Function \fosrto\ is generated by a function {\tt gen} starting from the base function \fbase\ and the OSR point \osrpoint. %\ref{fi:overview-osr-final}