1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00
llvm-mirror/include/llvm/ExecutionEngine
Lang Hames 8532e51cf2 [ExecutionEngine] Make RuntimeDyld::MemoryManager responsible for tracking EH
frames.

RuntimeDyld was previously responsible for tracking allocated EH frames, but it
makes more sense to have the RuntimeDyld::MemoryManager track them (since the
frames are allocated through the memory manager, and written to memory owned by
the memory manager). This patch moves the frame tracking into
RTDyldMemoryManager, and changes the deregisterFrames method on
RuntimeDyld::MemoryManager from:

void deregisterEHFrames(uint8_t *Addr, uint64_t LoadAddr, size_t Size);

to:

void deregisterEHFrames();

Separating this responsibility will allow ORC to continue to throw the
RuntimeDyld instances away post-link (saving a few dozen bytes per lazy
function) while properly deregistering frames when modules are unloaded.

This patch also updates ORC to call deregisterEHFrames when modules are
unloaded. This fixes a bug where an exception that tears down the JIT can then
unwind through dangling EH frames that have been deallocated but not
deregistered, resulting in UB.

For people using SectionMemoryManager this should be pretty much a no-op. For
people with custom allocators that override registerEHFrames/deregisterEHFrames,
you will now be responsible for tracking allocated EH frames.

Reviewed in https://reviews.llvm.org/D32829

llvm-svn: 302589
2017-05-09 21:32:18 +00:00
..
Orc [ExecutionEngine] Make RuntimeDyld::MemoryManager responsible for tracking EH 2017-05-09 21:32:18 +00:00
ExecutionEngine.h [ExecutionEngine] Document the insane ownership contract for 2016-11-04 22:29:34 +00:00
GenericValue.h Add missing #include to fix build 2016-04-16 17:39:40 +00:00
Interpreter.h
JITEventListener.h [ExecutionEngine] Fix some Clang-tidy modernize-use-default, modernize-use-equals-delete and Include What You Use warnings; other minor fixes. 2016-11-16 18:07:33 +00:00
JITSymbol.h [ExecutionEngine] Fix some Clang-tidy modernize-use-default, modernize-use-equals-delete and Include What You Use warnings; other minor fixes. 2016-11-16 18:07:33 +00:00
MCJIT.h
ObjectCache.h [ExecutionEngine] Fix some Clang-tidy modernize-use-default, modernize-use-equals-delete and Include What You Use warnings; other minor fixes. 2016-11-16 18:07:33 +00:00
ObjectMemoryBuffer.h Use StringRef for MemoryBuffer identifier API (NFC) 2016-10-01 16:38:28 +00:00
OProfileWrapper.h
OrcMCJITReplacement.h
RTDyldMemoryManager.h [ExecutionEngine] Make RuntimeDyld::MemoryManager responsible for tracking EH 2017-05-09 21:32:18 +00:00
RuntimeDyld.h [ExecutionEngine] Make RuntimeDyld::MemoryManager responsible for tracking EH 2017-05-09 21:32:18 +00:00
RuntimeDyldChecker.h Make llvm-rtdlyd -check preserve automatic address mappings made by RuntimeDyld. 2017-05-07 17:19:53 +00:00
SectionMemoryManager.h [ExecutionEngine] Fix some Clang-tidy modernize-use-default, modernize-use-equals-delete and Include What You Use warnings; other minor fixes. 2016-11-16 18:07:33 +00:00