Home | History | Annotate | Download | only in JIT

Lines Matching refs:Memory

1 //===-- JITMemoryManager.cpp - Memory Allocator for JIT'd code ------------===//
25 #include "llvm/Support/Memory.h"
44 STATISTIC(NumSlabs, "Number of slabs of memory allocated by the JIT");
49 // Memory Block Implementation.
53 /// MemoryRangeHeader - For a range of memory, this is the header that we put
54 /// on the block of memory. It is carefully crafted to be one word of memory.
68 /// BlockSize - This is the size in bytes of this memory block,
73 /// getBlockAfter - Return the memory block immediately after this one.
88 /// bits in the object headers, and adding an end of region memory block.
98 /// FreeRangeHeader - For a memory block that isn't already allocated, this
105 /// getMinBlockSize - Get the minimum size for a memory block. Blocks
156 /// bits in the object headers, and adding an end of region memory block.
261 // Memory Block Implementation.
277 /// DefaultJITMemoryManager - Manage memory for the JIT code generation.
278 /// This splits a large block of MAP_NORESERVE'd memory into two
285 // Whether to poison freed memory.
290 /// stubs, data, and code contiguously in memory. In general, however, this
295 // Memory slabs allocated by the JIT. We refer to them as slabs so we don't
296 // confuse them with the blocks of memory described above.
305 // When emitting code into a memory block, this is the block.
308 uint8_t *GOTBase; // Target Specific reserved memory
317 /// DefaultCodeSlabSize - When we have to go map more memory, we allocate at
346 /// executable memory, returning a pointer to it and its actual size.
367 // another block of memory and add it to the free list.
370 DEBUG(dbgs() << "JIT: Allocating another slab of memory for function.");
377 // Allocate the entire memory block.
384 /// memory from the OS and add it to the free list. Returns the new
387 // If the user needs at least MinSize free memory, then we account for
396 // Put a tiny allocated block at the end of the memory chunk, so when
404 // Start out with a vast new block of free memory.
407 // Make sure getFreeBlockBefore doesn't look into unmapped memory.
418 memory
428 // Release the memory at the end of this block that isn't needed.
432 /// allocateSpace - Allocate a memory block of the given size. This method
450 /// allocateStub - Allocate memory for a function stub.
456 /// allocateGlobal - Allocate memory for a global.
461 /// allocateCodeSection - Allocate memory for a code section.
486 // another block of memory and add it to the free list.
488 DEBUG(dbgs() << "JIT: Allocating another slab of memory for function.");
495 // Allocate the entire memory block.
497 // Release the memory at the end of this block that isn't needed.
502 /// allocateDataSection - Allocate memory for a data section.
508 /// startExceptionTable - Use startFunctionBody to allocate memory for the
515 /// and takes the memory in the range [TableStart,TableEnd).
524 // Release the memory at the end of this block that isn't needed.
542 // Free the memory.
546 /// deallocateFunctionBody - Deallocate all memory for the specified
552 /// deallocateExceptionTable - Deallocate memory for the specified
563 sys::Memory::setWritable(CodeSlabs[i]);
570 sys::Memory::setExecutable(CodeSlabs[i]);
573 /// setPoisonMemory - Controls whether we write garbage over freed memory.
591 sys::Memory::ReleaseRWX(B);
611 // We set up the memory chunk with 4 mem regions, like this:
621 // Add MemoryRangeHeader to the end of the memory region, indicating that
622 // the space after the block of memory is allocated. This is block #3.
668 sys::Memory::ReleaseRWX(CodeSlabs[i]);
677 sys::MemoryBlock B = sys::Memory::AllocateRWX(size, LastSlabPtr, &ErrMsg);
679 report_fatal_error("Allocation failed when allocating new memory in the"
696 /// accessing bad memory. This function is defined here instead of in
738 // Check each memory range.
917 // Allocate memory for code in 512K slabs.