[llvm-dev] JIT-Client for Shared Memory

Gaier, Bjoern via llvm-dev llvm-dev at lists.llvm.org
Thu Nov 1 23:49:25 PDT 2018


Hello everyone,

I want to use the LLVM to write a JIT client, that works with shared memory. Currently I proceed as following:

I wrote an own class that inherits "RTDyldMemoryManager". The functions "allocateCodeSection" and "allocateDataSection" are allocating local non-shared memory. I store there addresses in a std::vector.
When the function "notifyObjectLoaded" is invoked, I allocate the shared memory - I'm getting the size from the local non-shared memory - and apply the address mapping.
When the function "finalizeMemory" is invoked I copy the code from the local non-shared memory to the shared memory but only one time.

So far so good, this works actually good! Yippie x3

BUT... There is one problem. The shared memory can't be dynamical adjusted. So if I add another module to the current module, then I would go through this process again! Not the "finalizeMemory" process though, but I would allocate another shared memory. This is not what I want! Currently I use the linker first, to work around this problem, but this will not help me if I add object files or libraries to the JIT process - or does it?

So is there any way to work around this?

Kind greetings
Björn
Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816, USt.ID-Nr. DE 114 165 789 Geschäftsführer: Dr. Hiroshi Nakamura, Dr. Robert Plank, Markus Bode, Heiko Lampert, Takashi Nagano, Takeshi Fukushima. Junichi Tajika
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181102/fd2759eb/attachment.html>


More information about the llvm-dev mailing list