Go to the documentation of this file.
14 #ifndef LLVM_EXECUTIONENGINE_SECTIONMEMORYMANAGER_H
15 #define LLVM_EXECUTIONENGINE_SECTIONMEMORYMANAGER_H
22 #include <system_error>
75 unsigned Flags, std::error_code &EC) = 0;
128 bool isReadOnly)
override;
153 struct FreeMemBlock {
160 unsigned PendingPrefixIndex;
180 std::error_code applyMemoryGroupPermissions(MemoryGroup &MemGroup,
181 unsigned Permissions);
183 void anchor()
override;
186 MemoryGroup RWDataMem;
187 MemoryGroup RODataMem;
188 MemoryMapper &MMapper;
193 #endif // LLVM_EXECUTIONENGINE_SECTIONMEMORYMANAGER_H
This is an optimization pass for GlobalISel generic memory operations.
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
SectionMemoryManager(MemoryMapper *MM=nullptr)
Creates a SectionMemoryManager instance with MM as the associated memory mapper.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
~SectionMemoryManager() override
This class encapsulates the notion of a memory block which has an address and a size.
AllocationPurpose
This enum describes the various reasons to allocate pages from allocateMappedMemory.
This is a simple memory manager which implements the methods called by the RuntimeDyld class to alloc...
uint8_t * allocateDataSection(uintptr_t Size, unsigned Alignment, unsigned SectionID, StringRef SectionName, bool isReadOnly) override
Allocates a memory block of (at least) the given size suitable for executable code.
void operator=(const SectionMemoryManager &)=delete
virtual void invalidateInstructionCache()
Invalidate instruction cache for code sections.
uint8_t * allocateCodeSection(uintptr_t Size, unsigned Alignment, unsigned SectionID, StringRef SectionName) override
Allocates a memory block of (at least) the given size suitable for executable code.
virtual std::error_code protectMappedMemory(const sys::MemoryBlock &Block, unsigned Flags)=0
This method sets the protection flags for a block of memory to the state specified by Flags.
Implementations of this interface are used by SectionMemoryManager to request pages from the operatin...
StringRef - Represent a constant reference to a string, i.e.
bool finalizeMemory(std::string *ErrMsg=nullptr) override
Update section-specific memory permissions and other attributes.
virtual sys::MemoryBlock allocateMappedMemory(AllocationPurpose Purpose, size_t NumBytes, const sys::MemoryBlock *const NearBlock, unsigned Flags, std::error_code &EC)=0
This method attempts to allocate NumBytes bytes of virtual memory for Purpose.
virtual std::error_code releaseMappedMemory(sys::MemoryBlock &M)=0
This method releases a block of memory that was allocated with the allocateMappedMemory method.