Home | History | Annotate | Download | only in JIT

Lines Matching refs:Memory

1 //===-- JITMemoryManager.cpp - Memory Allocator for JIT'd code ------------===//
26 #include "llvm/Support/Memory.h"
43 STATISTIC(NumSlabs, "Number of slabs of memory allocated by the JIT");
48 // Memory Block Implementation.
52 /// MemoryRangeHeader - For a range of memory, this is the header that we put
53 /// on the block of memory. It is carefully crafted to be one word of memory.
67 /// BlockSize - This is the size in bytes of this memory block,
72 /// getBlockAfter - Return the memory block immediately after this one.
92 /// bits in the object headers, and adding an end of region memory block.
102 /// FreeRangeHeader - For a memory block that isn't already allocated, this
109 /// getMinBlockSize - Get the minimum size for a memory block. Blocks
160 /// bits in the object headers, and adding an end of region memory block.
265 // Memory Block Implementation.
281 /// DefaultJITMemoryManager - Manage memory for the JIT code generation.
282 /// This splits a large block of MAP_NORESERVE'd memory into two
289 // Whether to poison freed memory.
294 /// stubs, data, and code contiguously in memory. In general, however, this
299 // Memory slabs allocated by the JIT. We refer to them as slabs so we don't
300 // confuse them with the blocks of memory described above.
309 // When emitting code into a memory block, this is the block.
312 uint8_t *GOTBase; // Target Specific reserved memory
321 /// DefaultCodeSlabSize - When we have to go map more memory, we allocate at
350 /// executable memory, returning a pointer to it and its actual size.
371 // another block of memory and add it to the free list.
374 DEBUG(dbgs() << "JIT: Allocating another slab of memory for function.");
381 // Allocate the entire memory block.
388 /// memory from the OS and add it to the free list. Returns the new
391 // If the user needs at least MinSize free memory, then we account for
400 // Put a tiny allocated block at the end of the memory chunk, so when
408 // Start out with a vast new block of free memory.
411 // Make sure getFreeBlockBefore doesn't look into unmapped memory.
422 /// endFunctionBody - The function F is now allocated, and takes the memory
432 // Release the memory at the end of this block that isn't needed.
436 /// allocateSpace - Allocate a memory block of the given size. This method
454 /// allocateStub - Allocate memory for a function stub.
460 /// allocateGlobal - Allocate memory for a global.
465 /// allocateCodeSection - Allocate memory for a code section.
490 // another block of memory and add it to the free list.
492 DEBUG(dbgs() << "JIT: Allocating another slab of memory for function.");
499 // Allocate the entire memory block.
501 // Release the memory at the end of this block that isn't needed.
506 /// allocateDataSection - Allocate memory for a data section.
516 /// startExceptionTable - Use startFunctionBody to allocate memory for the
523 /// and takes the memory in the range [TableStart,TableEnd).
532 // Release the memory at the end of this block that isn't needed.
550 // Free the memory.
554 /// deallocateFunctionBody - Deallocate all memory for the specified
560 /// deallocateExceptionTable - Deallocate memory for the specified
571 sys::Memory::setWritable(CodeSlabs[i]);
578 sys::Memory::setExecutable(CodeSlabs[i]);
581 /// setPoisonMemory - Controls whether we write garbage over freed memory.
599 sys::Memory::ReleaseRWX(B);
619 // We set up the memory chunk with 4 mem regions, like this:
629 // Add MemoryRangeHeader to the end of the memory region, indicating that
630 // the space after the block of memory is allocated. This is block #3.
676 sys::Memory::ReleaseRWX(CodeSlabs[i]);
685 sys::MemoryBlock B = sys::Memory::AllocateRWX(size, LastSlabPtr, &ErrMsg);
687 report_fatal_error("Allocation failed when allocating new memory in the"
704 /// accessing bad memory. This function is defined here instead of in
746 // Check each memory range.
925 // Allocate memory for code in 512K slabs.