<div dir="rtl"><div dir="ltr">Hi,</div><div dir="ltr"><br></div><div dir="ltr">I'm trying to transition from the JIT to MCJIT. The requirements are fast response time and dynamic unloading/replacement of modified functions. Lazy evaluation is *not* required: I expect all functions to be present at runtime or else an error is fine.</div>

<div dir="ltr"><br></div><div dir="ltr">With the JIT it's quite simple to unload and replace functions due to the stubs (JMP instructions) that redirect the actual function calls.</div><div dir="ltr"><br></div><div dir="ltr">

With the MCJIT the equivalent implementation would be: </div><div dir="ltr"><br></div><div dir="ltr">1) Place one function per IR module.</div><div dir="ltr">2) Load (compile) IR modules into Object code and cache the objects.</div>

<div dir="ltr">3) Upon running finalize (link) everything and run.</div><div dir="ltr">4) If a function is changed, kill its module and reload it. Then use the cached objects and finalize everything.</div><div dir="ltr">
<br>
</div><div dir="ltr">Compared with the JIT, 4) isn't scalable, since it requires relinking of possibly  many modules due to the change of just one function.</div><div dir="ltr"><br></div><div dir="ltr">I wonder if it's possible to use the stub function mechanism in order to save the relinking step. The dynamic linker can resolve everything to the stub functions that jump to real functions but then the function implementation could be replaced in a new module without relinking all other modules but itself only.</div>

<div dir="ltr"><br></div><div dir="ltr">We'd also need a way to modify the EH and Debug information without recreating it.</div><div dir="ltr"><br></div><div dir="ltr">That would provide a reasonable replacement for the JIT flexibility in handling functions. Does it make any sense?</div>

<div dir="ltr"><br></div><div dir="ltr">Yaron</div><div dir="ltr"><br></div></div>