1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
llvm-mirror/lib/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
..
IntelJITEvents [CMake] Fix pthread handling for out-of-tree builds 2017-02-10 01:59:20 +00:00
Interpreter [APInt] Use inplace shift methods where possible. NFCI 2017-04-28 03:36:24 +00:00
MCJIT Use StringRef instead of raw pointer in ExecutionEngine 2016-10-01 06:22:04 +00:00
OProfileJIT [ExecutionEngine] Fix compile errors in OProfileJITEventListener. 2017-01-03 21:39:43 +00:00
Orc [ExecutionEngine] Make RuntimeDyld::MemoryManager responsible for tracking EH 2017-05-09 21:32:18 +00:00
RuntimeDyld [ExecutionEngine] Make RuntimeDyld::MemoryManager responsible for tracking EH 2017-05-09 21:32:18 +00:00
CMakeLists.txt [ExecutionEngine][RuntimeDyld] Move JITSymbol from ExecutionEngine to RuntimeDyld. 2016-08-07 01:19:37 +00:00
ExecutionEngine.cpp Use MutableArrayRef for APFloat::convertToInteger 2017-03-20 14:40:12 +00:00
ExecutionEngineBindings.cpp Rename AttributeSet to AttributeList 2017-03-21 16:57:19 +00:00
GDBRegistrationListener.cpp Do a sweep over move ctors and remove those that are identical to the default. 2016-10-20 12:20:28 +00:00
LLVMBuild.txt add missing dependency for ExecutionEngine lib 2015-06-01 21:56:56 +00:00
SectionMemoryManager.cpp Use the range variant of remove_if instead of unpacking begin/end 2016-08-12 04:32:37 +00:00
TargetSelect.cpp Use the range variant of find/find_if instead of unpacking begin/end 2016-08-12 03:55:06 +00:00