about summary refs log tree commit diff homepage
path: root/lib/CMakeLists.txt
diff options
context:
space:
mode:
authorDan Liew <daniel.liew@imperial.ac.uk>2017-05-24 12:57:48 +0100
committerDan Liew <delcypher@gmail.com>2017-05-24 14:24:47 +0100
commit5dd3eee423c866aac6659dc2db44310737cf201d (patch)
tree900559852fc063cb5acf4d4ad594a41234858678 /lib/CMakeLists.txt
parenta3e82239a74cdc43c44bd5200434cb48c7dd1edb (diff)
downloadklee-5dd3eee423c866aac6659dc2db44310737cf201d.tar.gz
Rearchitect ExternalDispatcher
Previous changes for LLVM 3.6 using the MCJIT were incredibly hacky.
Those changes required creating and destroying the ExternalDispatcher
for every call to an external function. This is really bad

* It's very poor design. The Executor should not need to know
  about the internal implementation details of the ExternalDispatcher.
* It's likely very inefficient to keep creating and destroying the
  external dispatcher.

The new code does several things.

* Moves all of the implementation details into a `ExternalDispatcherImpl`
  class so that implementation details are not exposed in
  `ExternalDispatcher.h`.
* When using the MCJIT a module is compiled for every (instruction, function)
  tuple. This is necessary because the MCJIT compiles whole modules at a
  time and once a module is compiled it cannot be modified and
  re-compiled. Doing this means we get to reuse already generated code
  for call sites which hopefully will reduce the overhead of repeatedly
  executing the same call site.

A consequence of this change is that now the dispatcher function name
needs to be unique across all modules. To do this we just append the
module name because we guarantee that the module name is unique by
construction.

The code has also been clang-formatted.
Diffstat (limited to 'lib/CMakeLists.txt')
0 files changed, 0 insertions, 0 deletions