[ORC] Introduce deferred allocation-actions scheme for MachOPlatform bootstrap.
This patch modifies the MachOPlatform bootstrap process to record allocation actions for ORC runtime platform support code in a "deferred actions" vector rather than attaching it to the corresponding LinkGraphs up-front. The deferred allocation-actions are run after all the platform support code has been loaded by attaching them to a separate "bootstrap-complete" graph. This change should allow the mach-o platform support code in the ORC runtime to use advanced mach-o platform features (e.g. static inits, TLVs), provided that the support code does not use these features at runtime before the bootstrap process completes, or after the shutdown process starts. This is a nice improvement in and of itself but is motivated by specific future plans: we want to start recording unwind info in the mach-o platform state object*, and the recording functions will have their own frame info that needs registering. The deferred allocation-actions scheme allows for this. * The plan is to add a new unwind-info-lookup path to libunwind to allow it to call back to the ORC runtime to find unwind sections. This will simplify the implementation of support for JIT'd compact-unwind info.
parent
a5ddd920
Please register or sign in to comment