[LLVMdev] How will OrcJIT guarantee thread-safety when a function is asked to be re generated?
sanjoy at playingwithpointers.com
Thu Mar 19 10:55:32 PDT 2015
> That all makes sense. What are your thoughts on the trade-offs of this vs
> the patchpoint approach though? If you can modify previously executable
> memory it seems like the patchpoint approach would have lower overhead,
> unless you have a truly huge number of callsites to update?
You need the hijack-return-pc approach *in addition* to a call-site
patching approach. Modifying the return PC lets you guarantee that
nothing will *return* into the old generated code. To guarantee that
nothing will *call* into it either you could use a double indirection
(all calls go through a trampoline) or patchpoints.
More information about the llvm-dev