[LLVMdev] GSOC Adaptive Compilation Framework for LLVM JIT Compiler

Eric Christopher echristo at apple.com
Thu Mar 31 20:07:43 PDT 2011


> 
> 
> 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



More information about the llvm-dev mailing list