[llvm-commits] [llvm] r58952 - /llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp
Evan Cheng
evan.cheng at apple.com
Sun Nov 9 17:52:24 PST 2008
Author: evancheng
Date: Sun Nov 9 19:52:24 2008
New Revision: 58952
URL: http://llvm.org/viewvc/llvm-project?rev=58952&view=rev
Log:
Forgot these.
Modified:
llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp
Modified: llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp?rev=58952&r1=58951&r2=58952&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp Sun Nov 9 19:52:24 2008
@@ -62,9 +62,9 @@
/// corresponds to.
std::map<void*, Function*> StubToFunctionMap;
- /// GlobalToNonLazyPtrMap - Keep track of the lazy pointer created for a
+ /// GlobalToIndirectSymMap - Keep track of the indirect symbol created for a
/// particular GlobalVariable so that we can reuse them if necessary.
- std::map<GlobalValue*, void*> GlobalToNonLazyPtrMap;
+ std::map<GlobalValue*, void*> GlobalToIndirectSymMap;
public:
std::map<Function*, void*>& getFunctionToStubMap(const MutexGuard& locked) {
@@ -78,9 +78,9 @@
}
std::map<GlobalValue*, void*>&
- getGlobalToNonLazyPtrMap(const MutexGuard& locked) {
+ getGlobalToIndirectSymMap(const MutexGuard& locked) {
assert(locked.holds(TheJIT->lock));
- return GlobalToNonLazyPtrMap;
+ return GlobalToIndirectSymMap;
}
};
@@ -123,9 +123,9 @@
/// specified address, created lazily on demand.
void *getExternalFunctionStub(void *FnAddr);
- /// getGlobalValueNonLazyPtr - Return a non-lazy pointer containing the
+ /// getGlobalValueIndirectSym - Return an indirect symbol containing the
/// specified GV address.
- void *getGlobalValueNonLazyPtr(GlobalValue *V, void *GVAddress);
+ void *getGlobalValueIndirectSym(GlobalValue *V, void *GVAddress);
/// AddCallbackAtLocation - If the target is capable of rewriting an
/// instruction without the use of a stub, record the location of the use so
@@ -187,23 +187,23 @@
return Stub;
}
-/// getGlobalValueNonLazyPtr - Return a lazy pointer containing the specified
+/// getGlobalValueIndirectSym - Return a lazy pointer containing the specified
/// GV address.
-void *JITResolver::getGlobalValueNonLazyPtr(GlobalValue *GV, void *GVAddress) {
+void *JITResolver::getGlobalValueIndirectSym(GlobalValue *GV, void *GVAddress) {
MutexGuard locked(TheJIT->lock);
// If we already have a stub for this global variable, recycle it.
- void *&NonLazyPtr = state.getGlobalToNonLazyPtrMap(locked)[GV];
- if (NonLazyPtr) return NonLazyPtr;
+ void *&IndirectSym = state.getGlobalToIndirectSymMap(locked)[GV];
+ if (IndirectSym) return IndirectSym;
// Otherwise, codegen a new lazy pointer.
- NonLazyPtr = TheJIT->getJITInfo().emitGlobalValueNonLazyPtr(GV, GVAddress,
+ IndirectSym = TheJIT->getJITInfo().emitGlobalValueIndirectSym(GV, GVAddress,
*TheJIT->getCodeEmitter());
- DOUT << "JIT: Stub emitted at [" << NonLazyPtr << "] for GV '"
+ DOUT << "JIT: Indirect symbol emitted at [" << IndirectSym << "] for GV '"
<< GV->getName() << "'\n";
- return NonLazyPtr;
+ return IndirectSym;
}
/// getExternalFunctionStub - Return a stub for the function at the
@@ -575,7 +575,7 @@
private:
void *getPointerToGlobal(GlobalValue *GV, void *Reference, bool NoNeedStub);
- void *getPointerToGVNonLazyPtr(GlobalValue *V, void *Reference,
+ void *getPointerToGVIndirectSym(GlobalValue *V, void *Reference,
bool NoNeedStub);
unsigned addSizeOfGlobal(const GlobalVariable *GV, unsigned Size);
unsigned addSizeOfGlobalsInConstantVal(const Constant *C, unsigned Size);
@@ -618,13 +618,13 @@
return Resolver.getFunctionStub(F);
}
-void *JITEmitter::getPointerToGVNonLazyPtr(GlobalValue *V, void *Reference,
+void *JITEmitter::getPointerToGVIndirectSym(GlobalValue *V, void *Reference,
bool DoesntNeedStub) {
// Make sure GV is emitted first.
// FIXME: For now, if the GV is an external function we force the JIT to
- // compile it so the non-lazy pointer will contain the fully resolved address.
+ // compile it so the indirect symbol will contain the fully resolved address.
void *GVAddress = getPointerToGlobal(V, Reference, true);
- return Resolver.getGlobalValueNonLazyPtr(V, GVAddress);
+ return Resolver.getGlobalValueIndirectSym(V, GVAddress);
}
static unsigned GetConstantPoolSizeInBytes(MachineConstantPool *MCP) {
@@ -897,8 +897,8 @@
ResultPtr = getPointerToGlobal(MR.getGlobalValue(),
BufferBegin+MR.getMachineCodeOffset(),
MR.doesntNeedStub());
- } else if (MR.isGlobalValueNonLazyPtr()) {
- ResultPtr = getPointerToGVNonLazyPtr(MR.getGlobalValue(),
+ } else if (MR.isIndirectSymbol()) {
+ ResultPtr = getPointerToGVIndirectSym(MR.getGlobalValue(),
BufferBegin+MR.getMachineCodeOffset(),
MR.doesntNeedStub());
} else if (MR.isBasicBlock()) {
More information about the llvm-commits
mailing list