summaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/JIT/JITMemoryManager.cpp
Commit message (Collapse)AuthorAge
* Remove duplicate includes.Roman Divacky2012-12-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170902 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-03
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169131 91177308-0d34-0410-b5e6-96231b3b80d8
* Interface changes to allow RuntimeDyld memory managers to set memory ↵Andrew Kaylor2012-11-15
| | | | | | permissions after an object has been loaded. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168114 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed a problem in the JIT memory allocator whereSean Callanan2012-08-15
| | | | | | | | | | | allocations of executable memory would not be padded to account for the size of the allocation header. This resulted in undersized allocations, meaning that when the allocation was written to later the next allocation's header would be corrupted. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161984 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix some formatting, grammar and style issues and add a couple of missing ↵Eli Bendersky2012-04-29
| | | | | | comments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155793 91177308-0d34-0410-b5e6-96231b3b80d8
* Move getPointerToNamedFunction() from JIT/MCJIT to JITMemoryManager.Danil Malyshev2012-03-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153607 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert a series of commits to MCJIT to get the build working in CMakeChandler Carruth2012-03-22
| | | | | | | | | | | | | | | (and hopefully on Windows). The bots have been down most of the day because of this, and it's not clear to me what all will be required to fix it. The commits started with r153205, then r153207, r153208, and r153221. The first commit seems to be the real culprit, but I couldn't revert a smaller number of patches. When resubmitting, r153207 and r153208 should be folded into r153205, they were simple build fixes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153241 91177308-0d34-0410-b5e6-96231b3b80d8
* Based on this discussion: ↵Danil Malyshev2012-03-21
| | | | | | | | | http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20120305/138477.html 1. Declare a virtual function getPointerToNamedFunction() in JITMemoryManager 2. Move the implementation of getPointerToNamedFunction() form JIT/MCJIT to DefaultJITMemoryManager. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153205 91177308-0d34-0410-b5e6-96231b3b80d8
* MCJIT support for non-function sections.Jim Grosbach2012-01-16
| | | | | | | | | | | | | | | | Move to a by-section allocation and relocation scheme. This allows better support for sections which do not contain externally visible symbols. Flesh out the relocation address vs. local storage address separation a bit more as well. Remote process JITs use this to tell the relocation resolution code where the code will live when it executes. The startFunctionBody/endFunctionBody interfaces to the JIT and the memory manager are deprecated. They'll stick around for as long as the old JIT does, but the MCJIT doesn't use them anymore. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148258 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge System into Support.Michael J. Spencer2010-11-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120298 91177308-0d34-0410-b5e6-96231b3b80d8
* Use twines to simplify calls to report_fatal_error. For code size and ↵Benjamin Kramer2010-04-08
| | | | | | readability. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100756 91177308-0d34-0410-b5e6-96231b3b80d8
* rename llvm::llvm_report_error -> llvm::report_fatal_errorChris Lattner2010-04-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100709 91177308-0d34-0410-b5e6-96231b3b80d8
* Change errs() to dbgs().David Greene2010-01-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92562 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typo, cleanup whitespace.Eric Christopher2009-11-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86917 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove dlsym stubs, with Nate Begeman's permission.Jeffrey Yasskin2009-11-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86606 91177308-0d34-0410-b5e6-96231b3b80d8
* Verify that the function and exception table have been allocatedNicolas Geoffray2009-10-22
| | | | | | | | before freeing them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84859 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the Function*->allocated blocks map from the JITMemoryManager to theJeffrey Yasskin2009-10-20
| | | | | | | | | | | | | | | | | JITEmitter. I'm gradually making Functions auto-remove themselves from the JIT when they're destroyed. In this case, the Function needs to be removed from the JITEmitter, but the map recording which Functions need to be removed lived behind the JITMemoryManager interface, which made things difficult. This patch replaces the deallocateMemForFunction(Function*) method with a pair of methods deallocateFunctionBody(void *) and deallocateExceptionTable(void *) corresponding to the two startFoo/endFoo pairs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84651 91177308-0d34-0410-b5e6-96231b3b80d8
* Initialize the PoisonMemory member before initializingDan Gohman2009-08-27
| | | | | | | | | | members that call methods that read the PoisonMemory member. This fixes potential spurious (though probably otherwise harmless) poising of unused memory, and fixes the associated valgrind error. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80192 91177308-0d34-0410-b5e6-96231b3b80d8
* remove a few DOUTs here and there.Chris Lattner2009-08-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79832 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug where the DWARF emitter in the JIT was not initializing alignmentReid Kleckner2009-08-21
| | | | | | | | | | | | bytes. libgcc doesn't seem to mind, but if you pass this DWARF to GDB, it doesn't like it. Also make the JIT memory manager to initialize it's memory to garbage in debug mode, so that it's easier to find bugs like these in the future. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79674 91177308-0d34-0410-b5e6-96231b3b80d8
* This void is implicit in C++.Dan Gohman2009-08-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78848 91177308-0d34-0410-b5e6-96231b3b80d8
* In TrimAllocationToSize, if a block is below the minimum allocation size,Nicolas Geoffray2009-07-29
| | | | | | | | | there is no new block added to the free list. Therefore on the next startFunctionBody call, a new slab must be allocated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77520 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-committing r76828 with the JIT memory manager changes now that the buildReid Kleckner2009-07-23
| | | | | | | bots like the BumpPtrAllocator changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76902 91177308-0d34-0410-b5e6-96231b3b80d8
* Reverting r76825 and r76828, since they caused clang runtime errors and some ↵Reid Kleckner2009-07-23
| | | | | | build failure involving memset. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76838 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the JIT code emitter properly retry and ask for more memory when it runsReid Kleckner2009-07-23
| | | | | | | | | | | | | | out of memory, and also make the default memory manager allocate more memory when it runs out. Also, switch function stubs and global data over to using the BumpPtrAllocator. This makes it so the JIT no longer mmaps (or the equivalent on Windows) 16 MB of memory, and instead allocates in 512K slabs. I suspect this size could go lower, especially on embedded platforms, now that more slabs can be allocated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76828 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert more assert(0)+abort() -> LLVM_UNREACHABLE,Torok Edwin2009-07-11
| | | | | | | and abort()/exit() -> llvm_report_error(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75363 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an option to allocate JITed global data separately from code. ByJeffrey Yasskin2009-07-08
| | | | | | | | | | | | | | | default, this option is not enabled to support clients who rely on this behavior. Fixes http://llvm.org/PR4483 A patch to allocate additional memory for globals after we run out is forthcoming. Patch by Reid Kleckner! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75059 91177308-0d34-0410-b5e6-96231b3b80d8
* Use uint8_t and int32_t in {JIT,Machine}CodeEmitersBruno Cardoso Lopes2009-06-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72821 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 72650Bruno Cardoso Lopes2009-06-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72783 91177308-0d34-0410-b5e6-96231b3b80d8
* Use uint8_t and int32_t in {JIT,Machine}CodeEmitersBruno Cardoso Lopes2009-05-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72650 91177308-0d34-0410-b5e6-96231b3b80d8
* Use CHAR_BIT instead of hard-coding 8 in several places where itDan Gohman2009-04-01
| | | | | | | | is appropriate. This helps visually differentiate host-oriented calculations from target-oriented calculations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68227 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR3724 by searching for the largest free block when Chris Lattner2009-03-09
| | | | | | | | | | allocating memory in the JIT. This is insanely inefficient, but hey, most people implement their own memory managers anyway. Patch by Eric Yew! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66472 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support to the JIT for true non-lazy operation. When a call to a functionNate Begeman2009-02-18
| | | | | | | | | | | | | | | | | | | | | 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
* fix a tricky bug in the JIT global variable emitter, that was triggered when ↵Nuno Lopes2008-10-21
| | | | | | JITing a variable independently of a function. This lead to sharing memory memory between functions and GVs thus changing the value of a GV could change the code in execution. more details on the ML. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57900 91177308-0d34-0410-b5e6-96231b3b80d8
* Add <cstdio> include where needed by gcc-4.4.Duncan Sands2008-10-08
| | | | | | | Patch by Samuel Tardieu. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57291 91177308-0d34-0410-b5e6-96231b3b80d8
* On Darwin ARM, memory needs special handling to do JIT. This patch expandsJim Grosbach2008-10-03
| | | | | | | | this handling to work properly for modifying stub functions, relocations back to entry points after JIT compilation, etc.. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57013 91177308-0d34-0410-b5e6-96231b3b80d8
* Preliminary support for systems which require changing JIT memory regions ↵Evan Cheng2008-09-18
| | | | | | privilege from read / write to read / executable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56303 91177308-0d34-0410-b5e6-96231b3b80d8
* Rewrite JIT handling of GlobalVariables so theyDale Johannesen2008-08-07
| | | | | | | | | | | | | | | | are allocated in the same buffer as the code, jump tables, etc. The default JIT memory manager does not handle buffer overflow well. I didn't introduce this and I'm not attempting to fix it here, but it is more likely to be hit now since we're putting more stuff in the buffer. This affects one test that I know of so far, MultiSource/Benchmarks/NPB-serial/is. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54442 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix for PR2578. Do not split off a block whose size is less than ↵Evan Cheng2008-07-29
| | | | | | FreeRangeHeader::getMinBlockSize(). Patch by Damien. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54152 91177308-0d34-0410-b5e6-96231b3b80d8
* Use static_cast instead of reinterpret_cast for casting void*.Dan Gohman2008-06-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52592 91177308-0d34-0410-b5e6-96231b3b80d8
* Correlate stubs with functions in JIT: when emitting a stub, the JIT tells ↵Nicolas Geoffray2008-04-16
| | | | | | | | | | the memory manager which function the stub will resolve. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49814 91177308-0d34-0410-b5e6-96231b3b80d8
* fix 80 col violationsChris Lattner2008-03-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48019 91177308-0d34-0410-b5e6-96231b3b80d8
* Unbreak build with gcc 4.3: provide missed includes and silence most ↵Anton Korobeynikov2008-02-20
| | | | | | annoying warnings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47367 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable exception handling int JITNicolas Geoffray2008-02-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47079 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45418 91177308-0d34-0410-b5e6-96231b3b80d8
* Adjust VStudio files to add JITMemoryManager files + include <cassert> from ↵Chuck Rose III2007-12-06
| | | | | | same. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44651 91177308-0d34-0410-b5e6-96231b3b80d8
* split the JIT memory management code out from the main JIT logic into itsChris Lattner2007-12-05
own JITMemoryManager interface. There is no functionality change with this patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44640 91177308-0d34-0410-b5e6-96231b3b80d8