diff options
author | Nate Begeman <natebegeman@mac.com> | 2009-02-18 08:31:02 +0000 |
---|---|---|
committer | Nate Begeman <natebegeman@mac.com> | 2009-02-18 08:31:02 +0000 |
commit | d6b7a242d345fd79a337afd384bb586c5619cfe7 (patch) | |
tree | cc149d70595f6859c7607a5129ce01ce9a98e0bb /include/llvm/ExecutionEngine | |
parent | 98c507ed5c2883bc8ef487d952e851da37f8b32f (diff) | |
download | external_llvm-d6b7a242d345fd79a337afd384bb586c5619cfe7.zip external_llvm-d6b7a242d345fd79a337afd384bb586c5619cfe7.tar.gz external_llvm-d6b7a242d345fd79a337afd384bb586c5619cfe7.tar.bz2 |
Add support to the JIT for true non-lazy operation. When a call to a function
that has not been JIT'd yet, the callee is put on a list of pending functions
to JIT. The call is directed through a stub, which is updated with the address
of the function after it has been JIT'd. A new interface for allocating and
updating empty stubs is provided.
Add support for removing the ModuleProvider the JIT was created with, which
would otherwise invalidate the JIT's PassManager, which is initialized with the
ModuleProvider's Module.
Add support under a new ExecutionEngine flag for emitting the infomration
necessary to update Function and GlobalVariable stubs after JITing them, by
recording the address of the stub and the name of the GlobalValue. This allows
code to be copied from one address space to another, where libraries may live
at different virtual addresses, and have the stubs updated with their new
correct target addresses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64906 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ExecutionEngine')
-rw-r--r-- | include/llvm/ExecutionEngine/ExecutionEngine.h | 8 | ||||
-rw-r--r-- | include/llvm/ExecutionEngine/JITMemoryManager.h | 11 |
2 files changed, 19 insertions, 0 deletions
diff --git a/include/llvm/ExecutionEngine/ExecutionEngine.h b/include/llvm/ExecutionEngine/ExecutionEngine.h index 3559ede..0c53a53 100644 --- a/include/llvm/ExecutionEngine/ExecutionEngine.h +++ b/include/llvm/ExecutionEngine/ExecutionEngine.h @@ -66,6 +66,7 @@ class ExecutionEngine { bool LazyCompilationDisabled; bool GVCompilationDisabled; bool SymbolSearchingDisabled; + bool DlsymStubsEnabled; protected: /// Modules - This is a list of ModuleProvider's that we are JIT'ing from. We @@ -288,6 +289,13 @@ public: return SymbolSearchingDisabled; } + /// EnableDlsymStubs - + void EnableDlsymStubs(bool Enabled = true) { + DlsymStubsEnabled = Enabled; + } + bool areDlsymStubsEnabled() const { + return DlsymStubsEnabled; + } /// InstallLazyFunctionCreator - If an unknown function is needed, the /// specified function pointer is invoked to create it. If it returns null, diff --git a/include/llvm/ExecutionEngine/JITMemoryManager.h b/include/llvm/ExecutionEngine/JITMemoryManager.h index 61c3443..581300e 100644 --- a/include/llvm/ExecutionEngine/JITMemoryManager.h +++ b/include/llvm/ExecutionEngine/JITMemoryManager.h @@ -62,6 +62,17 @@ public: /// return a pointer to its base. virtual unsigned char *getGOTBase() const = 0; + /// SetDlsymTable - If the JIT must be able to relocate stubs after they have + /// been emitted, potentially because they are being copied to a process + /// where external symbols live at different addresses than in the JITing + /// process, allocate a table with sufficient information to do so. + virtual void SetDlsymTable(void *ptr) = 0; + + /// getDlsymTable - If this is managing a table of entries so that stubs to + /// external symbols can be later relocated, this method should return a + /// pointer to it. + virtual void *getDlsymTable() const = 0; + /// NeedsExactSize - If the memory manager requires to know the size of the /// objects to be emitted bool NeedsExactSize() const { |