From ff2b4948ce67f1927310d8cd5cddbe7f098524e8 Mon Sep 17 00:00:00 2001 From: Jim Grosbach Date: Tue, 28 Oct 2008 18:25:49 +0000 Subject: Support for constant islands in the ARM JIT. Since the ARM constant pool handling supercedes the standard LLVM constant pool entirely, the JIT emitter does not allocate space for the constants, nor initialize the memory. The constant pool is considered part of the instruction stream. Likewise, when resolving relocations into the constant pool, a hook into the target back end is used to resolve from the constant ID# to the address where the constant is stored. For now, the support in the ARM emitter is limited to 32-bit integer. Future patches will expand this to the full range of constants necessary. llvm-svn: 58338 --- llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'llvm/lib/ExecutionEngine') diff --git a/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp b/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp index 688d4984c20..44e6638562c 100644 --- a/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp +++ b/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp @@ -1011,6 +1011,11 @@ void* JITEmitter::allocateSpace(intptr_t Size, unsigned Alignment) { } void JITEmitter::emitConstantPool(MachineConstantPool *MCP) { + if (TheJIT->getJITInfo().hasCustomConstantPool()) { + DOUT << "JIT: Target has custom constant pool handling. Omitting standard " + "constant pool\n"; + return; + } const std::vector &Constants = MCP->getConstants(); if (Constants.empty()) return; @@ -1124,6 +1129,10 @@ void *JITEmitter::finishFunctionStub(const GlobalValue* F) { // method. // intptr_t JITEmitter::getConstantPoolEntryAddress(unsigned ConstantNum) const { + if (TheJIT->getJITInfo().hasCustomConstantPool()) { + return TheJIT->getJITInfo().getCustomConstantPoolEntryAddress(ConstantNum); + } + assert(ConstantNum < ConstantPool->getConstants().size() && "Invalid ConstantPoolIndex!"); return (intptr_t)ConstantPoolBase + -- cgit v1.2.3