|
|
|
|
|
by lhames
1031 days ago
|
|
Regarding LLVM's JIT infrastructure: You can plug your own compiler into it if LLVM is not fast enough. You can also mix and match multiple compilers within a single JIT'd program. The LLVM JIT APIs operate in terms of abstract "materialization", and provide an in-memory, just-in-time linker to link object files into the process. You just have to write a materializer that calls your compiler, then hands the object back to the LLVM JIT APIs to be linked. The advantage you get from using LLVM's JIT APIs to wrap your compiler are:
1) It can manage compilation requests from multiple threads of JIT'd code, and it can dispatch compilation work to multiple threads (or other processes).
2) It has built in support for lazy compilation, so you don't need to write this part yourself.
3) It can JIT across process boundaries (and architecture, object format and OS boundaries).
4) It supports many object format features (e.g. exceptions, general dynamic TLS, static initializers, etc.) |
|