[PATCH] D47343: [MCJIT] Call JIT notifiers only after code sections are ready.

Lang Hames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 29 19:09:10 PDT 2018


lhames added a comment.

In https://reviews.llvm.org/D47343#1111668, @anarazel wrote:

> > This patch doesn't affect any of my use-cases, but it's possible that some clients are relying on the fact that memory will still be writable at this point.
>
> Would that ever be a safe thing to do? Even if, I've a hard time seeing when that'd be a reasonable solution. Not that hacks necessarily have to be reasonable.  The other in-tree users of event listeners at least don't care...


I have backwards compatibility with unreasonable hacks in mind here. :)

>> As an alternative: ORC's RTDyldObjectLinkingLayer has a NotifyFinalized callback that is called in the equivalent location (i.e. after finalizeMemory has been called). If we want to maintain behavior for existing MCJIT clients it seems reasonable to add a matching "NotifyFinalized" callback to MCJIT.
> 
> That'd make sense. OTOH, afaict it'd require changing all the existing notifier users, because they all would want the new thing.
> 
> Now that https://reviews.llvm.org/D44890 has landed, I care a bit less. I was mostly bothered because without either https://reviews.llvm.org/D44890 or this, I was unable to test https://reviews.llvm.org/D44892.

Ok. If this is no longer urgent I'll close this revision and revisit the alternative (adding NotifyFinalized) in the future. Does that sound ok to you?


Repository:
  rL LLVM

https://reviews.llvm.org/D47343





More information about the llvm-commits mailing list