summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/JIT/JITMemoryManager.cpp
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2008-10-03 16:17:20 +0000
committerJim Grosbach <grosbach@apple.com>2008-10-03 16:17:20 +0000
commitb22ef71d46f0f583dc1401f20df809d1da8d1831 (patch)
treecdb15da7dd03d15b3bc71aeaad0572c8c16e68a0 /llvm/lib/ExecutionEngine/JIT/JITMemoryManager.cpp
parent332ad5e01630e1d8c1b976dd7bf1a5a893df8e94 (diff)
downloadbcm5719-llvm-b22ef71d46f0f583dc1401f20df809d1da8d1831.tar.gz
bcm5719-llvm-b22ef71d46f0f583dc1401f20df809d1da8d1831.zip
On Darwin ARM, memory needs special handling to do JIT. This patch expands
this handling to work properly for modifying stub functions, relocations back to entry points after JIT compilation, etc.. llvm-svn: 57013
Diffstat (limited to 'llvm/lib/ExecutionEngine/JIT/JITMemoryManager.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/JIT/JITMemoryManager.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/lib/ExecutionEngine/JIT/JITMemoryManager.cpp b/llvm/lib/ExecutionEngine/JIT/JITMemoryManager.cpp
index 804e88df4ca..0ffc7799013 100644
--- a/llvm/lib/ExecutionEngine/JIT/JITMemoryManager.cpp
+++ b/llvm/lib/ExecutionEngine/JIT/JITMemoryManager.cpp
@@ -365,6 +365,21 @@ namespace {
// Finally, remove this entry from TableBlocks.
TableBlocks.erase(I);
}
+
+ /// setMemoryWritable - When code generation is in progress,
+ /// the code pages may need permissions changed.
+ void setMemoryWritable(void)
+ {
+ for (unsigned i = 0, e = Blocks.size(); i != e; ++i)
+ sys::Memory::setWritable(Blocks[i]);
+ }
+ /// setMemoryExecutable - When code generation is done and we're ready to
+ /// start execution, the code pages may need permissions changed.
+ void setMemoryExecutable(void)
+ {
+ for (unsigned i = 0, e = Blocks.size(); i != e; ++i)
+ sys::Memory::setExecutable(Blocks[i]);
+ }
};
}
OpenPOWER on IntegriCloud