[LLVMdev] GSOC Adaptive Compilation Framework for LLVM JIT Compiler

Xin Tong Utoronto x.tong at utoronto.ca
Thu Mar 31 20:13:36 PDT 2011


On Thu, Mar 31, 2011 at 11:07 PM, Eric Christopher <echristo at apple.com>wrote:

> >
> >
> > No we will always have control over where the parent calls the functions
> that we are recompiling. As explained in the example below
> >
> > Original Code
> >
> > Binary for A:         Binary for B:
> >
> > ...                         ...
> > ...                         ...
> > br B                      ...
> > ...                         ...
> > ...
> >
> > After B is recompiled, we patch the entry of B with br helper
> >
> > Binary for A:         Binary for B:        Binary for Recompiled B
> > ...                        br helper              ...
> > ...                        ...                        ...
> > br B                     ...                        ...
> > ...
> > ...
> >
> >
> > now when the parent A calls B, B branches to the helper, we will get the
> address of br B from the return address pushed onto the
> > stack or saved in the link register. The helper then patches the callsite
> in A
> >
> > After Patching
> >
> > Binary for A:               Binary for B:        Binary for Recompiled B
> > ...                               br helper             ...
> > ...                               ...                       ...
> > br Recompiled B          ...                       ...
> > ...
> > ...
> >
>
> Your helper is what I'm calling a stub (and what they're called in the jit
> at the moment).
>
> -eric
>

Then we would always have the location of the br B instruction in A, as it
is pushed onto the stack or saved in link register when A calls B.



-- 
Kind Regards

Xin Tong
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110331/a9b58037/attachment.html>


More information about the llvm-dev mailing list