[LLVMdev] MC-JIT (any progress?)

Jim Grosbach grosbach at apple.com
Thu Jun 30 09:21:02 PDT 2011


On Jun 29, 2011, at 4:36 PM, Yuri wrote:

> On 06/24/2011 13:23, Jim Grosbach wrote:
>>> Any progress with this?
>>> gitorious page shows the last update on Jul 27, 2010.
>>>     
>> There's basics for an MC JIT implemented now, but it's not yet full featured enough to replace the old JIT. Have a look at ExecutionEnginer/RuntimeDyld and ExecutionEngine/MCJIT.
>> 
>> It's usable enough for some things; for example, dynamic expression evaluation in lldb. The biggest gaps are more thorough relocation support and lazy compilation.
>>   
> 
> Does it, or does it plan to write binary PIC code into the continuous memory area which can be saved and restored if needed? I was thinking, maybe I am mistaken, that the plan was to write code in memory as ELF which can be exported/imported as such. Is this the case?

The current implementation uses MachO binaries in memory. There's no reason they couldn't be serialized to disk. The llvm-rtdyld tool gives an example of using the MCJIT RuntimeDyld support to load an object file from memory and use it directly.

The idea is that the object module will be loaded/JITed, then registered with the RuntimeDyld which will extract the functions, data, etc.. from the object and register them with the JIT memory manager and perform any relocations necessary. That will allow having the running program be in a separate address space (or a remote target) than where the compilation/loading is taking place, for example.

For platforms that want ELF instead of MachO, it should be straightforward to implement a similar structure with proper subclassing and such of the RuntimeDyld interfaces. That's not there, currently, however.

-Jim



More information about the llvm-dev mailing list