summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/JIT/JITMemoryManager.cpp
Commit message (Collapse)AuthorAgeFilesLines
* This threads SectionName through the allocateCodeSection/allocateDataSection ↵Filip Pizlo2013-10-021-2/+3
| | | | | | | | | | | | | | | | | | APIs, both in C++ and C land. It's useful for the memory managers that are allocating a section to know what the name of the section is. At a minimum, this is useful for low-level debugging - it's customary for JITs to be able to tell you what memory they allocated, and as part of any such dump, they should be able to tell you some meta-data about what each allocation is for. This allows clients that supply their own memory managers to do this. Additionally, we also envision the SectionName being useful for passing meta-data from within LLVM to an LLVM client. This changes both the C and C++ APIs, and all of the clients of those APIs within LLVM. I'm assuming that it's safe to change the C++ API because that API is allowed to change. I'm assuming that it's safe to change the C API because we haven't shipped the API in a release yet (LLVM 3.3 doesn't include the MCJIT memory management C API). llvm-svn: 191804
* Fixed alignment of code sections in the JIT mode. Added a test to the ↵Elena Demikhovsky2013-07-021-2/+7
| | | | | | JITMemoryManager. llvm-svn: 185421
* Minor changes to the MCJITTest unittests to use the correct API for finalizingDavid Tweed2013-05-171-1/+1
| | | | | | | the JIT object (including XFAIL an ARM test that now needs fixing). Also renames internal function for consistency. llvm-svn: 182085
* Remove exception handling support from the old JIT.Rafael Espindola2013-05-071-26/+0
| | | | llvm-svn: 181354
* Fix More CastsDavid Greene2013-01-141-3/+8
| | | | | | Properly cast some more code that triggered cast-away-const errors. llvm-svn: 172469
* Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-021-1/+1
| | | | | | | | | | | | | | | | | | | | | into their new header subdirectory: include/llvm/IR. This matches the directory structure of lib, and begins to correct a long standing point of file layout clutter in LLVM. There are still more header files to move here, but I wanted to handle them in separate commits to make tracking what files make sense at each layer easier. The only really questionable files here are the target intrinsic tablegen files. But that's a battle I'd rather not fight today. I've updated both CMake and Makefile build systems (I think, and my tests think, but I may have missed something). I've also re-sorted the includes throughout the project. I'll be committing updates to Clang, DragonEgg, and Polly momentarily. llvm-svn: 171366
* Remove duplicate includes.Roman Divacky2012-12-211-1/+0
| | | | llvm-svn: 170902
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-031-5/+5
| | | | | | | | | | | | | | | | | 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. =] llvm-svn: 169131
* Interface changes to allow RuntimeDyld memory managers to set memory ↵Andrew Kaylor2012-11-151-1/+5
| | | | | | permissions after an object has been loaded. llvm-svn: 168114
* Fixed a problem in the JIT memory allocator whereSean Callanan2012-08-151-0/+3
| | | | | | | | | | 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. llvm-svn: 161984
* Fix some formatting, grammar and style issues and add a couple of missing ↵Eli Bendersky2012-04-291-1/+1
| | | | | | comments. llvm-svn: 155793
* Move getPointerToNamedFunction() from JIT/MCJIT to JITMemoryManager.Danil Malyshev2012-03-281-0/+150
| | | | llvm-svn: 153607
* Revert a series of commits to MCJIT to get the build working in CMakeChandler Carruth2012-03-221-153/+0
| | | | | | | | | | | | | | | (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. llvm-svn: 153241
* Based on this discussion: ↵Danil Malyshev2012-03-211-0/+153
| | | | | | | | | 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. llvm-svn: 153205
* MCJIT support for non-function sections.Jim Grosbach2012-01-161-0/+44
| | | | | | | | | | | | | | | | 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. llvm-svn: 148258
* Merge System into Support.Michael J. Spencer2010-11-291-1/+1
| | | | llvm-svn: 120298
* Use twines to simplify calls to report_fatal_error. For code size and ↵Benjamin Kramer2010-04-081-4/+2
| | | | | | readability. llvm-svn: 100756
* rename llvm::llvm_report_error -> llvm::report_fatal_errorChris Lattner2010-04-071-1/+1
| | | | llvm-svn: 100709
* Change errs() to dbgs().David Greene2010-01-051-1/+1
| | | | llvm-svn: 92562
* Fix typo, cleanup whitespace.Eric Christopher2009-11-121-35/+35
| | | | llvm-svn: 86917
* Remove dlsym stubs, with Nate Begeman's permission.Jeffrey Yasskin2009-11-091-11/+0
| | | | llvm-svn: 86606
* Verify that the function and exception table have been allocatedNicolas Geoffray2009-10-221-2/+2
| | | | | | before freeing them. llvm-svn: 84859
* Move the Function*->allocated blocks map from the JITMemoryManager to theJeffrey Yasskin2009-10-201-32/+12
| | | | | | | | | | | | | | | 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. llvm-svn: 84651
* Initialize the PoisonMemory member before initializingDan Gohman2009-08-271-7/+7
| | | | | | | | | 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. llvm-svn: 80192
* remove a few DOUTs here and there.Chris Lattner2009-08-231-1/+1
| | | | llvm-svn: 79832
* Fix a bug where the DWARF emitter in the JIT was not initializing alignmentReid Kleckner2009-08-211-0/+4
| | | | | | | | | | 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. llvm-svn: 79674
* This void is implicit in C++.Dan Gohman2009-08-121-2/+2
| | | | llvm-svn: 78848
* In TrimAllocationToSize, if a block is below the minimum allocation size,Nicolas Geoffray2009-07-291-1/+4
| | | | | | | there is no new block added to the free list. Therefore on the next startFunctionBody call, a new slab must be allocated. llvm-svn: 77520
* Re-committing r76828 with the JIT memory manager changes now that the buildReid Kleckner2009-07-231-95/+269
| | | | | | bots like the BumpPtrAllocator changes. llvm-svn: 76902
* Reverting r76825 and r76828, since they caused clang runtime errors and some ↵Reid Kleckner2009-07-231-269/+95
| | | | | | build failure involving memset. llvm-svn: 76838
* Make the JIT code emitter properly retry and ask for more memory when it runsReid Kleckner2009-07-231-95/+269
| | | | | | | | | | | | | 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. llvm-svn: 76828
* Convert more assert(0)+abort() -> LLVM_UNREACHABLE,Torok Edwin2009-07-111-8/+5
| | | | | | and abort()/exit() -> llvm_report_error(). llvm-svn: 75363
* Add an option to allocate JITed global data separately from code. ByJeffrey Yasskin2009-07-081-16/+57
| | | | | | | | | | | | | | 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! llvm-svn: 75059
* Use uint8_t and int32_t in {JIT,Machine}CodeEmitersBruno Cardoso Lopes2009-06-041-28/+26
| | | | llvm-svn: 72821
* Revert 72650Bruno Cardoso Lopes2009-06-031-26/+28
| | | | llvm-svn: 72783
* Use uint8_t and int32_t in {JIT,Machine}CodeEmitersBruno Cardoso Lopes2009-05-301-28/+26
| | | | llvm-svn: 72650
* Use CHAR_BIT instead of hard-coding 8 in several places where itDan Gohman2009-04-011-1/+2
| | | | | | | is appropriate. This helps visually differentiate host-oriented calculations from target-oriented calculations. llvm-svn: 68227
* Fix PR3724 by searching for the largest free block when Chris Lattner2009-03-091-2/+19
| | | | | | | | | allocating memory in the JIT. This is insanely inefficient, but hey, most people implement their own memory managers anyway. Patch by Eric Yew! llvm-svn: 66472
* Add support to the JIT for true non-lazy operation. When a call to a functionNate Begeman2009-02-181-1/+11
| | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 64906
* fix a tricky bug in the JIT global variable emitter, that was triggered when ↵Nuno Lopes2008-10-211-1/+18
| | | | | | 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. llvm-svn: 57900
* Add <cstdio> include where needed by gcc-4.4.Duncan Sands2008-10-081-0/+1
| | | | | | Patch by Samuel Tardieu. llvm-svn: 57291
* On Darwin ARM, memory needs special handling to do JIT. This patch expandsJim Grosbach2008-10-031-0/+15
| | | | | | | this handling to work properly for modifying stub functions, relocations back to entry points after JIT compilation, etc.. llvm-svn: 57013
* Preliminary support for systems which require changing JIT memory regions ↵Evan Cheng2008-09-181-0/+4
| | | | | | privilege from read / write to read / executable. llvm-svn: 56303
* Rewrite JIT handling of GlobalVariables so theyDale Johannesen2008-08-071-1/+1
| | | | | | | | | | | | | | 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. llvm-svn: 54442
* Fix for PR2578. Do not split off a block whose size is less than ↵Evan Cheng2008-07-291-0/+3
| | | | | | FreeRangeHeader::getMinBlockSize(). Patch by Damien. llvm-svn: 54152
* Use static_cast instead of reinterpret_cast for casting void*.Dan Gohman2008-06-211-1/+1
| | | | llvm-svn: 52592
* Correlate stubs with functions in JIT: when emitting a stub, the JIT tells ↵Nicolas Geoffray2008-04-161-2/+5
| | | | | | | | the memory manager which function the stub will resolve. llvm-svn: 49814
* fix 80 col violationsChris Lattner2008-03-071-1/+2
| | | | llvm-svn: 48019
* Unbreak build with gcc 4.3: provide missed includes and silence most ↵Anton Korobeynikov2008-02-201-0/+2
| | | | | | annoying warnings. llvm-svn: 47367
* Enable exception handling int JITNicolas Geoffray2008-02-131-0/+41
| | | | llvm-svn: 47079
OpenPOWER on IntegriCloud